本文整理了Java中org.gradle.api.artifacts.Configuration.getArtifacts()
方法的一些代码示例,展示了Configuration.getArtifacts()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getArtifacts()
方法的具体详情如下:
包路径:org.gradle.api.artifacts.Configuration
类名称:Configuration
方法名:getArtifacts
暂无
代码示例来源:origin: alipay/sofa-boot
private void registerPluginActions(Project project, Configuration bootArchives) {
SinglePublishedArtifact singlePublishedArtifact = new SinglePublishedArtifact(
bootArchives.getArtifacts());
List<PluginApplicationAction> actions = Arrays.asList(
new JavaPluginAction(singlePublishedArtifact),
new WarPluginAction(singlePublishedArtifact),
new MavenPluginAction(bootArchives.getUploadTaskName()),
new SofaDependencyManagementPluginAction(), new ApplicationPluginAction(),
new KotlinPluginAction());
for (PluginApplicationAction action : actions) {
Class<? extends Plugin<? extends Project>> pluginClass = action
.getPluginClass();
if (pluginClass != null) {
project.getPlugins().withType(pluginClass,
(plugin) -> action.execute(project));
}
}
}
代码示例来源:origin: me.seeber.gradle/gradle-workspace-plugin
/**
* Get the configurations that export an artifact
*
* @param project Project to search
* @param configuration Configuration to search
* @param exports Known modules
*/
protected void getExportingConfigurations(Project project, Configuration configuration,
Multimap<@NonNull String, @NonNull ExportingConfiguration> exports) {
for (PublishArtifact artifact : configuration.getArtifacts()) {
String key = moduleKey(project, artifact);
exports.put(key, new ExportingConfiguration(project, configuration));
}
}
代码示例来源:origin: com.github.moritzzimmer/fsm-gradle-plugin
private void addPublication(Project project, FSM fsm) {
// remove jar artifact added by java the plugin (see http://issues.gradle.org/browse/GRADLE-687)
Configuration archivesConfig = project.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION);
archivesConfig.getArtifacts().clear();
DefaultArtifactPublicationSet publicationSet = project.getExtensions()
.getByType(DefaultArtifactPublicationSet.class);
publicationSet.addCandidate(new ArchivePublishArtifact(fsm));
}
代码示例来源:origin: gradle.plugin.com.google.cloud.tools/jib-gradle-plugin
for (Configuration targetConfiguration :
dependencyProject.getConfigurations().getByName(configurationName).getHierarchy()) {
for (PublishArtifact artifact : targetConfiguration.getArtifacts()) {
projectDependencyJars.add(artifact.getFile());
代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config
for (PublishArtifact a : configuration.getArtifacts()) {
p.artifact(a);
代码示例来源:origin: me.seeber.gradle/gradle-project-config
for (PublishArtifact a : configuration.getArtifacts()) {
p.artifact(a);
代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config
/**
* @see me.seeber.gradle.plugin.AbstractProjectConfigPlugin#initialize()
*/
@Override
protected void initialize() {
getProject().getPluginManager().apply(GroovyPlugin.class);
getProject().getPluginManager().apply(JavaConfigPlugin.class);
DependencyHandler dependencies = getProject().getDependencies();
ExternalDependency spock = (ExternalDependency) dependencies.add("testCompile",
ImmutableMap.of("group", "org.spockframework", "name", "spock-core", "version", "1.0-groovy-2.4"));
spock.exclude(ImmutableMap.of("group", "org.codehaus.groovy", "module", "groovy-all"));
String name = Validate.notNull(getProject().getName());
Configuration archives = getProject().getConfigurations().getByName("archives");
Jar groovydocJar = getProject().getTasks().create("groovydocJar", Jar.class);
PublishArtifact groovydocArtifact = Projects.createJarPublishArtifact(getProject(), name, "groovydoc", "jar",
"jar", groovydocJar);
archives.getArtifacts().add(groovydocArtifact);
}
}
代码示例来源:origin: me.seeber.gradle/gradle-project-config
/**
* @see me.seeber.gradle.plugin.AbstractProjectConfigPlugin#initialize()
*/
@Override
protected void initialize() {
getProject().getPluginManager().apply(GroovyPlugin.class);
getProject().getPluginManager().apply(JavaConfigPlugin.class);
DependencyHandler dependencies = getProject().getDependencies();
ExternalDependency spock = (ExternalDependency) dependencies.add("testCompile",
ImmutableMap.of("group", "org.spockframework", "name", "spock-core", "version", "1.0-groovy-2.4"));
spock.exclude(ImmutableMap.of("group", "org.codehaus.groovy", "module", "groovy-all"));
String name = Validate.notNull(getProject().getName());
Configuration archives = getProject().getConfigurations().getByName("archives");
Jar groovydocJar = getProject().getTasks().create("groovydocJar", Jar.class);
PublishArtifact groovydocArtifact = Projects.createJarPublishArtifact(getProject(), name, "groovydoc", "jar",
"jar", groovydocJar);
archives.getArtifacts().add(groovydocArtifact);
}
}
代码示例来源:origin: gradle.plugin.me.seeber.gradle/gradle-project-config
PublishArtifact sourcesArtifact = Projects.createJarPublishArtifact(getProject(), name, "sources", "jar", "jar",
sourcesJar);
archives.getArtifacts().add(sourcesArtifact);
archives.getArtifacts().add(javadocArtifact);
PublishArtifact testArtifact = Projects.createJarPublishArtifact(getProject(), testName, null, "jar", "jar",
testJar);
testArchives.getArtifacts().add(testArtifact);
testRuntime.getArtifacts().add(testArtifact);
代码示例来源:origin: me.seeber.gradle/gradle-project-config
PublishArtifact sourcesArtifact = Projects.createJarPublishArtifact(getProject(), name, "sources", "jar", "jar",
sourcesJar);
archives.getArtifacts().add(sourcesArtifact);
archives.getArtifacts().add(javadocArtifact);
PublishArtifact testArtifact = Projects.createJarPublishArtifact(getProject(), testName, null, "jar", "jar",
testJar);
testArchives.getArtifacts().add(testArtifact);
testRuntime.getArtifacts().add(testArtifact);
内容来源于网络,如有侵权,请联系作者删除!