예제 #1
0
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
파일: noCLIpse.py 프로젝트: DLaicH/noCLIpse
    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
예제 #5
0
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
예제 #6
0
    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
예제 #7
0
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