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