@@ -15,16 +15,20 @@ buildscript {
1515
1616plugins {
1717 id ' java-gradle-plugin'
18- id ' com.github.johnrengelman.plugin-shadow' version ' 2.0.3'
1918 id ' groovy'
2019 id ' maven-publish'
21- id " com.gradle.plugin-publish" version " 0.11.0"
20+ id ' com.github.johnrengelman.shadow' version ' 7.1.2'
21+ id " com.gradle.plugin-publish" version " 1.1.0"
2222 id " com.github.ethankhall.semantic-versioning" version " 1.1.0"
23- id " com.github.ben-manes.versions" version " 0.13.0"
24- id ' com.github.jk1.dependency-license-report' version ' 0.3.8'
25- id " com.github.hierynomus.license" version " 0.14.0"
26- id " org.asciidoctor.convert" version " 2.3.0"
27- id " org.ajoberstar.git-publish" version " 2.1.1"
23+ id " com.github.ben-manes.versions" version " 0.44.0"
24+ id ' com.github.jk1.dependency-license-report' version ' 2.1'
25+ id " com.github.hierynomus.license" version " 0.16.1"
26+ id ' org.asciidoctor.jvm.convert' version ' 3.3.2'
27+ id " org.ajoberstar.git-publish" version " 4.1.1"
28+ }
29+
30+ if (JavaVersion . current() != JavaVersion . VERSION_11 ) {
31+ throw new GradleException (" Please use Java 11 to execute this Gradle build" )
2832}
2933
3034project. version. with {
@@ -42,7 +46,7 @@ ext.badassRuntimePluginTag = Boolean.valueOf(badassRuntimePluginReleaseBuild) ?
4246group = ' org.beryx'
4347version = badassRuntimePluginVersion
4448
45- ext. asmVersion = ' 9.1 '
49+ ext. asmVersion = ' 9.4 '
4650
4751repositories {
4852 mavenCentral()
@@ -69,76 +73,90 @@ license {
6973}
7074
7175configurations {
72- compile {transitive = true }
73- /*
76+ plugin. description = ' Plugin\' s dependencies'
77+ implementation. extendsFrom plugin
78+
7479 [apiElements, runtimeElements]. each {
7580 it. outgoing. artifacts. removeIf { it. buildDependencies. getDependencies(null ). contains(jar) }
7681 it. outgoing. artifact(shadowJar)
7782 }
78- */
83+ }
84+
85+ configurations {
86+ asciidoctorExt
7987}
8088
8189dependencies {
8290 shadow gradleTestKit()
8391 shadow localGroovy()
8492
85- compile group : ' org.slf4j' , name : ' slf4j-api' , version : ' 1.7.25 '
93+ implementation group : ' org.slf4j' , name : ' slf4j-api' , version : ' 1.7.32 '
8694
87- compile " org.ow2.asm:asm:$asmVersion "
88- compile " org.ow2.asm:asm-commons:$asmVersion "
89- compile " org.ow2.asm:asm-tree:$asmVersion "
90- compile " org.ow2.asm:asm-util:$asmVersion "
91- compile " org.ow2.asm:asm-analysis:$asmVersion "
95+ implementation " org.ow2.asm:asm:$asmVersion "
96+ implementation " org.ow2.asm:asm-commons:$asmVersion "
97+ implementation " org.ow2.asm:asm-tree:$asmVersion "
98+ implementation " org.ow2.asm:asm-util:$asmVersion "
99+ implementation " org.ow2.asm:asm-analysis:$asmVersion "
92100
93- testCompile (' org.spockframework:spock-core:1.1 -groovy-2.4 ' ) {
101+ testImplementation (' org.spockframework:spock-core:2.3 -groovy-3.0 ' ) {
94102 exclude module : ' groovy-all'
95103 }
96- testCompile ' cglib:cglib-nodep:3.2.4 '
97- testCompile ' org.objenesis:objenesis:2.4 '
98- testCompile (' com.athaydes:spock-reports:1.2.13 ' ) { transitive = false }
104+ testImplementation ' cglib:cglib-nodep:3.3.0 '
105+ testImplementation ' org.objenesis:objenesis:3.2 '
106+ testImplementation (' com.athaydes:spock-reports:2.3.1-groovy-3.0 ' ) { transitive = false }
99107
100- asciidoctor ' com.bmuschko:asciidoctorj-tabbed-code-extension:0.2 '
108+ asciidoctorExt ' com.bmuschko:asciidoctorj-tabbed-code-extension:0.3 '
101109}
102110
103111gradlePlugin {
104- plugins {
105- runtime {
106- id = ' org.beryx.runtime'
107- implementationClass = ' org.beryx.runtime.RuntimePlugin'
108- }
109- }
110- }
111-
112- pluginBundle {
113112 website = ' https://github.com/beryx/badass-runtime-plugin/'
114113 vcsUrl = ' https://github.com/beryx/badass-runtime-plugin'
115- description = ' A Gradle plugin that assembles your modules into a custom runtime image'
116- tags = [' runtime' , ' jlink' , ' jpms' , ' image' ]
117114
118115 plugins {
119- runtime {
116+ jlink {
120117 id = ' org.beryx.runtime'
118+ implementationClass = ' org.beryx.runtime.RuntimePlugin'
121119 displayName = ' Badass Runtime Plugin'
120+ description = ' A Gradle plugin that assembles your modules into a custom runtime image'
121+ tags. set([' runtime' , ' jlink' , ' jpms' , ' image' ])
122122 }
123123 }
124124}
125125
126+ shadowJar {
127+ configurations = [project. configurations. plugin]
128+ archiveClassifier = null
129+ dependencies {
130+ include(dependency(" org.ow2.asm:asm:$asmVersion " ))
131+ include(dependency(" org.ow2.asm:asm-commons:$asmVersion " ))
132+ include(dependency(" org.ow2.asm:asm-tree:$asmVersion " ))
133+ include(dependency(" org.ow2.asm:asm-util:$asmVersion " ))
134+ include(dependency(" org.ow2.asm:asm-anaysis:$asmVersion " ))
135+ }
136+ relocate ' org.objectweb.asm' , ' org.beryx.jlink.shadow.asm'
137+ }
126138
127139jar {
140+ enabled = false
141+ dependsOn shadowJar
142+
128143 manifest {
129144 attributes ' Implementation-Title' : " ${ project.archivesBaseName} " ,
130145 ' Implementation-Version' : badassRuntimePluginVersion
131146 }
132147}
133148
134149test {
150+ useJUnitPlatform()
135151 testLogging {
136152 exceptionFormat = ' full'
137153 }
138154}
139155
140156asciidoctor {
141- sourceDir = file(" doc" )
157+ configurations ' asciidoctorExt'
158+ setSourceDir file(" doc" )
159+ baseDirFollowsSourceDir()
142160 sources {include ' index.adoc' }
143161 logDocuments = true
144162 attributes ' source-highlighter' : ' coderay' ,
@@ -157,40 +175,37 @@ gitPublish {
157175 repoUri = ' https://github.com/beryx/badass-runtime-plugin.git'
158176 branch = ' gh-pages'
159177
160- contents {
161- def pgType = project. hasProperty(' ghPageType' ) ? ghPageType : ' latest'
162- if (pgType == ' init' ) {
163- from file(" ghpages" )
164- } else if (pgType == ' list' ) {
165- from file(" build/release-list" )
166- } else {
167- from file(" ${ asciidoctor.outputDir.path} /html5" )
168- from file(" build/docs" )
178+ def pgType = project. hasProperty(' ghPageType' ) ? ghPageType : ' latest'
179+ if (pgType == ' init' ) {
180+ contents .from file(" ghpages" )
181+ } else if (pgType == ' list' ) {
182+ contents. from file(" build/release-list" )
183+ } else {
184+ contents. from file(asciidoctor. outputDir. path)
185+ contents. from file(" build/docs" )
186+ }
187+
188+ def docDir = Boolean . valueOf(badassRuntimePluginReleaseBuild) ? ' releases' : ' snapshots'
189+ if (pgType == ' init' ) {
190+ contents. into " ."
191+ } else if (pgType == ' list' ) {
192+ contents. into " ."
193+ preserve {
194+ include ' **'
195+ exclude " releases.md"
196+ }
197+ } else if (pgType == ' version' ) {
198+ gitPublishPush. enabled = (docDir != ' snapshots' )
199+ contents. into " $docDir /$badassRuntimePluginVersion "
200+ preserve {
201+ include ' **'
202+ exclude " $docDir /$badassRuntimePluginVersion "
169203 }
170- def docDir = Boolean . valueOf(badassRuntimePluginReleaseBuild) ? ' releases' : ' snapshots'
171- if (pgType == ' init' ) {
172- into " ."
173- } else if (pgType == ' list' ) {
174- into " ."
175- preserve {
176- include ' **'
177- exclude " releases.md"
178- }
179- } else if (pgType == ' version' ) {
180- gitPublishPush. enabled = (docDir != ' snapshots' )
181- into " $docDir /$badassRuntimePluginVersion "
182-
183- preserve {
184- include ' **'
185- exclude " $docDir /$badassRuntimePluginVersion "
186- }
187- } else {
188- into " $docDir /latest"
189-
190- preserve {
191- include ' **'
192- exclude " $docDir /latest"
193- }
204+ } else {
205+ contents. into " $docDir /latest"
206+ preserve {
207+ include ' **'
208+ exclude " $docDir /latest"
194209 }
195210 }
196211}
0 commit comments