Skip to content

Commit 3b04fc7

Browse files
committed
build with Gradle 7.6; drop compatibility with versions older than 7.0
1 parent b55c990 commit 3b04fc7

File tree

17 files changed

+239
-248
lines changed

17 files changed

+239
-248
lines changed

build.gradle

Lines changed: 83 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ buildscript {
1515

1616
plugins {
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

3034
project.version.with {
@@ -42,7 +46,7 @@ ext.badassRuntimePluginTag = Boolean.valueOf(badassRuntimePluginReleaseBuild) ?
4246
group = 'org.beryx'
4347
version = badassRuntimePluginVersion
4448

45-
ext.asmVersion = '9.1'
49+
ext.asmVersion = '9.4'
4650

4751
repositories {
4852
mavenCentral()
@@ -69,76 +73,90 @@ license {
6973
}
7074

7175
configurations {
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

8189
dependencies {
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

103111
gradlePlugin {
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

127139
jar {
140+
enabled = false
141+
dependsOn shadowJar
142+
128143
manifest {
129144
attributes 'Implementation-Title': "${project.archivesBaseName}",
130145
'Implementation-Version': badassRuntimePluginVersion
131146
}
132147
}
133148

134149
test {
150+
useJUnitPlatform()
135151
testLogging {
136152
exceptionFormat = 'full'
137153
}
138154
}
139155

140156
asciidoctor {
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
}

doc/introduction.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ and a `runtimeZip` task that additionally creates a zip archive of the custom ru
2020
In addition, a `suggestModules` task helps you choose the modules to include in your custom JRE.
2121
With the `jpackage` task you can create a platform-specific installer for your application.
2222

23-
WARNING: The plugin requires Java 11 and Gradle 4.8 or newer.
23+
WARNING: The plugin requires Java 11 and Gradle 7.0 or newer.
2424
While it might work with some combinations of older Java and Gradle versions, these are not officially supported.
25+
If you are forced to work with an older Gradle release, you should use https://badass-runtime-plugin.beryx.org/releases/1.12.7/[the version 1.12.7] of this plugin.
2526

2627
To use the plugin, include the following in your build script:
2728

doc/user_guide.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ mainJar:: the argument passed to the `--main-jar` option when running `jpackage`
383383

384384
mainClass:: the argument passed to the `--main-class` option when running `jpackage` to create an application image. +
385385
Usually, you don't need to set this property, unless you also explicitly set `distDir`. +
386-
_defaultValue_: the `mainClassName` configured for the `application` plugin +
386+
_defaultValue_: the `mainClass` configured for the `application` plugin +
387387
_usage example_: `mainClass = "org.example.hello.Greeter"`
388388

389389

gradle/wrapper/gradle-wrapper.jar

5.43 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Apr 25 12:16:33 CEST 2016
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip

0 commit comments

Comments
 (0)