Skip to content

Instantly share code, notes, and snippets.

@MichaelCurrie
Created October 1, 2015 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MichaelCurrie/333e68ce4be0943fac9f to your computer and use it in GitHub Desktop.
Save MichaelCurrie/333e68ce4be0943fac9f to your computer and use it in GitHub Desktop.
Makefile for buildozer.
#!/bin/bash
# run this from ~/github/Lanki
# Remove any previous buildozer files from the folder
buildozer android clean
git pull
# Create the .buildozer folder and download its subcomponents, including the blacklist.txt file we are about to modify
buildozer android update
# Remove the line containing csv so the csv module is installed, as per the warning on
# http://python-for-android.readthedocs.org/en/latest/usage/#step-2-package-your-application
# grep -v reverses the search, showing all lines except the one matching the pattern
cwd=$(pwd)
# INSTALL CSV module
# This requires removing _csv from the two blacklist files
# According to
# https://groups.google.com/forum/#!msg/kivy-users/mgisdssF39M/28vgOWfM0y0J
# There are 2 locations for blacklist.txt:
# - one is inside .buildozer/android/platform/python-for-android/src/ and
# - the other is in python-for-android/dist/distname
# the first changes the blacklist for every compilation;
# the second for a specific compilation.
cd .buildozer/android/platform/python-for-android/src/
cat blacklist.txt | grep -v "_csv" > blacklist.txt2
rm blacklist.txt
mv blacklist.txt2 blacklist.txt
cd $cwd
cd .buildozer/android/platform/python-for-android/dist/lanki/
cat blacklist.txt | grep -v "_csv" > blacklist.txt2
rm blacklist.txt
mv blacklist.txt2 blacklist.txt
cd $cwd
# Use time to report the time it took to execute the command
time buildozer --verbose android debug
# Make a beep sound over the terminal interface on my local machine to tell me it's done
echo $'\a'
# COPY the generated APK file to an external location
#aws s3 sync bin/* s3://michaeltest999
cp bin/* ~/Dropbox/Kristian/
rm bin/*
~/bin/dropbox.py status
@MichaelCurrie
Copy link
Author

The lines involving blacklist.txt are explained here:

kivy/python-for-android#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment