Skip to content

Commit

Permalink
Make server lib Gradle 8 compatible (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeppeman committed Jul 31, 2023
1 parent c14ea3b commit ddc9f22
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions globallydynamic-server-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.10.1"
classpath "com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.3"
classpath "com.github.ben-manes:gradle-versions-plugin:$versions.versionsplugin"
classpath "com.github.jengelman.gradle.plugins:shadow:$versions.shadowjar"
classpath "com.github.johnrengelman:shadow:$versions.shadowjar"
}
}

Expand Down Expand Up @@ -45,7 +45,7 @@ subprojects {
mavenCentral()
}

if (project.hasProperty('java')) {
if (project.hasProperty('kotlin')) {
sourceCompatibility = rootProject.ext.sourceCompatibilityVersion
targetCompatibility = rootProject.ext.targetCompatibilityVersion

Expand Down
2 changes: 1 addition & 1 deletion globallydynamic-server-lib/deps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def versions = [
kotlin : '1.8.21',
jetty : '9.4.27.v20200227',
versionsplugin: '0.25.0',
shadowjar : '4.0.4',
shadowjar : '8.1.1',
guava : '30.1-jre',
bundletool : '1.11.2',
gson : '2.8.6',
Expand Down
4 changes: 2 additions & 2 deletions globallydynamic-server-lib/gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def getRepositoryPassword() {

afterEvaluate { project ->
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 13 additions & 3 deletions globallydynamic-server-lib/server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,27 @@ task executableJar(type: ShadowJar) {
if (project.hasProperty("archiveName")) {
archiveName = "${project.property("archiveName")}"
} else {
baseName = 'globallydynamic-server'
classifier = 'standalone'
archiveBaseName = 'globallydynamic-server'
archiveClassifier = 'standalone'
}
if (project.hasProperty("outputDir")) {
destinationDir = file(project.property("outputDir"))
destinationDirectory = file(project.property("outputDir"))
}
from sourceSets.main.output
configurations = [project.configurations.runtimeClasspath]
manifest {
attributes 'Main-Class': 'com.jeppeman.globallydynamic.server.GloballyDynamicMainKt'
}

/*
If one dependency jar is signed when making a fat jar,
all unsigned classes will be ignored by the Java runtime.
This causes the "Could not find or load main class"-error;
hence we exclude all signatures from the fat jar
*/
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
}

task runExecutableJar(type: JavaExec) {
Expand Down

0 comments on commit ddc9f22

Please sign in to comment.