Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions cadc-quality/opencadc-1.0.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
configurations {
checkstyleDep
intTestImplementation.extendsFrom testImplementation

runtimeOnly.exclude module: 'slf4j-reload4j'
runtimeOnly.exclude module: 'reload4j'
}

dependencies {
testImplementation 'com.puppycrawl.tools:checkstyle:8.2'
checkstyleDep 'org.opencadc:cadc-quality:[1.0,1.1)'
}

checkstyle {
ignoreFailures = false
config = resources.text.fromArchiveEntry(configurations.checkstyleDep, 'cadc_checkstyle.xml')
toolVersion = '8.2'
sourceSets = []
}

sourceSets {
intTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += compileClasspath
}
resources.srcDirs += file('src/intTest/resources')
resources.srcDirs += new File(System.getenv('A') + '/test-certificates/')
}
}

// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->
tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.outputLocation.get().asFile
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
}
}
}

tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
//reports.html.destination = file("${reporting.baseDir}/${name}")
reports.html.destination = file(reporting.baseDir.getAbsolutePath() + '/' + name)

// Assign all Java system properties from
// the command line to the tests
systemProperties System.properties
}

task intTest(type: Test) {
// set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

// run the tests always
outputs.upToDateWhen { false }
}

test {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}

intTest {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}

pluginManager.withPlugin('maven-publish') {
// configure maven-publish to support publishToMavenLocal
publishing {
publications {
thisLibrary(MavenPublication) {
from components.java
}
}
}
}

// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
}
92 changes: 92 additions & 0 deletions cadc-quality/opencadc-1.1.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
configurations {
checkstyleDep
intTestImplementation.extendsFrom testImplementation

runtimeOnly.exclude module: 'slf4j-reload4j'
runtimeOnly.exclude module: 'reload4j'
}

dependencies {
testImplementation 'com.puppycrawl.tools:checkstyle:10.12.5'
checkstyleDep 'org.opencadc:cadc-quality:[1.1,1.2)'
}

checkstyle {
ignoreFailures = false
config = resources.text.fromArchiveEntry(configurations.checkstyleDep, 'cadc_checkstyle.xml')
toolVersion = '10.12.5'
sourceSets = []
}

sourceSets {
intTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += compileClasspath
}
resources.srcDirs += file('src/intTest/resources')
resources.srcDirs += new File(System.getenv('A') + '/test-certificates/')
}
}

// Temporary work around for issue https://github.com/gradle/gradle/issues/881 -
// gradle not displaying fail build status when warnings reported -->
tasks.withType(Checkstyle).each { checkstyleTask ->
checkstyleTask.doLast {
reports.all { report ->
def outputFile = report.outputLocation.get().asFile
if (outputFile.exists() && outputFile.text.contains("<error ")) {
throw new GradleException("There were checkstyle warnings! For more info check $outputFile")
}
}
}
}

tasks.withType(Test) {
// reset the report destinations so that intTests go to their own page
//reports.html.destination = file("${reporting.baseDir}/${name}")
reports.html.destination = file(reporting.baseDir.getAbsolutePath() + '/' + name)

// Assign all Java system properties from
// the command line to the tests
systemProperties System.properties
}

task intTest(type: Test) {
// set the configuration context
testClassesDirs = sourceSets.intTest.output.classesDirs
classpath = sourceSets.intTest.runtimeClasspath

// run the tests always
outputs.upToDateWhen { false }
}

test {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}

intTest {
testLogging {
events "PASSED", "FAILED", "SKIPPED"
// "STARTED",
}
}

pluginManager.withPlugin('maven-publish') {
// configure maven-publish to support publishToMavenLocal
publishing {
publications {
thisLibrary(MavenPublication) {
from components.java
}
}
}
}

// backwards compat usage
task install {
dependsOn 'publishToMavenLocal'
}
Loading