From da56f63ef0340922eaa7156137030e7277bc81b5 Mon Sep 17 00:00:00 2001 From: Metin Kale Date: Mon, 25 Dec 2023 15:47:47 +0100 Subject: [PATCH] add ci_build.sh --- ci_build.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ci_build.sh diff --git a/ci_build.sh b/ci_build.sh new file mode 100644 index 00000000..675de254 --- /dev/null +++ b/ci_build.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# checkout open-prayer-times and run publishToMavenLocal +if [ -d "open-prayer-times" ]; then + echo "open-prayer-times exists, fetch latest" + cd open-prayer-times + git fetch origin + git reset --hard origin/main +else + echo "open-prayer-times does not exist, checkout" + git clone https://github.com/metinkale38/open-prayer-times + cd open-prayer-times + chmod +x gradlew +fi +./gradlew publishToMavenLocal --no-daemon +cd .. + +# create secrets.xml +if [ -d "/features/base/src/main/res/secrets.xml" ]; then + echo "secrets.xml already exists, skip" +else + echo 'Generate secrets.xml' + echo '' > features/base/src/main/res/values/secrets.xml + echo ' YOUR_API_KEY' >> features/base/src/main/res/values/secrets.xml + echo ' YOUR_IGMG_KEY' >> features/base/src/main/res/values/secrets.xml + echo ' YOUR_API_KEY' >> features/base/src/main/res/values/secrets.xml + echo '' >> features/base/src/main/res/values/secrets.xml +fi + +# remove com.google.gms build plugin +sed -e '/com.google.gms/ s/^\/*/\/\//' -i app/build.gradle +sed -e '/com.google.gms/ s/^\/*/\/\//' -i build.gradle +sed -e '/crashlytics/ s/^\/*/\/\//' -i app/build.gradle +sed -e '/crashlytics/ s/^\/*/\/\//' -i build.gradle + +# build project +echo "Build project" +chmod +x gradlew +./gradlew assembleFdroid --no-daemon