Skip to content

Commit

Permalink
build with Gradle 7.6; drop compatibility with versions older than 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siordache committed Dec 25, 2022
1 parent b55c990 commit 3b04fc7
Show file tree
Hide file tree
Showing 17 changed files with 239 additions and 248 deletions.
151 changes: 83 additions & 68 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ buildscript {

plugins {
id 'java-gradle-plugin'
id 'com.github.johnrengelman.plugin-shadow' version '2.0.3'
id 'groovy'
id 'maven-publish'
id "com.gradle.plugin-publish" version "0.11.0"
id 'com.github.johnrengelman.shadow' version '7.1.2'
id "com.gradle.plugin-publish" version "1.1.0"
id "com.github.ethankhall.semantic-versioning" version "1.1.0"
id "com.github.ben-manes.versions" version "0.13.0"
id 'com.github.jk1.dependency-license-report' version '0.3.8'
id "com.github.hierynomus.license" version "0.14.0"
id "org.asciidoctor.convert" version "2.3.0"
id "org.ajoberstar.git-publish" version "2.1.1"
id "com.github.ben-manes.versions" version "0.44.0"
id 'com.github.jk1.dependency-license-report' version '2.1'
id "com.github.hierynomus.license" version "0.16.1"
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id "org.ajoberstar.git-publish" version "4.1.1"
}

if(JavaVersion.current() != JavaVersion.VERSION_11) {
throw new GradleException("Please use Java 11 to execute this Gradle build")
}

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

ext.asmVersion = '9.1'
ext.asmVersion = '9.4'

repositories {
mavenCentral()
Expand All @@ -69,76 +73,90 @@ license {
}

configurations {
compile {transitive = true}
/*
plugin.description = 'Plugin\'s dependencies'
implementation.extendsFrom plugin

[apiElements, runtimeElements].each {
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
it.outgoing.artifact(shadowJar)
}
*/
}

configurations {
asciidoctorExt
}

dependencies {
shadow gradleTestKit()
shadow localGroovy()

compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.32'

compile "org.ow2.asm:asm:$asmVersion"
compile "org.ow2.asm:asm-commons:$asmVersion"
compile "org.ow2.asm:asm-tree:$asmVersion"
compile "org.ow2.asm:asm-util:$asmVersion"
compile "org.ow2.asm:asm-analysis:$asmVersion"
implementation "org.ow2.asm:asm:$asmVersion"
implementation "org.ow2.asm:asm-commons:$asmVersion"
implementation "org.ow2.asm:asm-tree:$asmVersion"
implementation "org.ow2.asm:asm-util:$asmVersion"
implementation "org.ow2.asm:asm-analysis:$asmVersion"

testCompile('org.spockframework:spock-core:1.1-groovy-2.4') {
testImplementation('org.spockframework:spock-core:2.3-groovy-3.0') {
exclude module: 'groovy-all'
}
testCompile 'cglib:cglib-nodep:3.2.4'
testCompile 'org.objenesis:objenesis:2.4'
testCompile('com.athaydes:spock-reports:1.2.13') { transitive = false}
testImplementation 'cglib:cglib-nodep:3.3.0'
testImplementation 'org.objenesis:objenesis:3.2'
testImplementation ('com.athaydes:spock-reports:2.3.1-groovy-3.0') { transitive = false}

asciidoctor 'com.bmuschko:asciidoctorj-tabbed-code-extension:0.2'
asciidoctorExt 'com.bmuschko:asciidoctorj-tabbed-code-extension:0.3'
}

gradlePlugin {
plugins {
runtime {
id = 'org.beryx.runtime'
implementationClass = 'org.beryx.runtime.RuntimePlugin'
}
}
}

pluginBundle {
website = 'https://github.com/beryx/badass-runtime-plugin/'
vcsUrl = 'https://github.com/beryx/badass-runtime-plugin'
description = 'A Gradle plugin that assembles your modules into a custom runtime image'
tags = ['runtime', 'jlink', 'jpms', 'image']

plugins {
runtime {
jlink {
id = 'org.beryx.runtime'
implementationClass = 'org.beryx.runtime.RuntimePlugin'
displayName = 'Badass Runtime Plugin'
description = 'A Gradle plugin that assembles your modules into a custom runtime image'
tags.set(['runtime', 'jlink', 'jpms', 'image'])
}
}
}

shadowJar {
configurations = [project.configurations.plugin]
archiveClassifier = null
dependencies {
include(dependency("org.ow2.asm:asm:$asmVersion"))
include(dependency("org.ow2.asm:asm-commons:$asmVersion"))
include(dependency("org.ow2.asm:asm-tree:$asmVersion"))
include(dependency("org.ow2.asm:asm-util:$asmVersion"))
include(dependency("org.ow2.asm:asm-anaysis:$asmVersion"))
}
relocate 'org.objectweb.asm', 'org.beryx.jlink.shadow.asm'
}

jar {
enabled = false
dependsOn shadowJar

manifest {
attributes 'Implementation-Title': "${project.archivesBaseName}",
'Implementation-Version': badassRuntimePluginVersion
}
}

test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
}
}

asciidoctor {
sourceDir = file("doc")
configurations 'asciidoctorExt'
setSourceDir file("doc")
baseDirFollowsSourceDir()
sources {include 'index.adoc'}
logDocuments = true
attributes 'source-highlighter': 'coderay',
Expand All @@ -157,40 +175,37 @@ gitPublish {
repoUri = 'https://github.com/beryx/badass-runtime-plugin.git'
branch = 'gh-pages'

contents {
def pgType = project.hasProperty('ghPageType') ? ghPageType : 'latest'
if(pgType == 'init') {
from file("ghpages")
} else if(pgType == 'list') {
from file("build/release-list")
} else {
from file("${asciidoctor.outputDir.path}/html5")
from file("build/docs")
def pgType = project.hasProperty('ghPageType') ? ghPageType : 'latest'
if(pgType == 'init') {
contents .from file("ghpages")
} else if(pgType == 'list') {
contents.from file("build/release-list")
} else {
contents.from file(asciidoctor.outputDir.path)
contents.from file("build/docs")
}

def docDir = Boolean.valueOf(badassRuntimePluginReleaseBuild) ? 'releases' : 'snapshots'
if(pgType == 'init') {
contents.into "."
} else if(pgType == 'list') {
contents.into "."
preserve {
include '**'
exclude "releases.md"
}
} else if(pgType == 'version') {
gitPublishPush.enabled = (docDir != 'snapshots')
contents.into "$docDir/$badassRuntimePluginVersion"
preserve {
include '**'
exclude "$docDir/$badassRuntimePluginVersion"
}
def docDir = Boolean.valueOf(badassRuntimePluginReleaseBuild) ? 'releases' : 'snapshots'
if(pgType == 'init') {
into "."
} else if(pgType == 'list') {
into "."
preserve {
include '**'
exclude "releases.md"
}
} else if(pgType == 'version') {
gitPublishPush.enabled = (docDir != 'snapshots')
into "$docDir/$badassRuntimePluginVersion"

preserve {
include '**'
exclude "$docDir/$badassRuntimePluginVersion"
}
} else {
into "$docDir/latest"

preserve {
include '**'
exclude "$docDir/latest"
}
} else {
contents.into "$docDir/latest"
preserve {
include '**'
exclude "$docDir/latest"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion doc/introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ and a `runtimeZip` task that additionally creates a zip archive of the custom ru
In addition, a `suggestModules` task helps you choose the modules to include in your custom JRE.
With the `jpackage` task you can create a platform-specific installer for your application.

WARNING: The plugin requires Java 11 and Gradle 4.8 or newer.
WARNING: The plugin requires Java 11 and Gradle 7.0 or newer.
While it might work with some combinations of older Java and Gradle versions, these are not officially supported.
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.

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

Expand Down
2 changes: 1 addition & 1 deletion doc/user_guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ mainJar:: the argument passed to the `--main-jar` option when running `jpackage`

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


Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Apr 25 12:16:33 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
Loading

0 comments on commit 3b04fc7

Please sign in to comment.