Search in sources :

Example 6 with ExecSpec

use of org.gradle.process.ExecSpec in project atlas by alibaba.

the class ZipAlignUtils method doZipAlign.

public static synchronized File doZipAlign(final AndroidBuilder androidBuilder, Project project, final File apkFile) {
    final File zipalignedFile = new File(apkFile.getParent(), apkFile.getName().replace(".apk", "-zipaligned.apk"));
    project.exec(new Action<ExecSpec>() {

        @Override
        public void execute(ExecSpec execSpec) {
            String path = androidBuilder.getTargetInfo().getBuildTools().getPath(ZIP_ALIGN);
            execSpec.executable(new File(path));
            execSpec.args("-f", "4");
            execSpec.args(apkFile);
            execSpec.args(zipalignedFile);
        }
    });
    return zipalignedFile;
}
Also used : ExecSpec(org.gradle.process.ExecSpec) File(java.io.File)

Example 7 with ExecSpec

use of org.gradle.process.ExecSpec in project atlas by alibaba.

the class BuildHelper method doZipAlign.

public static synchronized File doZipAlign(final AndroidBuilder androidBuilder, Project project, final File apkFile) {
    final File zipalignedFile = new File(apkFile.getParent(), apkFile.getName().replace(".apk", "-zipaligned.apk"));
    project.exec(new Action<ExecSpec>() {

        @Override
        public void execute(ExecSpec execSpec) {
            String path = androidBuilder.getTargetInfo().getBuildTools().getPath(ZIP_ALIGN);
            execSpec.executable(new File(path));
            execSpec.args("-f", "4");
            execSpec.args(apkFile);
            execSpec.args(zipalignedFile);
        }
    });
    return zipalignedFile;
}
Also used : ExecSpec(org.gradle.process.ExecSpec) File(java.io.File)

Aggregations

ExecSpec (org.gradle.process.ExecSpec)7 File (java.io.File)6 Action (org.gradle.api.Action)2 InputFile (org.gradle.api.tasks.InputFile)2 TaskAction (org.gradle.api.tasks.TaskAction)2 IOException (java.io.IOException)1 Task (org.gradle.api.Task)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1 CopySpec (org.gradle.api.file.CopySpec)1 RegularFile (org.gradle.api.file.RegularFile)1 ConsoleRenderer (org.gradle.internal.logging.ConsoleRenderer)1