Example #1
0
def build_j2v8_java(config):
    # TODO: pass in file arch ABI
    return \
        u.clearNativeLibs(config) + \
        u.copyNativeLibs(config) + \
        u.setVersionEnv(config) + \
        u.gradle("clean assembleRelease")
Example #2
0
def build_j2v8_junit(config):
    # if you are running this step without cross-compiling, it is assumed that a proper target Android device
    # or emulator is running that can execute the tests (platform + architecture must be compatible to the the build settings)

    test_cmds = \
        u.setVersionEnv(config) + \
        u.gradle("connectedCheck --info")

    # we are running a build directly on the host shell
    if (not config.build_agent):
        # just run the tests on the host directly
        return test_cmds

    # we are cross-compiling, run both the emulator and gradle test-runner in parallel
    else:
        b.apply_file_template(
            "./docker/android/supervisord.template.conf",
            "./docker/android/supervisord.conf",
            lambda x: x.replace("$TEST_CMDS", " && ".join(test_cmds)))

        image_arch = config.target.file_abi(config.arch)
        emu_arch = "-arm" if config.arch == c.arch_arm else "64-x86"

        b.apply_file_template(
            "./docker/android/start-emulator.template.sh",
            "./docker/android/start-emulator.sh", lambda x: x.replace(
                "$IMG_ARCH", image_arch).replace("$EMU_ARCH", emu_arch))

        return [
            "/usr/bin/supervisord -c /j2v8/docker/android/supervisord.conf"
        ]
Example #3
0
def build_j2v8_test(config):
    # if you are running this step without cross-compiling, it is assumed that a proper target Android device
    # or emulator is running that can execute the tests (platform + architecture must be compatible to the the build settings)

    # add the extra step arguments to the command if we got some
    step_args = getattr(config, "args", None)
    step_args = " " + step_args if step_args else ""

    test_cmds = \
        u.setVersionEnv(config) + \
        u.gradle("spoon" + step_args)

    # we are running a build directly on the host shell
    if (not config.cross_agent):
        # just run the tests on the host directly
        return test_cmds

    # we are cross-compiling, run both the emulator and gradle test-runner in parallel
    else:
        b.apply_file_template(
            "./docker/android/supervisord.template.conf",
            "./docker/android/supervisord.conf",
            lambda x: x.replace("$TEST_CMDS", " && ".join(test_cmds)))

        emu_arch = "-arm" if config.arch == c.arch_arm else "64-x86"

        b.apply_file_template(
            "./docker/android/start-emulator.template.sh",
            "./docker/android/start-emulator.sh", lambda x: x.replace(
                "$IMG_ARCH", config.file_abi).replace("$EMU_ARCH", emu_arch))

        return [
            "/usr/bin/supervisord -c /j2v8/docker/android/supervisord.conf"
        ]
Example #4
0
def build_j2v8_test(config):
    # if you are running this step without cross-compiling, it is assumed that a proper target Android device
    # or emulator is running that can execute the tests (platform + architecture must be compatible to the the build settings)

    # add the extra step arguments to the command if we got some
    step_args = getattr(config, "args", None)
    step_args = " " + step_args if step_args else ""

    test_cmds = \
        u.setVersionEnv(config) + \
        u.gradle("spoon" + step_args)

    # we are running a build directly on the host shell
    if (not config.cross_agent):
        # just run the tests on the host directly
        return test_cmds

    # we are cross-compiling, run both the emulator and gradle test-runner in parallel
    else:
        b.apply_file_template(
            "./docker/android/supervisord.template.conf",
            "./docker/android/supervisord.conf",
            lambda x: x.replace("$TEST_CMDS", " && ".join(test_cmds))
        )

        emu_arch = "-arm" if config.arch == c.arch_arm else "64-x86"

        b.apply_file_template(
            "./docker/android/start-emulator.template.sh",
            "./docker/android/start-emulator.sh",
            lambda x: x
                .replace("$IMG_ARCH", config.file_abi)
                .replace("$EMU_ARCH", emu_arch)
        )

	os.chmod("./docker/android/start-emulator.sh", 0755)

        return ["/usr/bin/supervisord -c /j2v8/docker/android/supervisord.conf"]
Example #5
0
def build_j2v8_release(config):
    return \
        u.setVersionEnv(config) + \
        u.gradle(" uploadArchives")
Example #6
0
def build_j2v8_java(config):
    return \
        u.clearNativeLibs(config) + \
        u.copyNativeLibs(config) + \
        u.setVersionEnv(config) + \
        u.gradle("clean assembleRelease")
Example #7
0
def build_j2v8_release(config):
    return \
        u.setVersionEnv(config) + \
        u.gradle(" uploadArchives")