Update fabcar java sample build (#219)

- Update gradle version
- Switch to application plugin
  (cc is started as an app not a lib, and java-library-distribution
  is still incubating)
- make sure tests and coverage checks are run before installDist

Signed-off-by: James Taylor <jamest@uk.ibm.com>
This commit is contained in:
James Taylor 2020-07-01 17:12:11 +01:00 committed by GitHub
parent c0570df2f8
commit 7154ed8629
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View file

@ -3,8 +3,8 @@
*/
plugins {
id 'application'
id 'checkstyle'
id 'java-library-distribution'
id 'jacoco'
}
@ -30,6 +30,10 @@ repositories {
}
}
application {
mainClass = 'org.hyperledger.fabric.contract.ContractRouter'
}
checkstyle {
toolVersion '8.21'
configFile file("config/checkstyle/checkstyle.xml")
@ -43,14 +47,11 @@ checkstyleTest {
source ='src/test/java'
}
jacocoTestReport {
dependsOn test
}
jacocoTestCoverageVerification {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'org/hyperledger/fabric/samples/fabcar/Start.*'
])
})
}
violationRules {
rule {
limit {
@ -70,3 +71,4 @@ test {
}
check.dependsOn jacocoTestCoverageVerification
installDist.dependsOn check

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists