Skip to content

Commit

Permalink
create sub project for test-harness (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
KengoTODA authored and jsotuyod committed Jan 23, 2017
1 parent c950e56 commit 7b693a2
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 52 deletions.
52 changes: 2 additions & 50 deletions findbugs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ configurations {
dependencies {
compile 'org.ow2.asm:asm-debug-all:6.0_ALPHA'
compile 'net.jcip:jcip-annotations:1.0'
testCompile project(':test-harness')

// TODO : Some of these can be extracted to actual dependencies
compile fileTree(dir: 'lib', include: '*.jar')
Expand Down Expand Up @@ -113,7 +114,7 @@ task annotationsJar(type:Jar) {
}
}

tasks['jar'].dependsOn 'spotbugsAnnotationsJar', 'annotationsJar', 'testHarnessJar'
tasks['jar'].dependsOn 'spotbugsAnnotationsJar', 'annotationsJar'

// Populate bin folder with scripts
task scripts(type:Copy) {
Expand Down Expand Up @@ -189,48 +190,12 @@ task annotationSourcesJar(type: Jar, dependsOn: classes) {
include '**/annotations/*'
}

def harnessIncludes = ['edu/umd/cs/findbugs/AbstractIntegrationTest',
'org/sonar/plugins/findbugs/resource/SmapParser',
'edu/umd/cs/findbugs/test/**/*']

task testHarnessJar(type: Jar, dependsOn: testClasses) {
baseName 'test-harness'
from sourceSets.test.output
include harnessIncludes.collect { it + '.class' }
}

task testHarnessJavadoc(type: Javadoc) {
source sourceSets.test.allSource
classpath = sourceSets.test.compileClasspath
include harnessIncludes.collect { it + '.java' }
destinationDir = file("${project.docsDir}/test-harness")
options.with {
tags = ['Test']
}
}

task testHarnessJavadocJar(type: Jar, dependsOn: testHarnessJavadoc) {
classifier = 'javadoc'
baseName 'test-harness'
from testHarnessJavadoc.destinationDir
}

task testHarnessSourcesJar(type: Jar, dependsOn: testClasses) {
classifier = 'sources'
baseName 'test-harness'
from sourceSets.test.allSource
include harnessIncludes.collect { it + '.java' }
}

artifacts {
archives javadocJar
archives annotationJavadocJar
archives sourcesJar
archives annotationSourcesJar
annotations annotationsJar
archives testHarnessJar
archives testHarnessJavadocJar
archives testHarnessSourcesJar
}

apply plugin: 'distribution'
Expand Down Expand Up @@ -334,19 +299,6 @@ publishing {
classifier 'javadoc'
}
}

testHarness(MavenPublication) {
artifactId 'test-harness'
artifact testHarnessJar

artifact testHarnessSourcesJar {
classifier 'sources'
}

artifact testHarnessJavadocJar {
classifier 'javadoc'
}
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def eclipseFile = "eclipsePlugin/local.properties"
if (new File(eclipseFile).exists()) {
include ':findbugsTestCases', ':findbugs', ':eclipsePlugin'
include ':findbugsTestCases', ':findbugs', ':eclipsePlugin', ':test-harness'
} else {
logger.lifecycle('Eclipse plugin configuration (' + eclipseFile + ') was not found. Skipping Eclipse plugin...')
include ':findbugsTestCases', ':findbugs'
include ':findbugsTestCases', ':findbugs', ':test-harness'
}
29 changes: 29 additions & 0 deletions test-harness/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/javadoc.gradle"
apply plugin: 'maven'
apply plugin: 'signing'

dependencies {
compile 'junit:junit:4.12'
compile project(':findbugs')
}

javadoc {
options.with {
tags = ['Test']
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives jar, javadocJar, sourcesJar
}

0 comments on commit 7b693a2

Please sign in to comment.