@@ -6,41 +6,31 @@ apply plugin: "com.github.maiflai.scalatest"
66apply plugin : ' signing'
77apply plugin : ' maven'
88apply plugin : ' org.scoverage'
9- apply plugin : ' net.researchgate.release'
109apply plugin : ' io.codearte.nexus-staging'
1110apply plugin : ' org.owasp.dependencycheck'
12- apply plugin : " com.adtran.scala-multiversion-plugin"
1311apply plugin : ' com.github.ben-manes.versions'
1412
1513repositories {
1614 mavenCentral()
1715}
1816
19- ext {
20- reactorVersion = " 3.1.3.RELEASE"
21- scoverageVersion = " 1.3.0"
22- mockitoVersion = " 2.13.0"
23- }
24-
2517dependencies {
26- // scala dependencies
27- compile " org.scala-lang:scala-library:%scala-version%"
28- // reactor dependencies
29- compile group : ' io.projectreactor' , name : ' reactor-core' , version : " $reactorVersion "
30- // jsr305
31- compile group : ' com.google.code.findbugs' , name : ' jsr305' , version : ' 3.0.2'
18+ compile libraries. scalaLibrary
19+ compile libraries. reactorCore
20+ compile libraries. findbugs
3221
3322// test dependencies
34- testCompile " org .scalatest:scalatest_%%:3.0.3 "
35- testRuntime " org .pegdown:pegdown:1.6.0 "
36- testCompile group : ' io.projectreactor ' , name : ' reactor-test ' , version : " $r eactorVersion "
37- testCompile " org.mockito:mockito-inline: $m ockitoVersion "
38- testCompile " com.typesafe.scala-logging:scala-logging_%%:3.7.2 "
23+ testCompile libraries . scalatest
24+ testRuntime libraries . pegdown
25+ testCompile libraries . reactorTest
26+ testCompile libraries . mockitoInline
27+ testCompile libraries . scalaLogging
3928
40- scoverage " org.scoverage:scalac-scoverage-plugin_%%: $s coverageVersion " , " org.scoverage:scalac-scoverage-runtime_%%: $s coverageVersion "
29+ scoverage libraries . scoveragePlugin, libraries . scoverageRuntime
4130}
4231
4332buildscript {
33+ apply from : file(' versions.gradle' )
4434 repositories {
4535 maven {
4636 url " https://plugins.gradle.org/m2/"
@@ -61,7 +51,45 @@ buildscript {
6151}
6252
6353dependencyCheck {
64- skipConfigurations= [" apiElements" , " implementation" , " runtimeElements" , " runtimeOnly" , " testImplementation" , " testRuntimeOnly" , " scoverageImplementation" , " scoverageRuntimeOnly" ]
54+ skipConfigurations = [" apiElements" , " implementation" , " runtimeElements" , " runtimeOnly" , " testImplementation" , " testRuntimeOnly" , " scoverageImplementation" , " scoverageRuntimeOnly" ]
55+ }
56+
57+ if (! project. parent) {
58+ apply plugin : ' net.researchgate.release'
59+ final svs = [' 2.12.4' , ' 2.11.8' ]
60+
61+ for (sv in svs) {
62+ String scalaVersionInDot = sv. replaceAll(" _" , " ." )
63+
64+ tasks. create(name : " build_$sv " , type : GradleBuild ) {
65+ buildFile = ' ./build.gradle'
66+ tasks = [' build' ]
67+ startParameter. projectProperties = [scalaVersion : " ${ scalaVersionInDot} " ]
68+ }
69+
70+ tasks. create(name : " uploadArchives_${ sv} " , type : GradleBuild ) {
71+ buildFile = ' ./build.gradle'
72+ tasks = [' uploadArchives' ]
73+ startParameter. projectProperties = [scalaVersion : " ${ scalaVersionInDot} " ]
74+ }
75+ }
76+
77+ tasks. create(name : " buildAll" , dependsOn : svs. collect{" build_${ it} " }) {}
78+
79+ tasks. create(name : " uploadArchivesAll" , dependsOn : svs. collect{" uploadArchives_${ it} " }) {}
80+
81+ project. task(" releaseAll" , description : ' Verify project, release and update version to next.' , group : " Release" , type : GradleBuild ) {
82+ startParameter = project. getGradle(). startParameter. newInstance()
83+ tasks = [
84+ ' createScmAdapter' , ' checkCommitNeeded' , ' checkUpdateNeeded' , ' unSnapshotVersion' ,
85+ ' confirmReleaseVersion' , ' checkSnapshotDependencies' , ' buildAll' ,
86+ ' preTagCommit' , ' createReleaseTag' , ' updateVersion' , ' commitNewVersion'
87+ ]
88+ }
89+
90+ project. createReleaseTag. dependsOn {
91+ project. uploadArchivesAll
92+ }
6593}
6694
6795ext. isReleaseVersion = ! version. endsWith(" SNAPSHOT" )
@@ -140,7 +168,7 @@ ScalaCompileOptions.metaClass.fork = true
140168ScalaCompileOptions . metaClass. useAnt = false
141169ScalaCompileOptions . metaClass. useCompileDaemon = false
142170
143- project. tasks. scaladoc. scalaDocOptions. additionalParameters= [" -no-link-warnings" ]
171+ project. tasks. scaladoc. scalaDocOptions. additionalParameters = [" -no-link-warnings" ]
144172
145173release {
146174 git {
0 commit comments