com.android.build.gradle.api.BaseVariant Java Examples
The following examples show how to use
com.android.build.gradle.api.BaseVariant.
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: TaskManager.java From dart with Apache License 2.0 | 6 votes |
/** * A henson navigator is a class that helps a consumer to consume the navigation api that it * declares in its dependencies. The henson navigator will wrap the intent builders. Thus, a * henson navigator, is driven by consumption of intent builders, whereas the henson classes are * driven by the production of an intent builder. * * <p>This task is created per android variant: * * <ul> * <li>we scan the variant compile configuration for navigation api dependencies * <li>we generate a henson navigator class for this variant that wraps the intent builders * </ul> * * @param variant the variant for which to create a builder. * @param hensonNavigatorPackageName the package name in which we create the class. */ public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGenerationTask( BaseVariant variant, String hensonNavigatorPackageName, File destinationFolder) { TaskProvider<GenerateHensonNavigatorTask> generateHensonNavigatorTask = project .getTasks() .register( "generate" + capitalize(variant.getName()) + "HensonNavigator", GenerateHensonNavigatorTask.class, (Action<GenerateHensonNavigatorTask>) generateHensonNavigatorTask1 -> { generateHensonNavigatorTask1.hensonNavigatorPackageName = hensonNavigatorPackageName; generateHensonNavigatorTask1.destinationFolder = destinationFolder; generateHensonNavigatorTask1.variant = variant; generateHensonNavigatorTask1.logger = logger; generateHensonNavigatorTask1.project = project; generateHensonNavigatorTask1.hensonNavigatorGenerator = hensonNavigatorGenerator; }); return generateHensonNavigatorTask; }
Example #2
Source File: VariantProcessor.java From Injector with Apache License 2.0 | 5 votes |
VariantProcessor(Project project, BaseVariant variant) { this.project = project; this.variant = variant; this.androidExtension = (BaseExtension) project.getExtensions().getByName("android"); this.variantName = variant.getName(); this.variantName = variantName.substring(0, 1).toUpperCase() + variantName.substring(1); try { projectPackageName = new XmlSlurper().parse(androidExtension.getSourceSets().getByName("main").getManifest() .getSrcFile()).getProperty("@package").toString(); } catch (IOException | SAXException | ParserConfigurationException e) { e.printStackTrace(); } }
Example #3
Source File: ApiObjectFactory.java From javaide with GNU General Public License v3.0 | 5 votes |
public void create(BaseVariantData<?> variantData) { // Testing variants are handled together with their "owners". BaseVariant variantApi = variantFactory.createVariantApi(variantData, readOnlyObjectProvider); // Only add the variant API object to the domain object set once it's been fully // initialized. extension.addVariant(variantApi); }
Example #4
Source File: ExtraModelInfo.java From javaide with GNU General Public License v3.0 | 5 votes |
public void registerJavaArtifact( @NonNull String name, @NonNull BaseVariant variant, @NonNull String assembleTaskName, @NonNull String javaCompileTaskName, @NonNull Collection<File> generatedSourceFolders, @NonNull Iterable<String> ideSetupTaskNames, @NonNull Configuration configuration, @NonNull File classesFolder, @NonNull File javaResourcesFolder, @Nullable SourceProvider sourceProvider) { ArtifactMetaData artifactMetaData = extraArtifactMap.get(name); if (artifactMetaData == null) { throw new IllegalArgumentException(String.format( "Artifact with name %1$s is not yet registered. Use registerArtifactType()", name)); } if (artifactMetaData.getType() != ArtifactMetaData.TYPE_JAVA) { throw new IllegalArgumentException( String.format("Artifact with name %1$s is not of type JAVA", name)); } JavaArtifact artifact = new JavaArtifactImpl( name, assembleTaskName, javaCompileTaskName, ideSetupTaskNames, generatedSourceFolders, classesFolder, javaResourcesFolder, null, new ConfigurationDependencies(configuration), sourceProvider, null); extraJavaArtifacts.put(variant.getName(), artifact); }
Example #5
Source File: BaseExtension.java From javaide with GNU General Public License v3.0 | 5 votes |
public void registerJavaArtifact( @NonNull String name, @NonNull BaseVariant variant, @NonNull String assembleTaskName, @NonNull String javaCompileTaskName, @NonNull Collection<File> generatedSourceFolders, @NonNull Iterable<String> ideSetupTaskNames, @NonNull Configuration configuration, @NonNull File classesFolder, @NonNull File javaResourceFolder, @Nullable SourceProvider sourceProvider) { extraModelInfo.registerJavaArtifact(name, variant, assembleTaskName, javaCompileTaskName, generatedSourceFolders, ideSetupTaskNames, configuration, classesFolder, javaResourceFolder, sourceProvider); }
Example #6
Source File: AndServerPlugin.java From AndServer with Apache License 2.0 | 5 votes |
private void configGenerator(Project project, DomainObjectSet<? extends BaseVariant> variants) { variants.all(it -> { File outputDir = new File(project.getBuildDir(), "generated/source/andServer/" + it.getDirName()); String taskName = String.format("generate%sAppInfo", capitalize(it.getName())); Task generate = project.getTasks().create(taskName, AppInfoGenerator.class, generator -> { generator.setOutputDir(outputDir); String appId = it.getApplicationId(); generator.setAppId(appId); String packageName = String.format("%s.andserver.plugin.generator", appId); generator.setPackageName(packageName); }); it.registerJavaGeneratingTask(generate, outputDir); }); }
Example #7
Source File: HensonManager.java From dart with Apache License 2.0 | 5 votes |
public TaskProvider<GenerateHensonNavigatorTask> createHensonNavigatorGenerationTask( BaseVariant variant, File destinationFolder) { if (hensonExtension == null || hensonExtension.getNavigatorPackageName() == null) { throw new InvalidParameterException( "The property 'henson.navigatorPackageName' must be defined in your build.gradle"); } String hensonNavigatorPackageName = hensonExtension.getNavigatorPackageName(); TaskProvider<GenerateHensonNavigatorTask> generateHensonNavigatorTask = taskManager.createHensonNavigatorGenerationTask( variant, hensonNavigatorPackageName, destinationFolder); return generateHensonNavigatorTask; }
Example #8
Source File: InjectorPlugin.java From Injector with Apache License 2.0 | 4 votes |
private void processVariant(BaseVariant variant) { VariantProcessor processor = new VariantProcessor(project, variant); processor.setJarFiles(jars); processor.setAndroidArchiveLibraries(aars); processor.processVariant(extension); }
Example #9
Source File: AppExtension.java From javaide with GNU General Public License v3.0 | 4 votes |
@Override public void addVariant(BaseVariant variant) { applicationVariantList.add((ApplicationVariant) variant); }
Example #10
Source File: VariantFactory.java From javaide with GNU General Public License v3.0 | 4 votes |
@NonNull BaseVariant createVariantApi( @NonNull BaseVariantData<? extends BaseVariantOutputData> variantData, @NonNull ReadOnlyObjectProvider readOnlyObjectProvider);
Example #11
Source File: LibraryExtension.java From javaide with GNU General Public License v3.0 | 4 votes |
@Override public void addVariant(BaseVariant variant) { libraryVariantList.add((LibraryVariant) variant); }
Example #12
Source File: JFXMobileAppExtension.java From javafxmobile-plugin with BSD 3-Clause "New" or "Revised" License | 2 votes |
@Override public void addVariant(BaseVariant variant) { }
Example #13
Source File: BaseExtension.java From javaide with GNU General Public License v3.0 | votes |
public abstract void addVariant(BaseVariant variant);