本文整理汇总了Java中org.gradle.api.NamedDomainObjectContainer类的典型用法代码示例。如果您正苦于以下问题:Java NamedDomainObjectContainer类的具体用法?Java NamedDomainObjectContainer怎么用?Java NamedDomainObjectContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NamedDomainObjectContainer类属于org.gradle.api包,在下文中一共展示了NamedDomainObjectContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AtlasExtension
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public AtlasExtension(@NonNull final ProjectInternal project,
@NonNull Instantiator instantiator,
@NonNull NamedDomainObjectContainer<T> buildTypes,
@NonNull NamedDomainObjectContainer<PatchConfig> patchConfigs,
@NonNull NamedDomainObjectContainer<DexConfig>dexConfigs) {
logger = Logging.getLogger(this.getClass());
this.project = project;
this.patchConfigs = patchConfigs;
this.dexConfigs = dexConfigs;
this.buildTypes = buildTypes;
this.multiDexConfigs = project.container(MultiDexConfig.class, new MultiDexConfigFactory(
instantiator,project, project.getLogger()));
tBuildConfig = (Z) instantiator.newInstance(TBuildConfig.class);
manifestOptions = instantiator.newInstance(ManifestOptions.class);
bundleConfig = instantiator.newInstance(BundleConfig.class);
}
示例2: createExtendsion
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public AtlasExtension createExtendsion(Project project, Instantiator instantiator) {
AtlasExtension atlasExtension = getExtendsion(project);
if (null != atlasExtension) {
return atlasExtension;
}
final NamedDomainObjectContainer<TBuildType> buildTypeContainer = project.container(TBuildType.class,
new TBuildTypeFactory(
instantiator, project,
project.getLogger()));
final NamedDomainObjectContainer<PatchConfig> patchConfigContainer = project.container(PatchConfig.class,
new PatchConfigFactory(
instantiator,
project, project
.getLogger()));
final NamedDomainObjectContainer<DexConfig>dexConfigContainer = project.container(DexConfig.class,new DexConfigFactory(instantiator,project,project.getLogger()));
return project.getExtensions().create("atlas", AtlasExtension.class, project, instantiator,
buildTypeContainer, patchConfigContainer,dexConfigContainer);
}
示例3: getVariants
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
@Override
public NamedDomainObjectContainer<ConfigurationVariant> getVariants() {
if (variants == null) {
// Create variants container only as required
variants = new FactoryNamedDomainObjectContainer<ConfigurationVariant>(ConfigurationVariant.class, instantiator, new NamedDomainObjectFactory<ConfigurationVariant>() {
@Override
public ConfigurationVariant create(String name) {
return instantiator.newInstance(DefaultVariant.class, name, parentAttributes, artifactNotationParser, fileCollectionFactory);
}
});
}
return variants;
}
示例4: addMarkerPublications
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
PublicationContainer publications = publishing.getPublications();
NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
for (PluginDeclaration declaration : declaredPlugins) {
createMavenMarkerPublication(declaration, (MavenPublication) publications.getByName("pluginMaven"), publications);
}
}
示例5: addMarkerPublications
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
if (!pluginDevelopment.isAutomatedPublishing()) {
return;
}
PublicationContainer publications = publishing.getPublications();
NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
for (PluginDeclaration declaration : declaredPlugins) {
createIvyMarkerPublication(declaration, (IvyPublication) publications.getByName("pluginIvy"), publications);
}
}
示例6: setProperty
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public static void setProperty(Object object,
String fieldName,
String value)
throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchFieldException {
String[] fieldNames = fieldName.split("\\.");
Object last = object;
for (int i = 0; i < fieldNames.length - 1; i++) {
String field = fieldNames[i];
if (last instanceof NamedDomainObjectContainer) {
last = ((NamedDomainObjectContainer)last).maybeCreate(field);
} else {
Field declaredField = last.getClass().getField(field);
declaredField.setAccessible(true);
if (null == declaredField.get(last)) {
Object newInstance = declaredField.getType()
.getConstructors()
.getClass()
.newInstance();
declaredField.set(last, newInstance);
}
last = declaredField.get(last);
}
}
BeanUtils.setProperty(last, fieldNames[fieldNames.length - 1], value);
}
示例7: configureForSourceSets
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
private void configureForSourceSets(NamedDomainObjectContainer<AndroidSourceSet> sourceSets) {
sourceSets.all(sourceSet -> {
Task task = project.getTasks().create(getTaskName(sourceSet, getTaskBaseName(), null), getCastedTaskType());
task.setGroup(JavaBasePlugin.VERIFICATION_GROUP);
configureForSourceSet(sourceSet, (T)task);
});
}
示例8: createConfigDsl
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
private SamConfig createConfigDsl() {
log.debug("Setup serverless config DSL");
final NamedDomainObjectContainer<Stage> stages = project.container(Stage.class);
final SamConfigDsl samConfig = project.getExtensions().create("serverless", SamConfigDsl.class, project,
stages);
((ExtensionAware) samConfig).getExtensions().add("stages", stages);
return new SamConfig(project, samConfig);
}
示例9: TestedExtension
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public TestedExtension(@NonNull ProjectInternal project, @NonNull Instantiator instantiator,
@NonNull AndroidBuilder androidBuilder, @NonNull SdkHandler sdkHandler,
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs,
@NonNull ExtraModelInfo extraModelInfo, boolean isLibrary) {
super(project, instantiator, androidBuilder, sdkHandler, buildTypes, productFlavors,
signingConfigs, extraModelInfo, isLibrary);
getSourceSetsContainer().create(ANDROID_TEST.getPrefix());
getSourceSetsContainer().create(UNIT_TEST.getPrefix());
}
示例10: TestExtension
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public TestExtension(@NonNull ProjectInternal project, @NonNull Instantiator instantiator,
@NonNull AndroidBuilder androidBuilder, @NonNull SdkHandler sdkHandler,
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs,
@NonNull ExtraModelInfo extraModelInfo, boolean isLibrary) {
super(project, instantiator, androidBuilder, sdkHandler, buildTypes, productFlavors,
signingConfigs, extraModelInfo, isLibrary);
}
示例11: AppExtension
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public AppExtension(@NonNull ProjectInternal project, @NonNull Instantiator instantiator,
@NonNull AndroidBuilder androidBuilder, @NonNull SdkHandler sdkHandler,
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs,
@NonNull ExtraModelInfo extraModelInfo, boolean isLibrary) {
super(project, instantiator, androidBuilder, sdkHandler, buildTypes, productFlavors,
signingConfigs, extraModelInfo, isLibrary);
}
示例12: LibraryExtension
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public LibraryExtension(@NonNull ProjectInternal project, @NonNull Instantiator instantiator,
@NonNull AndroidBuilder androidBuilder, @NonNull SdkHandler sdkHandler,
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs,
@NonNull ExtraModelInfo extraModelInfo, boolean isLibrary) {
super(project, instantiator, androidBuilder, sdkHandler, buildTypes, productFlavors,
signingConfigs, extraModelInfo, isLibrary);
}
示例13: createDefaultComponents
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
@Override
public void createDefaultComponents(
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs) {
// don't call super as we don't want the default app version.
// must create signing config first so that build type 'debug' can be initialized
// with the debug signing config.
signingConfigs.create(BuilderConstants.DEBUG);
buildTypes.create(BuilderConstants.DEBUG);
}
示例14: createDefaultComponents
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
@Override
public void createDefaultComponents(
@NonNull NamedDomainObjectContainer<BuildType> buildTypes,
@NonNull NamedDomainObjectContainer<ProductFlavor> productFlavors,
@NonNull NamedDomainObjectContainer<SigningConfig> signingConfigs) {
// must create signing config first so that build type 'debug' can be initialized
// with the debug signing config.
signingConfigs.create(DEBUG);
buildTypes.create(DEBUG);
buildTypes.create(RELEASE);
}
示例15: AndroidConfigAdaptor
import org.gradle.api.NamedDomainObjectContainer; //导入依赖的package包/类
public AndroidConfigAdaptor(
AndroidConfig model,
NamedDomainObjectContainer<AndroidSourceSet> sourceSetsContainer) {
this.model = model;
this.sourceSetsContainer = sourceSetsContainer;
applyProjectSourceSet();
}