本文整理汇总了Java中org.gradle.platform.base.ComponentSpecContainer.withType方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentSpecContainer.withType方法的具体用法?Java ComponentSpecContainer.withType怎么用?Java ComponentSpecContainer.withType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.platform.base.ComponentSpecContainer
的用法示例。
在下文中一共展示了ComponentSpecContainer.withType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachBinariesToAssembleLifecycle
import org.gradle.platform.base.ComponentSpecContainer; //导入方法依赖的package包/类
@Mutate
void attachBinariesToAssembleLifecycle(@Path("tasks.assemble") Task assemble, ComponentSpecContainer components) {
List<BinarySpecInternal> notBuildable = Lists.newArrayList();
boolean hasBuildableBinaries = false;
for (VariantComponentSpec component : components.withType(VariantComponentSpec.class)) {
for (BinarySpecInternal binary : component.getBinaries().withType(BinarySpecInternal.class)) {
if (binary.isBuildable()) {
assemble.dependsOn(binary);
hasBuildableBinaries = true;
} else {
notBuildable.add(binary);
}
}
}
if (!hasBuildableBinaries && !notBuildable.isEmpty()) {
assemble.doFirst(new CheckForNotBuildableBinariesAction(notBuildable));
}
}
示例2: collectBinaries
import org.gradle.platform.base.ComponentSpecContainer; //导入方法依赖的package包/类
@Mutate
void collectBinaries(BinaryContainer binaries, ComponentSpecContainer componentSpecs) {
for (VariantComponentSpec componentSpec : componentSpecs.withType(VariantComponentSpec.class)) {
for (BinarySpecInternal binary : componentSpec.getBinaries().withType(BinarySpecInternal.class).values()) {
binaries.put(binary.getProjectScopedName(), binary);
}
}
}
示例3: jvmLibraries
import org.gradle.platform.base.ComponentSpecContainer; //导入方法依赖的package包/类
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
return components.withType(JvmLibrarySpec.class);
}
示例4: nativeComponents
import org.gradle.platform.base.ComponentSpecContainer; //导入方法依赖的package包/类
@Model
NamedDomainObjectSet<NativeComponentSpec> nativeComponents(ComponentSpecContainer components) {
return components.withType(NativeComponentSpec.class);
}