Commit 41996c9b authored by Christian Meyer's avatar Christian Meyer
Browse files

ZmtJavaPlugin, ZmtPublishPlugin.groovy: tests and sources are published

parent 043c1672
......@@ -21,12 +21,6 @@ class ZmtJavaPlugin implements Plugin<Project> {
testCompile 'org.mockito:mockito-core:2.+'
}
task('testsJar', type: Jar) {
group = 'Build'
description = 'Assembles a jar archive containing the test classes'
classifier 'tests'
from sourceSets.test.output
}
task('listJar') {
group = 'Help'
......@@ -36,6 +30,13 @@ class ZmtJavaPlugin implements Plugin<Project> {
configurations.compile.each { File file -> println file.name }
}
}
task('testJar', type: Jar) {
group = 'Build'
description = 'Assembles a jar archive containing the test classes'
classifier 'tests'
from sourceSets.test.output
}
task('sourceJar', type: Jar) {
group = 'Build'
......@@ -43,6 +44,13 @@ class ZmtJavaPlugin implements Plugin<Project> {
classifier = 'sources'
from sourceSets.main.allSource
}
task('testSourceJar', type: Jar) {
group = 'Build'
description = 'Assembles a jar archive containing test sources.'
classifier = 'test-sources'
from sourceSets.test.allSource
}
task('javadocJar', type: Jar, dependsOn: 'javadoc') {
group = 'Build'
......@@ -50,14 +58,15 @@ class ZmtJavaPlugin implements Plugin<Project> {
classifier = 'javadoc'
from javadoc.destinationDir
}
// for creating a tests jar file
// for referring to the test jar file from other projects
configurations {
tests
tests.extendsFrom(testCompile)
}
// the output of the 'testJar' task is added to the configuration
artifacts {
tests testsJar
tests testJar
}
}
......
......@@ -28,6 +28,14 @@ class ZmtPublishPlugin implements Plugin<Project> {
classifier "javadoc"
}
artifact testJar {
classifier "tests"
}
artifact testSourceJar {
classifier "test-sources"
}
pom.withXml {
asNode().appendNode(
'description',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment