當前位置: 首頁>>代碼示例>>Java>>正文


Java JvmLibrarySpec類代碼示例

本文整理匯總了Java中org.gradle.jvm.JvmLibrarySpec的典型用法代碼示例。如果您正苦於以下問題:Java JvmLibrarySpec類的具體用法?Java JvmLibrarySpec怎麽用?Java JvmLibrarySpec使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


JvmLibrarySpec類屬於org.gradle.jvm包,在下文中一共展示了JvmLibrarySpec類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createJarBinarySpecLocalComponentMetaData

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void createJarBinarySpecLocalComponentMetaData(EnumMap<UsageKind, List<PublishArtifact>> artifacts, JarBinarySpecInternal jarBinarySpec, EnumMap<UsageKind, Iterable<DependencySpec>> dependenciesPerUsage, boolean toAssembly) {
    JarFile apiJar = jarBinarySpec.getApiJar();
    configureUsageMetadata(UsageKind.API,
        jarBinarySpec.getApiDependencies(),
        dependenciesPerUsage);

    JarFile runtimeJar = jarBinarySpec.getRuntimeJar();
    JvmLibrarySpec library = jarBinarySpec.getLibrary();
    configureUsageMetadata(UsageKind.RUNTIME,
        library != null ? collectDependencies(jarBinarySpec, library, library.getDependencies().getDependencies(), jarBinarySpec.getApiDependencies()) : Collections.<DependencySpec>emptyList(),
        dependenciesPerUsage);

    if (!toAssembly) {
        addArtifact(UsageKind.API, apiJar, artifacts);
        addArtifact(UsageKind.RUNTIME, runtimeJar, artifacts);
    }

}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:20,代碼來源:JvmLocalLibraryMetaDataAdapter.java

示例2: execute

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public void execute(JvmLibrarySpec jvmLibrary) {
    List<String> targetPlatforms = jvmLibrary.getTargetPlatforms();
    // TODO:DAZ We should have a generic (JVM + Native) way to get the 'best' platform to build when no target is defined.
    // This logic needs to inspect the available platforms and find the closest one matching the current platform
    if (targetPlatforms.isEmpty()) {
        targetPlatforms = Collections.singletonList(new DefaultJavaPlatform(JavaVersion.current()).getName());
    }
    List<JavaPlatform> selectedPlatforms = platforms.select(JavaPlatform.class, targetPlatforms);
    for (JavaPlatform platform: selectedPlatforms) {
        JavaToolChain toolChain = toolChains.getForPlatform(platform);
        BinaryNamingSchemeBuilder componentBuilder = namingSchemeBuilder
                .withComponentName(jvmLibrary.getName())
                .withTypeString("jar");
        if (selectedPlatforms.size() > 1) { //Only add variant dimension for multiple jdk targets to avoid breaking the default naming scheme
            componentBuilder = componentBuilder.withVariantDimension(platform.getName());
        }
        BinaryNamingScheme namingScheme = componentBuilder.build(); //TODO freekh: move out?
        factory.createJarBinaries(jvmLibrary, namingScheme, toolChain, platform); //TODO: createJarBinaries is mutable! We should not be doing this - execute could return a list instead
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:21,代碼來源:JvmLibrarySpecInitializer.java

示例3: apply

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public void apply(final Project project) {
    project.getPlugins().apply(ComponentModelBasePlugin.class);

    ComponentSpecContainer componentSpecs = project.getExtensions().getByType(ComponentSpecContainer.class);

    final ProjectSourceSet sources = project.getExtensions().getByType(ProjectSourceSet.class);
    componentSpecs.registerFactory(JvmLibrarySpec.class, new NamedDomainObjectFactory<JvmLibrarySpec>() {
        public JvmLibrarySpec create(String name) {
            ComponentSpecIdentifier id = new DefaultComponentSpecIdentifier(project.getPath(), name);
            return new DefaultJvmLibrarySpec(id, sources.maybeCreate(name));
        }
    });

    final NamedDomainObjectContainer<JvmLibrarySpec> jvmLibraries = componentSpecs.containerWithType(JvmLibrarySpec.class);
    project.getExtensions().create("jvm", DefaultJvmComponentExtension.class, jvmLibraries);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:17,代碼來源:JvmComponentPlugin.java

示例4: createBinaries

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的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());
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:20,代碼來源:JvmComponentPlugin.java

示例5: getLibrary

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
@Override
public JvmLibrarySpec getLibrary() {
    return getComponentAs(JvmLibrarySpec.class);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:5,代碼來源:DefaultJarBinarySpec.java

示例6: register

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
@ComponentType
public void register(TypeBuilder<JvmLibrarySpec> builder) {
    builder.defaultImplementation(DefaultJvmLibrarySpec.class);
    builder.internalView(JvmLibrarySpecInternal.class);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:6,代碼來源:JvmComponentPlugin.java

示例7: namingSchemeFor

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
private BinaryNamingScheme namingSchemeFor(JvmLibrarySpec jvmLibrary, List<JavaPlatform> selectedPlatforms, JavaPlatform platform) {
    return DefaultBinaryNamingScheme.component(jvmLibrary.getName())
        .withBinaryType("Jar")
        .withRole("jar", true)
        .withVariantDimension(platform, selectedPlatforms);
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:7,代碼來源:JvmComponentPlugin.java

示例8: createJarBinaries

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public void createJarBinaries(JvmLibrarySpec jvmLibrary, BinaryNamingScheme namingScheme, JavaToolChain toolChain, JavaPlatform platform) {
    DefaultJarBinarySpec jarBinary = instantiator.newInstance(DefaultJarBinarySpec.class, jvmLibrary, namingScheme, toolChain, platform);
    setupDefaults(jarBinary);
    jarBinary.source(jvmLibrary.getSource());
    jvmLibrary.getBinaries().add(jarBinary);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:7,代碼來源:DefaultJarBinariesFactory.java

示例9: DefaultJarBinarySpec

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public DefaultJarBinarySpec(JvmLibrarySpec library, BinaryNamingScheme namingScheme, JavaToolChain toolChain, JavaPlatform platform) {
    this.library = library;
    this.namingScheme = namingScheme;
    this.toolChain = toolChain;
    this.platform = platform;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:7,代碼來源:DefaultJarBinarySpec.java

示例10: getLibrary

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public JvmLibrarySpec getLibrary() {
    return library;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:DefaultJarBinarySpec.java

示例11: DefaultJvmComponentExtension

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public DefaultJvmComponentExtension(NamedDomainObjectContainer<JvmLibrarySpec> libraries) {
    this.libraries = libraries;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:DefaultJvmComponentExtension.java

示例12: getLibraries

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public NamedDomainObjectContainer<JvmLibrarySpec> getLibraries() {
    return libraries;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:DefaultJvmComponentExtension.java

示例13: libraries

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
public void libraries(Action<? super NamedDomainObjectContainer<? super JvmLibrarySpec>> action) {
    action.execute(libraries);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:DefaultJvmComponentExtension.java

示例14: jvmLibraries

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
@Model
NamedDomainObjectCollection<JvmLibrarySpec> jvmLibraries(ComponentSpecContainer components) {
    return components.withType(JvmLibrarySpec.class);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:5,代碼來源:JvmComponentPlugin.java

示例15: addLibrarySourceSets

import org.gradle.jvm.JvmLibrarySpec; //導入依賴的package包/類
@Defaults
public void addLibrarySourceSets(@Each JvmLibrarySpec component) {
    component.getSources().create("clojure", ClojureSourceSet.class);
}
 
開發者ID:ajoberstar,項目名稱:graclj,代碼行數:5,代碼來源:ClojureLanguageRules.java


注:本文中的org.gradle.jvm.JvmLibrarySpec類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。