todotxt / todo.txt-android

Official Todo.txt Android app for managing your todo.txt file stored in Dropbox.
http://todotxt.com
GNU General Public License v3.0
1.24k stars 408 forks source link

Adding Docker to standardize build process #508

Open beavel opened 5 years ago

beavel commented 5 years ago

I was having difficulty building the app after I made what I believed to be the upgrades to Dropbox code for v2 API. Since I haven't done Android development before and to isolate issues, I decided to put together a Dockerfile and clarify the build environment as I had miscellaneous tools installed and wasn't sure what was causing issues. I added back the necessary jars to build the original APK and worked through issues until I build the original APK from source and install it without issue. The following commands were used to build successfully:

docker build -t android-build .
docker run -it --rm --entrypoint="/bin/bash" android-build

# At the console prompt in the container
./gradlew assembleDebug

# From another free console, I copied out the apk
docker container ls
docker cp <container_name_from_previous_step>:/usr/src/app/app/build/outputs/apk/free/debug/ D:\tmp\todo.txt # change the output directory 'D:\tmp\todo.txt' to your preference.

I have a dropbox-v2 branch based off of this, which currently does not build, but I believe it is a matter of figuring out how to update the ActionBarSherlock activities with AppCompat as the new Dropbox SDK required enabling multiDexEnabled, which in turn required update Sdk versions to a minimum of 21. I also disabled Proguard as I wasn't able to get it to build with it enabled. Long story short, there may be other approaches to solving the issues listed above, but I figured the Docker image baselines the build environment and eliminates the individual system differences between developers.