8000 add -f option to clean the whole build / force compilation · abgoyal/python-for-android@0884323 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0884323

Browse files
committed
add -f option to clean the whole build / force compilation
1 parent 00ed402 commit 0884323

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Available options to `distribute.sh`::
100100
-h Show this help
101101
-l Show a list of available modules
102102
-m 'mod1 mod2' Modules to include
103+
-f Restart from scratch (remove the current build)
103104

104105
Step 2: package your application
105106
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

distribute.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ CRED="\x1b[31;01m"
2424
CBLUE="\x1b[34;01m"
2525
CGRAY="\x1b[30;01m"
2626
CRESET="\x1b[39;49;00m"
27+
DO_CLEAN_BUILD=0
2728

2829
# Use ccache ?
2930
which ccache &>/dev/null
@@ -144,6 +145,7 @@ function usage() {
144145
echo " -h Show this help"
145146
echo " -l Show a list of available modules"
146147
echo " -m 'mod1 mod2' Modules to include"
148+
echo " -f Restart from scratch (remove the current build)"
147149
echo
148150
exit 0
149151
}
@@ -210,6 +212,13 @@ function run_prepare() {
210212
fi
211213
try mkdir -p "$DIST_PATH"
212214

215+
if [ $DO_CLEAN_BUILD -eq 1 ]; then
216+
info "Cleaning build"
217+
try rm -rf $BUILD_PATH
218+
try rm -rf $SRC_PATH/obj
219+
try rm -rf $SRC_PATH/libs
220+
fi
221+
213222
# create initial files
214223
echo "target=android-$ANDROIDAPI" > $SRC_PATH/default.properties
215224
echo "sdk.dir=$ANDROIDSDK" > $SRC_PATH/local.properties
@@ -502,7 +511,7 @@ function list_modules() {
502511
}
503512

504513
# Do the build
505-
while getopts ":hvlm:d:" opt; do
514+
while getopts ":hvlfm:d:" opt; do
506515
case $opt in
507516
h)
508517
usage
@@ -516,6 +525,9 @@ while getopts ":hvlm:d:" opt; do
516525
d)
517526
DIST_PATH="$ROOT_PATH/dist/$OPTARG"
518527
;;
528+
f)
529+
DO_CLEAN_BUILD=1
530+
;;
519531
\?)
520532
echo "Invalid option: -$OPTARG" >&2
521533
exit 1

0 commit comments

Comments
 (0)
0