本文整理匯總了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);
}