diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index bf12370..f9bfea5 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -1,6 +1,6 @@ final String publicRepo = 'https://github.com/kemitix/' final String mvn = "mvn --batch-mode --update-snapshots --errors" -final dependenciesSupportJDK = 9 +final dependenciesSupportJDK = 10 pipeline { agent any @@ -9,21 +9,27 @@ pipeline { steps { withMaven(maven: 'maven', jdk: 'JDK 1.8') { sh "${mvn} clean compile checkstyle:checkstyle pmd:pmd test" - // Code Coverage to Codacy - sh "${mvn} jacoco:report com.gavinmogan:codacy-maven-plugin:coverage " + - "-DcoverageReportFile=target/site/jacoco/jacoco.xml " + - "-DprojectToken=`$JENKINS_HOME/codacy/token` " + - "-DapiToken=`$JENKINS_HOME/codacy/apitoken` " + - "-Dcommit=`git rev-parse HEAD`" - // Code Coverage to Jenkins - jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' // PMD to Jenkins pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' + } + } + } + stage('Report Coverage') { + steps { + withMaven(maven: 'maven', jdk: 'JDK 1.8') { + // Code Coverage to Jenkins + jacoco exclusionPattern: '**/*{Test|IT|Main|Application|Immutable}.class' + } + } + } + stage('Report Checkstyle') { + steps { + withMaven(maven: 'maven', jdk: 'JDK 1.8') { // Checkstyle to Jenkins - step([$class : 'hudson.plugins.checkstyle.CheckStylePublisher', - pattern : '**/target/checkstyle-result.xml', - healthy : '20', - unHealthy: '100']) + step([$class: 'hudson.plugins.checkstyle.CheckStylePublisher', + pattern: '**/target/checkstyle-result.xml', + healthy:'20', + unHealthy:'100']) } } } diff --git a/pom.xml b/pom.xml index 6e470c3..8733b95 100644 --- a/pom.xml +++ b/pom.xml @@ -21,10 +21,10 @@ 5.0.2.201807311906-r 5.2.0 3.11.1 - DEV-SNAPSHOT + 0.11.0 2.21.0 0.9.0 - DEV-SNAPSHOT + 0.7.0 net.kemitix.gitdb diff --git a/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java b/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java index 36841d3..20e759e 100644 --- a/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java +++ b/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java @@ -85,7 +85,7 @@ class GitDBRepo { ) { final GitTreeReader treeFilter = new GitTreeReader(repository).treeFilter(key); return streamTree(branchRef, treeFilter).flatMap(s -> - Result.swap(s.findFirst() + Result.invert(s.findFirst() .map(NamedRevBlob::blobAsString) .map(Maybe::just) .orElseGet(Maybe::nothing))); diff --git a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java index fac9502..6ac5c17 100644 --- a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java +++ b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java @@ -114,7 +114,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB { public Result> branch(final String name) { return Result.flatMapMaybe( Result.of(() -> Maybe.maybe(repository.findRef(name))), - refMaybe -> Result.swap(refMaybe.map(branchInit))); + refMaybe -> Result.invert(refMaybe.map(branchInit))); } }