com.android.build.gradle.internal.process.GradleProcessExecutor Java Examples

The following examples show how to use com.android.build.gradle.internal.process.GradleProcessExecutor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AtlasConfigurationHelper.java    From atlas with Apache License 2.0 6 votes vote down vote up
public void createBuilderAfterEvaluate() throws Exception {

        AndroidBuilder androidBuilder = appPluginHook.getAndroidBuilder();

        if (null == androidBuilder) {
            return;
        }

        AndroidBuilder atlasBuilder = new AtlasBuilder(project.equals(project.getRootProject()) ? project
                .getName() : project.getPath(),
                creator,
                new GradleProcessExecutor(project),
                new GradleJavaProcessExecutor(project),
                DefaultGroovyMethods.asType(ReflectUtils.getField(
                        androidBuilder,
                        "mErrorReporter"),
                        ErrorReporter.class),
                LoggerWrapper.getLogger(AtlasBuilder.class),
                DefaultGroovyMethods.asType(ReflectUtils.getField(
                        androidBuilder,
                        "mVerboseExec"), Boolean.class));

        ((AtlasBuilder) atlasBuilder).setDefaultBuilder(androidBuilder);
        ((AtlasBuilder) atlasBuilder).setAtlasExtension(atlasExtension);
        AtlasBuildContext.androidBuilderMap.put(project, (AtlasBuilder) (atlasBuilder));
    }
 
Example #2
Source File: BaseComponentModelPlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
@Model(ANDROID_BUILDER)
public AndroidBuilder createAndroidBuilder(Project project, ExtraModelInfo extraModelInfo) {
    String creator = "Android Gradle";
    ILogger logger = new LoggerWrapper(project.getLogger());

    return new AndroidBuilder(project.equals(project.getRootProject()) ? project.getName()
            : project.getPath(), creator, new GradleProcessExecutor(project),
            new GradleJavaProcessExecutor(project),
            extraModelInfo, logger, project.getLogger().isEnabled(LogLevel.INFO));

}
 
Example #3
Source File: BasePlugin.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
protected void configureProject() {
        extraModelInfo = new ExtraModelInfo(project, isLibrary());
        sdkHandler = new SdkHandler(project, getLogger());
        androidBuilder = new AndroidBuilder(
                project == project.getRootProject() ? project.getName() : project.getPath(),
                "Android Gradle Java N-IDE",
                new GradleProcessExecutor(project),
                new GradleJavaProcessExecutor(project),
                extraModelInfo,
                getLogger(),
                isVerbose());

//        project.getPlugins().apply(JavaBasePlugin.class);

        // call back on execution. This is called after the whole build is done (not
        // after the current project is done).
        // This is will be called for each (android) projects though, so this should support
        // being called 2+ times.
        project.getGradle().getTaskGraph().addTaskExecutionGraphListener(
                new TaskExecutionGraphListener() {
                    @Override
                    public void graphPopulated(TaskExecutionGraph taskGraph) {
                        for (Task task : taskGraph.getAllTasks()) {
                            if (task instanceof PreDex) {
                                PreDexCache.getCache().load(
                                        new File(project.getRootProject().getBuildDir(),
                                                FD_INTERMEDIATES + "/dex-cache/cache.xml"));
                                break;
                            }
                        }
                    }
                });
    }
 
Example #4
Source File: AndroidExtension.java    From javafxmobile-plugin with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public AndroidExtension(Project project, ToolingModelBuilderRegistry registry) {
    this.project = project;

    this.extraModelInfo = new ExtraModelInfo(new ProjectOptions(project), project.getLogger());

    this.signingConfig = project.getExtensions().create("signingConfig", SigningConfig.class, "signing");
    this.packagingOptions = project.getExtensions().create("packagingOptions", PackagingOptions.class);
    this.dexOptions = project.getExtensions().create("dexOptions", DexOptions.class, extraModelInfo);

    try {
        this.buildCache = FileCache.getInstanceWithMultiProcessLocking(new File(AndroidLocation.getFolder(), "build-cache"));
    } catch (AndroidLocation.AndroidLocationException e) {
        throw new RuntimeException(e);
    }

    LoggerWrapper loggerWrapper = new LoggerWrapper(project.getLogger());

    this.sdkHandler = new SdkHandler(project, loggerWrapper);
    this.androidBuilder = new AndroidBuilder(
            project == project.getRootProject() ? project.getName() : project.getPath(),
            "JavaFX Mobile",
            new GradleProcessExecutor(project),
            new GradleJavaProcessExecutor(project),
            extraModelInfo,
            loggerWrapper,
            false);

    this.androidTaskRegistry = new AndroidTaskRegistry();
    this.taskFactory = new TaskContainerAdaptor(project.getTasks());

    installDirectory = new File(project.getBuildDir(), "javafxports/android");
    project.getLogger().info("Android install directory: " + installDirectory);

    temporaryDirectory = new File(project.getBuildDir(), "javafxports/tmp/android");
    project.getLogger().info("Android temporary output directory: " + temporaryDirectory);

    resourcesDirectory = new File(temporaryDirectory, "resources");
    resourcesDirectory.mkdirs();
    project.getLogger().info("Resources directory: " + resourcesDirectory);

    multidexOutputDirectory = new File(temporaryDirectory, "multi-dex");
    multidexOutputDirectory.mkdirs();
    project.getLogger().info("Multi-dex output directory: " + multidexOutputDirectory);

    dexOutputDirectory = new File(temporaryDirectory, "dex");
    dexOutputDirectory.mkdirs();
    project.getLogger().info("Dex output directory: " + dexOutputDirectory);
}