本文整理汇总了Java中org.gradle.api.tasks.bundling.Jar.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Jar.setDescription方法的具体用法?Java Jar.setDescription怎么用?Java Jar.setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.gradle.api.tasks.bundling.Jar
的用法示例。
在下文中一共展示了Jar.setDescription方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureArchivesAndComponent
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
private void configureArchivesAndComponent(final Project project, final JavaPluginConvention pluginConvention) {
Jar jar = project.getTasks().create(JAR_TASK_NAME, Jar.class);
jar.getManifest().from(pluginConvention.getManifest());
jar.setDescription("Assembles a jar archive containing the main classes.");
jar.setGroup(BasePlugin.BUILD_GROUP);
jar.from(pluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput());
jar.getMetaInf().from(new Callable() {
public Object call() throws Exception {
return pluginConvention.getMetaInf();
}
});
ArchivePublishArtifact jarArtifact = new ArchivePublishArtifact(jar);
Configuration runtimeConfiguration = project.getConfigurations().getByName(RUNTIME_CONFIGURATION_NAME);
runtimeConfiguration.getArtifacts().add(jarArtifact);
project.getExtensions().getByType(DefaultArtifactPublicationSet.class).addCandidate(jarArtifact);
project.getComponents().add(new JavaLibrary(jarArtifact, runtimeConfiguration.getAllDependencies()));
}
示例2: configureArchivesAndComponent
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
private void configureArchivesAndComponent(final Project project, final JavaPluginConvention pluginConvention) {
Jar jar = project.getTasks().create(JAR_TASK_NAME, Jar.class);
jar.setDescription("Assembles a jar archive containing the main classes.");
jar.setGroup(BasePlugin.BUILD_GROUP);
jar.from(pluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput());
ArchivePublishArtifact jarArtifact = new ArchivePublishArtifact(jar);
Configuration runtimeConfiguration = project.getConfigurations().getByName(RUNTIME_CONFIGURATION_NAME);
runtimeConfiguration.getArtifacts().add(jarArtifact);
project.getExtensions().getByType(DefaultArtifactPublicationSet.class).addCandidate(jarArtifact);
project.getComponents().add(new JavaLibrary(jarArtifact, runtimeConfiguration.getAllDependencies()));
}
示例3: configureSourcesJarTask
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
/**
* Create task to create sources JAR
*
* @param sourcesJar Sources JAR task to configure
* @param source Source set to add to the JAR
*/
@Mutate
public void configureSourcesJarTask(@Path("tasks.sourcesJar") Jar sourcesJar, ProjectSourceSet source) {
sourcesJar.setDescription("Assembles a jar archive containing the sources.");
sourcesJar.setGroup("build");
sourcesJar.setClassifier("sources");
sourcesJar.from(source.withType(JavaSourceSet.class).stream().filter(s -> s.getParentName().equals("main"))
.findAny().get().getSource());
}
示例4: configureJavadocJarTask
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
/**
* Create a task to create a JavaDoc JAR
*
* @param javadocJar Task to configure
* @param javadoc JavaDoc task
*/
@Mutate
public void configureJavadocJarTask(@Path("tasks.javadocJar") Jar javadocJar,
@Path("tasks.javadoc") Javadoc javadoc) {
javadocJar.setDescription("Assembles a jar archive containing the JavaDoc documentation.");
javadocJar.setGroup("build");
javadocJar.setClassifier("javadoc");
javadocJar.from(javadoc);
javadocJar.dependsOn(javadoc);
}
示例5: configureTestJarTask
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
/**
* Configure task to create a JAR with the test classes
*
* @param testJar Task to configure
* @param compileTestJava Java compile task for tests
* @param processTestResources Java resources task for tests
*/
@Mutate
public void configureTestJarTask(@Path("tasks.testJar") Jar testJar,
@Path("tasks.compileTestJava") Task compileTestJava,
@Path("tasks.processTestResources") Task processTestResources) {
testJar.setDescription("Assembles a jar archive containing the unit tests..");
testJar.setGroup("build");
testJar.from(compileTestJava, processTestResources);
testJar.dependsOn(compileTestJava, processTestResources);
}
示例6: configureGroovydocJarTask
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
/**
* Create task to create the GroovyDoc jar
*
* @param task Tasl to configure
* @param groovydocTask Groovydoc task
*/
@Mutate
public void configureGroovydocJarTask(@Path("tasks.groovydocJar") Jar task,
@Path("tasks.groovydoc") Groovydoc groovydocTask) {
task.setDescription("Assembles a jar archive containing the groovydoc documentation.");
task.setGroup("build");
task.setClassifier("groovydoc");
task.from(groovydocTask);
}
示例7: createJarTask
import org.gradle.api.tasks.bundling.Jar; //导入方法依赖的package包/类
private Task createJarTask(TaskContainer tasks, JarBinarySpecInternal binary) {
Jar jar = tasks.create(binary.getNamingScheme().getTaskName("create"), Jar.class);
jar.setDescription(String.format("Creates the binary file for %s.", binary.getNamingScheme().getDescription()));
jar.from(binary.getClassesDir());
jar.from(binary.getResourcesDir());
jar.setDestinationDir(binary.getJarFile().getParentFile());
jar.setArchiveName(binary.getJarFile().getName());
return jar;
}