add support for package.type and AAR library builds
This commit is contained in:
parent
53b16c933f
commit
1ff55c4fca
1 changed files with 9 additions and 6 deletions
|
@ -784,6 +784,7 @@ class TargetAndroid(Target):
|
||||||
build_cmd += [("--activity-launch-mode", launch_mode)]
|
build_cmd += [("--activity-launch-mode", launch_mode)]
|
||||||
|
|
||||||
# build only in debug right now.
|
# build only in debug right now.
|
||||||
|
packagetype = config.get('app', 'package.type')
|
||||||
if self.build_mode == 'debug':
|
if self.build_mode == 'debug':
|
||||||
build_cmd += [("debug", )]
|
build_cmd += [("debug", )]
|
||||||
mode = 'debug'
|
mode = 'debug'
|
||||||
|
@ -791,7 +792,7 @@ class TargetAndroid(Target):
|
||||||
else:
|
else:
|
||||||
build_cmd += [("release", )]
|
build_cmd += [("release", )]
|
||||||
mode_sign = "release"
|
mode_sign = "release"
|
||||||
mode = self.get_release_mode()
|
mode = mode_sign if packagetype == "library" else self.get_release_mode()
|
||||||
|
|
||||||
self.execute_build_package(build_cmd)
|
self.execute_build_package(build_cmd)
|
||||||
|
|
||||||
|
@ -813,11 +814,13 @@ class TargetAndroid(Target):
|
||||||
if is_gradle_build:
|
if is_gradle_build:
|
||||||
# on gradle build, the apk use the package name, and have no version
|
# on gradle build, the apk use the package name, and have no version
|
||||||
packagename = config.get('app', 'package.name')
|
packagename = config.get('app', 'package.name')
|
||||||
apk = u'{packagename}-{mode}.apk'.format(
|
pkgsuffix = 'aar' if packagetype == 'library' else 'apk'
|
||||||
packagename=packagename, mode=mode)
|
apk = u'{packagename}-{mode}.{extension}'.format(
|
||||||
apk_dir = join(dist_dir, "build", "outputs", "apk", mode_sign)
|
packagename=packagename, mode=mode, extension=pkgsuffix)
|
||||||
apk_dest = u'{packagename}-{version}-{mode}.apk'.format(
|
apk_dir = join(dist_dir, "build", "outputs", pkgsuffix,
|
||||||
packagename=packagename, mode=mode, version=version)
|
('' if packagetype == 'library' else mode_sign))
|
||||||
|
apk_dest = u'{packagename}-{version}-{mode}.{extension}'.format(
|
||||||
|
packagename=packagename, mode=mode, version=version, extension=pkgsuffix)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# on ant, the apk use the title, and have version
|
# on ant, the apk use the title, and have version
|
||||||
|
|
Loading…
Reference in a new issue