Skip to content

Commit

Permalink
Moved gui tests from spotbugs project to spotbugs-tests project
Browse files Browse the repository at this point in the history
Second part needed to fully fix #1914
THis project does not have tests anymore, so jacoco is not needed.
  • Loading branch information
iloveeclipse committed Jan 9, 2022
1 parent 4071903 commit cd4ebec
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 22 deletions.
9 changes: 9 additions & 0 deletions spotbugs-tests/build.gradle
Expand Up @@ -20,19 +20,27 @@ dependencies {
implementation 'org.apache.ant:ant:1.10.12'
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:$log4jVersion"
implementation 'com.google.errorprone:error_prone_annotations:2.10.0'
implementation files(project(":spotbugs").sourceSets.gui.output)
}

java {
withSourcesJar()
}


tasks.named('compileJava', JavaCompile).configure {
options.release = 11
}

artifacts {
archives sourcesJar
}

tasks.named('jacocoTestReport', JacocoReport).configure {
dependsOn('unstableTest')
additionalSourceDirs.setFrom files(project(':spotbugs').sourceSets.main.java.srcDirs)
additionalClassDirs.setFrom files(project(':spotbugs').sourceSets.main.output.classesDirs)
executionData.setFrom files("$buildDir/jacoco/unstableTest.exec", "$buildDir/jacoco/test.exec")
}

// Tests below fail if executed with other tests
Expand All @@ -55,6 +63,7 @@ test {
}
}


spotbugs {
ignoreFailures = true
}
21 changes: 0 additions & 21 deletions spotbugs/build.gradle
@@ -1,4 +1,3 @@
apply from: "$rootDir/gradle/jacoco.gradle"
apply from: "$rootDir/gradle/maven.gradle"
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/javadoc.gradle"
Expand Down Expand Up @@ -50,11 +49,6 @@ sourceSets {
include '**/*.png'
}
}
guiTest {
java {
srcDirs = ['src/gui/test/java']
}
}
}

dependencies {
Expand Down Expand Up @@ -94,9 +88,6 @@ dependencies {
guiImplementation sourceSets.main.runtimeClasspath
guiCompileOnly 'com.apple:AppleJavaExtensions:1.4'
guiCompileOnly project(':spotbugs-annotations')
guiTestImplementation sourceSets.gui.runtimeClasspath
guiTestImplementation 'junit:junit:4.13.1'
guiTestCompileOnly project(':spotbugs-annotations')

// for Eclipse compilation only
appleExtensions 'com.apple:AppleJavaExtensions:1.4'
Expand Down Expand Up @@ -331,18 +322,6 @@ publishing.publications.maven {
ext.moduleName = 'com.github.spotbugs.spotbugs'
apply from: "$rootDir/gradle/jigsaw.gradle"

def guiTest = tasks.register('guiTest', Test) {
classpath = project.sourceSets.guiTest.runtimeClasspath
testClassesDirs = project.sourceSets.guiTest.output.classesDirs
}

tasks.named('jacocoTestReport', JacocoReport).configure {
dependsOn(guiTest)
executionData.setFrom files("$buildDir/jacoco/guiTest.exec")
sourceDirectories.setFrom files(sourceSets.main.java.srcDirs, sourceSets.gui.java.srcDirs)
classDirectories.setFrom files(sourceSets.main.output, sourceSets.gui.output)
}

tasks.named('spotbugsTest').configure {
ignoreFailures = true
}
Expand Down
1 change: 0 additions & 1 deletion spotbugs/build.properties
@@ -1,6 +1,5 @@
source.spotbugs.jar = src/main/java/,\
src/gui/main/,\
src/gui/test/java/,\
src/xsl/,\
etc
bin.includes = .libs/,\
Expand Down

0 comments on commit cd4ebec

Please sign in to comment.