def build(build_only=None, clean=False): apks = [] for build_name, build_options in BUILDS.items(): if build_only and not build_name == build_only: continue print header = "Building APK for version '%s'..." % build_name print header print "=" * len(header) print try: # Import appropriate translations for this build local('a2po import %s' % build_options.get('a2po_options', '')) # Determine manifest file, build can run a hook manifest = 'AndroidManifest.xml' if build_options.get('manifest_maker', False): manifest = build_options['manifest_maker'](manifest) # Setup a build project p = AndroidProject(manifest, 'Android-Autostarts', project_dir='.', sdk_dir=env.sdk_dir) p.extra_source_dirs = build_options['extra-paths'] # Build the project if clean: p.clean() version = p.manifest_parsed.attrib[ '{http://schemas.android.com/apk/res/android}versionName'] apk = p.build('%s' % build_options['template'] % { 'build': build_name.capitalize(), 'version': version }) # Optionally sign the API file if build_options.get('sign', True): password = raw_input('Enter keystore password:') if not password: print "Not signing the package." else: apk.sign(env.keystore, env.keyalias, password) # Align apk.align() apks.append((apk, build_options)) print print "==> Generated %s" % apk.filename except ProgramFailedError, e: print e print e.stdout
def change_workspace_path(self, event): # wxGlade: noCLIpseFrame.<event_handler> new_path = "" while not os.path.isdir(new_path): new_path = wx.DirSelector( "Select the workspace directory to scan for existing projects", config.workspace_path) if not new_path: return config.workspace_path = new_path # load projects from this path for dirname in os.listdir(config.workspace_path): path = os.path.join(config.workspace_path, dirname) if os.path.isdir(path): ap = AndroidProject(path + '/AndroidManifest.xml', sdk_dir=config.sdk_path) #Go through the directory and load relevant information tmpproject = { 'name': dirname, 'target': ap.platform, 'path': path, 'activity': '', 'package': ap.name, 'unsaved': False, 'original': None } config.projects.append(tmpproject)
def build(): locales() print "Building the APK." try: p = AndroidProject('AndroidManifest.xml', 'Android-Autostarts', sdk_dir=env.sdk_dir, target='10') apk = p.build(env.raw_apk) password = raw_input('Enter keystore password:') if not password: print "Not signing the package." else: apk.sign(env.keystore, env.keyalias, password,) apk.align() except ProgramFailedError, e: print e print e.stdout
def build_project(self, event): # wxGlade: noCLIpseFrame.<event_handler> print "Building - " + self.project_path.GetPath() + "/AndroidManifest.xml with " + config.sdk_path if self.build_type_choice.GetCurrentSelection() == 0: keystore_val = "debug.keystore" keystore_alias = "androiddebugkey" keystore_password = "******" else: print "Release building not yet implemented" keystore_val = "debug.keystore" keystore_alias = "androiddebugkey" keystore_password = "******" project = AndroidProject(self.project_path.GetPath() + '/AndroidManifest.xml',sdk_dir=config.sdk_path) try: project.build() except ProgramFailedError, e: print e.cmdline print e.returncode print e.stderr print e.stdout
def build(build_only=None, clean=False): apks = [] for build_name, build_options in BUILDS.items(): if build_only and not build_name == build_only: continue print header = "Building APK for version '%s'..." % build_name print header print "=" * len(header) print try: # Import appropriate translations for this build local('a2po import %s' % build_options.get('a2po_options', '')) # Determine manifest file, build can run a hook manifest = 'AndroidManifest.xml' if build_options.get('manifest_maker', False): manifest = build_options['manifest_maker'](manifest) # Setup a build project p = AndroidProject(manifest, 'Android-Autostarts', project_dir='.', sdk_dir=env.sdk_dir) p.extra_source_dirs = build_options['extra-paths'] p.extra_jars = ['%s/extras/android/support/v4/android-support-v4.jar' % env.sdk_dir] # Build the project if clean: p.clean() version = p.manifest_parsed.attrib[ '{http://schemas.android.com/apk/res/android}versionName'] apk = p.build('%s' % build_options['template'] % { 'build': build_name.capitalize(), 'version': version }) # Optionally sign the API file if build_options.get('sign', True): password = raw_input('Enter keystore password:') if not password: print "Not signing the package." else: apk.sign(env.keystore, env.keyalias, password) # Align apk.align() apks.append((apk, build_options)) print print "==> Generated %s" % apk.filename except ProgramFailedError, e: print e print e.stdout
def build(clean=False): apks = [] for build_name, build_options in BUILDS.items(): print "Building APK for version '%s'..." % build_name try: manifest = 'AndroidManifest.xml' if build_options.get('manifest_maker', False): manifest = build_options['manifest_maker'](manifest) p = AndroidProject(manifest, 'Android-Autostarts', project_dir='.', sdk_dir=env.sdk_dir) p.extra_source_dirs = build_options['extra-paths'] p.extra_jars = ['%s/extras/android/support/v4/android-support-v4.jar' % env.sdk_dir] if clean: p.clean() version = p.manifest_parsed.attrib['{http://schemas.android.com/apk/res/android}versionName'] apk = p.build('%s' % build_options['template'] % { 'build': build_name.capitalize(), 'version': version }) if build_options.get('sign', True): password = raw_input('Enter keystore password:') if not password: print "Not signing the package." else: apk.sign(env.keystore, env.keyalias, password) apk.align() apks.append((apk, build_options)) except ProgramFailedError, e: print e print e.stdout
def build_project(self, event): # wxGlade: noCLIpseFrame.<event_handler> print "Building - " + self.project_path.GetPath( ) + "/AndroidManifest.xml with " + config.sdk_path if self.build_type_choice.GetCurrentSelection() == 0: keystore_val = "debug.keystore" keystore_alias = "androiddebugkey" keystore_password = "******" else: print "Release building not yet implemented" keystore_val = "debug.keystore" keystore_alias = "androiddebugkey" keystore_password = "******" project = AndroidProject(self.project_path.GetPath() + '/AndroidManifest.xml', sdk_dir=config.sdk_path) try: project.build() except ProgramFailedError, e: print e.cmdline print e.returncode print e.stderr print e.stdout
def build(build_only=None, clean=False): apks = [] for build_name, build_options in BUILDS.items(): if build_only and not build_name == build_only: continue print header = "Building APK for version '%s'..." % build_name print header print "=" * len(header) print try: # Import appropriate translations for this build local("a2po import %s" % build_options.get("a2po_options", "")) # Determine manifest file, build can run a hook manifest = "AndroidManifest.xml" if build_options.get("manifest_maker", False): manifest = build_options["manifest_maker"](manifest) # Setup a build project p = AndroidProject(manifest, "Android-Autostarts", project_dir=".", sdk_dir=env.sdk_dir) p.extra_source_dirs = build_options["extra-paths"] p.extra_jars = ["%s/extras/android/support/v4/android-support-v4.jar" % env.sdk_dir] # Build the project if clean: p.clean() version = p.manifest_parsed.attrib["{http://schemas.android.com/apk/res/android}versionName"] apk = p.build("%s" % build_options["template"] % {"build": build_name.capitalize(), "version": version}) # Optionally sign the API file if build_options.get("sign", True): password = raw_input("Enter keystore password:"******"Not signing the package." else: apk.sign(env.keystore, env.keyalias, password) # Align apk.align() apks.append((apk, build_options)) print print "==> Generated %s" % apk.filename except ProgramFailedError, e: print e print e.stdout