本文整理汇总了Java中org.gradle.platform.base.PlatformContainer类的典型用法代码示例。如果您正苦于以下问题:Java PlatformContainer类的具体用法?Java PlatformContainer怎么用?Java PlatformContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlatformContainer类属于org.gradle.platform.base包,在下文中一共展示了PlatformContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBinaries
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void createBinaries(BinaryContainer binaries, PlatformContainer platforms, BinaryNamingSchemeBuilder namingSchemeBuilder,
NamedDomainObjectCollection<JvmLibrarySpec> libraries, @Path("buildDir") File buildDir, ServiceRegistry serviceRegistry, JavaToolChainRegistry toolChains) {
Instantiator instantiator = serviceRegistry.get(Instantiator.class);
List<Action<? super JarBinarySpec>> actions = Lists.newArrayList();
actions.add(new JarBinarySpecInitializer(buildDir));
actions.add(new MarkBinariesBuildable());
Action<JarBinarySpec> initAction = Actions.composite(actions);
JarBinariesFactory factory = new DefaultJarBinariesFactory(instantiator, initAction);
Action<JvmLibrarySpec> createBinariesAction =
new JvmLibrarySpecInitializer(factory, namingSchemeBuilder, toolChains, platforms);
for (JvmLibrarySpec jvmLibrary : libraries) {
createBinariesAction.execute(jvmLibrary);
binaries.addAll(jvmLibrary.getBinaries());
}
}
示例2: createNativeBinaries
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void createNativeBinaries(BinaryContainer binaries, NamedDomainObjectSet<NativeComponentSpec> nativeComponents,
LanguageRegistry languages, NativeToolChainRegistryInternal toolChains,
PlatformContainer platforms, BuildTypeContainer buildTypes, FlavorContainer flavors,
ServiceRegistry serviceRegistry, @Path("buildDir") File buildDir) {
Instantiator instantiator = serviceRegistry.get(Instantiator.class);
NativeDependencyResolver resolver = serviceRegistry.get(NativeDependencyResolver.class);
Action<NativeBinarySpec> configureBinaryAction = new NativeBinarySpecInitializer(buildDir);
Action<NativeBinarySpec> setToolsAction = new ToolSettingNativeBinaryInitializer(languages);
Action<NativeBinarySpec> setDefaultTargetsAction = new ToolSettingNativeBinaryInitializer(languages);
@SuppressWarnings("unchecked") Action<NativeBinarySpec> initAction = Actions.composite(configureBinaryAction, setToolsAction, new MarkBinariesBuildable());
NativeBinariesFactory factory = new DefaultNativeBinariesFactory(instantiator, initAction, resolver);
BinaryNamingSchemeBuilder namingSchemeBuilder = new DefaultBinaryNamingSchemeBuilder();
Action<NativeComponentSpec> createBinariesAction =
new NativeComponentSpecInitializer(factory, namingSchemeBuilder, toolChains, platforms, buildTypes, flavors);
for (NativeComponentSpec component : nativeComponents) {
createBinariesAction.execute(component);
binaries.addAll(component.getBinaries());
}
}
示例3: repositories
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Model
Repositories repositories(ServiceRegistry serviceRegistry, FlavorContainer flavors, PlatformContainer platforms, BuildTypeContainer buildTypes) {
Instantiator instantiator = serviceRegistry.get(Instantiator.class);
SourceDirectorySetFactory sourceDirectorySetFactory = serviceRegistry.get(SourceDirectorySetFactory.class);
NativePlatforms nativePlatforms = serviceRegistry.get(NativePlatforms.class);
FileCollectionFactory fileCollectionFactory = serviceRegistry.get(FileCollectionFactory.class);
Action<PrebuiltLibrary> initializer = new PrebuiltLibraryInitializer(instantiator, fileCollectionFactory, nativePlatforms, platforms.withType(NativePlatform.class), buildTypes, flavors);
return new DefaultRepositories(instantiator, sourceDirectorySetFactory, initializer);
}
示例4: registerFactoryForCustomNativePlatforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Defaults
public void registerFactoryForCustomNativePlatforms(PlatformContainer platforms, final Instantiator instantiator) {
NamedDomainObjectFactory<NativePlatform> nativePlatformFactory = new NamedDomainObjectFactory<NativePlatform>() {
public NativePlatform create(String name) {
return instantiator.newInstance(DefaultNativePlatform.class, name);
}
};
platforms.registerFactory(NativePlatform.class, nativePlatformFactory);
platforms.registerFactory(Platform.class, nativePlatformFactory);
}
示例5: createAndroidPlatforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void createAndroidPlatforms(PlatformContainer platforms, NdkHandler ndkHandler) {
if (!ndkHandler.isNdkDirConfigured()) {
return;
}
// Create android platforms.
ToolchainConfiguration.configurePlatforms(platforms, ndkHandler);
}
示例6: configurePlatforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
public static void configurePlatforms(PlatformContainer platforms, NdkHandler ndkHandler) {
for (Abi abi : ndkHandler.getSupportedAbis()) {
NativePlatform platform = platforms.maybeCreate(abi.getName(), NativePlatform.class);
// All we care is the name of the platform. It doesn't matter what the
// architecture is, but it must be set to non-x86 so that it does not match
// the default supported platform.
platform.architecture("ppc");
platform.operatingSystem("linux");
}
}
示例7: registerJavaPlatformType
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void registerJavaPlatformType(PlatformContainer platforms, ServiceRegistry serviceRegistry) {
final Instantiator instantiator = serviceRegistry.get(Instantiator.class);
platforms.registerFactory(JavaPlatform.class, new NamedDomainObjectFactory<JavaPlatform>() {
public JavaPlatform create(String name) {
return instantiator.newInstance(DefaultJavaPlatform.class, name);
}
});
}
示例8: createJavaPlatforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void createJavaPlatforms(PlatformContainer platforms, ServiceRegistry serviceRegistry) {
final Instantiator instantiator = serviceRegistry.get(Instantiator.class);
//Create default platforms available for Java
for (JavaVersion javaVersion: JavaVersion.values()) {
DefaultJavaPlatform javaPlatform = instantiator.newInstance(DefaultJavaPlatform.class, javaVersion);
platforms.add(javaPlatform);
}
}
示例9: NativeComponentSpecInitializer
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
public NativeComponentSpecInitializer(NativeBinariesFactory factory, BinaryNamingSchemeBuilder namingSchemeBuilder, NativeToolChainRegistryInternal toolChainRegistry,
PlatformContainer platforms, Collection<? extends BuildType> allBuildTypes, Collection<? extends Flavor> allFlavors) {
this.factory = factory;
this.namingSchemeBuilder = namingSchemeBuilder;
this.toolChainRegistry = toolChainRegistry;
this.allBuildTypes.addAll(allBuildTypes);
this.allFlavors.addAll(allFlavors);
this.platforms = platforms;
}
示例10: repositories
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Model
Repositories repositories(ServiceRegistry serviceRegistry, FlavorContainer flavors, PlatformContainer platforms, BuildTypeContainer buildTypes) {
Instantiator instantiator = serviceRegistry.get(Instantiator.class);
FileResolver fileResolver = serviceRegistry.get(FileResolver.class);
Action<PrebuiltLibrary> initializer = new PrebuiltLibraryInitializer(instantiator, platforms.withType(NativePlatform.class), buildTypes, flavors);
return new DefaultRepositories(instantiator, fileResolver, initializer);
}
示例11: registerNativePlatformFactory
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Mutate
public void registerNativePlatformFactory(PlatformContainer platforms, ServiceRegistry serviceRegistry) {
final Instantiator instantiator = serviceRegistry.get(Instantiator.class);
NamedDomainObjectFactory<NativePlatform> nativePlatformFactory = new NamedDomainObjectFactory<NativePlatform>() {
public NativePlatform create(String name) {
return instantiator.newInstance(DefaultNativePlatform.class, name);
}
};
//TODO freekh: remove cast/this comment when registerDefault exists on interface
((DefaultPlatformContainer) platforms).registerDefaultFactory(nativePlatformFactory);
platforms.registerFactory(NativePlatform.class, nativePlatformFactory);
}
示例12: createDefaultPlatforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Finalize
public void createDefaultPlatforms(PlatformContainer platforms) {
if (platforms.withType(NativePlatform.class).isEmpty()) {
// TODO:DAZ Create a set of known platforms, rather than a single 'default'
NativePlatform defaultPlatform = platforms.create(NativePlatform.DEFAULT_NAME, NativePlatform.class);
}
}
示例13: DefaultPlatformResolvers
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
public DefaultPlatformResolvers(PlatformContainer platforms) {
this.platforms = platforms;
}
示例14: platforms
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Model
PlatformContainer platforms(Instantiator instantiator) {
return instantiator.newInstance(DefaultPlatformContainer.class, instantiator);
}
示例15: platformResolver
import org.gradle.platform.base.PlatformContainer; //导入依赖的package包/类
@Hidden @Model
PlatformResolvers platformResolver(PlatformContainer platforms) {
return new DefaultPlatformResolvers(platforms);
}