mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 14:52:13 -04:00
Fixed generation and install of custom apps
This commit is contained in:
parent
2297c10cec
commit
5523edec26
@ -490,6 +490,16 @@ def step_build_apk(jsdata, **options):
|
|||||||
syscall('./gradlew build --stacktrace')
|
syscall('./gradlew build --stacktrace')
|
||||||
|
|
||||||
|
|
||||||
|
# rename APKs for better listing
|
||||||
|
folder_name = os.path.split(ANDROID_PATH)[-1]
|
||||||
|
for variant in ('debug', 'release-unsigned'):
|
||||||
|
shutil.move(os.path.join('build', 'outputs', 'apk',
|
||||||
|
"{}-{}.apk".format(folder_name, variant)),
|
||||||
|
os.path.join('build', 'outputs', 'apk',
|
||||||
|
"{}-{}.apk".format(jsdata.get('package'), variant)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def step_move_apk_to_destination(jsdata, **options):
|
def step_move_apk_to_destination(jsdata, **options):
|
||||||
""" place and rename built APKs to main output directory """
|
""" place and rename built APKs to main output directory """
|
||||||
|
|
||||||
@ -501,7 +511,7 @@ def step_move_apk_to_destination(jsdata, **options):
|
|||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
# move generated APK to satisfy other scripts
|
# move generated APK to satisfy other scripts
|
||||||
for variant in ('debug', 'debug-unaligned', 'release-unsigned'):
|
for variant in ('debug', 'release-unsigned'):
|
||||||
shutil.move(os.path.join(ANDROID_PATH, 'build', 'outputs', 'apk',
|
shutil.move(os.path.join(ANDROID_PATH, 'build', 'outputs', 'apk',
|
||||||
"{}-{}.apk"
|
"{}-{}.apk"
|
||||||
.format(jsdata.get('package'), variant)),
|
.format(jsdata.get('package'), variant)),
|
||||||
|
@ -8,12 +8,12 @@ if [ "x$1" != "x" ];
|
|||||||
PACKAGE=$1
|
PACKAGE=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f build/outputs/apk/${PACKAGE}-debug-unaligned.apk ]
|
if [ -f build/outputs/apk/${PACKAGE}-debug.apk ]
|
||||||
then
|
then
|
||||||
echo "Uninstalling old Kiwix APK..."
|
echo "Uninstalling old Kiwix APK..."
|
||||||
../src/dependencies/android-sdk/platform-tools/adb uninstall ${PACKAGE} ;
|
${ANDROID_HOME}/platform-tools/adb uninstall ${PACKAGE} ;
|
||||||
echo "Installing new Kiwix APK..."
|
echo "Installing new Kiwix APK..."
|
||||||
../src/dependencies/android-sdk/platform-tools/adb install build/outputs/apk/${PACKAGE}-debug-unaligned.apk
|
${ANDROID_HOME}/platform-tools/adb install build/outputs/apk/${PACKAGE}-debug.apk
|
||||||
else
|
else
|
||||||
echo "No APK file available for package ${PACKAGE} !"
|
echo "No APK file available for package ${PACKAGE} !"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user