com.android.build.gradle.internal.TaskContainerAdaptor Java Examples

The following examples show how to use com.android.build.gradle.internal.TaskContainerAdaptor. 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: PrepareAaptTask.java    From atlas with Apache License 2.0 6 votes vote down vote up
@Override
public void execute(PrepareAaptTask prepareAaptTask) {

    super.execute(prepareAaptTask);

    if (!appVariantContext.getAtlasExtension().getTBuildConfig().getUseCustomAapt()) {
        prepareAaptTask.setEnabled(false);
        return;
    }

    prepareAaptTask.appVariantContext = appVariantContext;
    prepareAaptTask.processAndroidResources = appVariantContext.getScope()
        .getProcessResourcesTask()
        .get(new TaskContainerAdaptor(scope.getGlobalScope().getProject().getTasks()));

    //prepareAaptTask.mergeResources = appVariantContext.getVariantData().mergeResourcesTask;

}
 
Example #2
Source File: AtlasBaseTaskManager.java    From atlas with Apache License 2.0 5 votes vote down vote up
public AtlasBaseTaskManager(AtlasBuilder androidBuilder, T androidExtension, Project project,
                            AtlasExtension atlasExtension) {
    this.tAndroidBuilder = androidBuilder;
    this.androidExtension = androidExtension;
    this.project = project;
    this.tasks = new TaskContainerAdaptor(project.getTasks());
    this.atlasExtension = atlasExtension;
    this.logger = new LoggerWrapper(Logging.getLogger(AtlasBaseTaskManager.class));
    this.extraModelInfo = new ExtraModelInfo(new ProjectOptions(project), Logging.getLogger(AtlasBaseTaskManager.class));

    //this.dependencyManager = new DependencyManager(androidExtension, project, atlasExtension);
}
 
Example #3
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);
}
 
Example #4
Source File: TPatchTask.java    From atlas with Apache License 2.0 4 votes vote down vote up
@Override
public void execute(TPatchTask tPatchTask) {

    super.execute(tPatchTask);

    final TBuildType tBuildType = appVariantContext.getBuildType();

    if (null == tBuildType ||
            null == tBuildType.getPatchConfig() ||
            !tBuildType.getPatchConfig().isCreateTPatch()) {
        tPatchTask.setEnabled(false);
        return;
    }


    tPatchTask.appVariantContext = appVariantContext;


    ConventionMappingHelper.map(tPatchTask, "outPatchFolder", new Callable<File>() {

        @Override
        public File call() throws Exception {
            return getAppVariantOutputContext().getTPatchFolder();
        }
    });

    ConventionMappingHelper.map(tPatchTask,
            "signingConfig",
            new Callable<DefaultSigningConfig>() {

                @Override
                public DefaultSigningConfig call() throws Exception {
                    return appVariantContext.getSigningConfig();
                }
            });

    ConventionMappingHelper.map(tPatchTask, "patchContext", new Callable<TPatchContext>() {

        @Override
        public TPatchContext call() throws Exception {

            TPatchContext tPatchContext = new TPatchContext();

            AppVariantOutputContext appVariantOutputContext = getAppVariantOutputContext();

            tPatchContext.diffApkFile = appVariantOutputContext.getDiffApk();
            tPatchContext.newApk = appVariantOutputContext.getApkOutputFile(true);
            tPatchContext.outPatchFolder = appVariantOutputContext.getTPatchFolder();
            tPatchContext.manifestFile = new File(scope.getManifestProcessorTask().get(new TaskContainerAdaptor(scope.getGlobalScope().getProject().getTasks())).getManifestOutputDirectory(), "AndroidManifest.xml");
            tPatchContext.apExplodeFolder = appVariantContext.apContext.getApExploredFolder();
            tPatchContext.versionName = ApkDataUtils.get(baseVariantOutput).getVersionName();
            tPatchContext.tpatchHistoryUrl = tBuildType.getPatchConfig()
                    .getTpatchHistoryUrl();
            tPatchContext.hotClassListFile = tBuildType.getPatchConfig().getHotClassListFile();
            tPatchContext.LAST_PATCH_URL = tBuildType.getPatchConfig().getLastPatchUrl();
            tPatchContext.onlyBuildModifyAwb = tBuildType.getPatchConfig()
                    .getOnlyBuildModifyAwb();
            tPatchContext.artifactBundleInfos = appVariantOutputContext.artifactBundleInfos;
            tPatchContext.notPatchBundles = tBuildType.getPatchConfig().getNoPatchBundles();
            tPatchContext.diffNativeSo = tBuildType.getPatchConfig().isDiffNativeSo();
            tPatchContext.diffBundleSo = tBuildType.getPatchConfig().isDiffBundleSo();
            tPatchContext.mainBundleName = tBuildType.getPatchConfig()
                    .getTpatchMainBundleName();
            tPatchContext.excludeFiles = tBuildType.getPatchConfig()
                    .gettPatchNotIncludeFiles()
                    .isEmpty() ? "" : StringUtils.join(tBuildType.getPatchConfig()
                            .gettPatchNotIncludeFiles(),
                    ",");

            tPatchContext.buildId = tBuildType.getPatchConfig().getBuildId();

            tPatchContext.newPatch = tBuildType.getPatchConfig().isNewPatch();
            tPatchContext.writeBuildInfo = tBuildType.getPatchConfig()
                    .isTpatchWriteBuildInfo();
            tPatchContext.diffBundleDex = tBuildType.getPatchConfig()
                    .isOnlyIncrementInAwb();
            tPatchContext.diffMainDex = tBuildType.getPatchConfig()
                    .isOnlyIncrementInMain();
            tPatchContext.excludeClasses = tBuildType.getPatchConfig()
                    .getExcludeClasses();

            tPatchContext.patchClasses = tBuildType.getPatchConfig()
                    .getPatchClasses();

            tPatchContext.appSignName = tBuildType.getPatchConfig().getAppSignName();

            tPatchContext.patchVersions = tBuildType.getPatchConfig().getPatchVersions();

            return tPatchContext;
        }
    });
}
 
Example #5
Source File: BasePlugin.java    From javaide with GNU General Public License v3.0 4 votes vote down vote up
private void createTasks() {
    taskManager.createTasksBeforeEvaluate(new TaskContainerAdaptor(project.getTasks()));
    createAndroidTasks();
}