-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #567 from kotlin-orm/dev
Release 4.1.0
- Loading branch information
Showing
36 changed files
with
843 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
|
||
plugins { | ||
id("kotlin") | ||
id("org.moditect.gradleplugin") | ||
} | ||
|
||
moditect { | ||
// Generate a multi-release jar, the module descriptor will be located at META-INF/versions/9/module-info.class | ||
addMainModuleInfo { | ||
jvmVersion.set("9") | ||
overwriteExistingFiles.set(true) | ||
module { | ||
moduleInfoFile = file("src/main/moditect/module-info.java") | ||
val moditect by tasks.registering { | ||
doLast { | ||
// Generate a multi-release modulized jar, module descriptor position: META-INF/versions/9/module-info.class | ||
val inputJar = tasks.jar.flatMap { it.archiveFile }.map { it.asFile.toPath() }.get() | ||
val outputDir = file("build/moditect").apply { mkdirs() }.toPath() | ||
val moduleInfo = file("src/main/moditect/module-info.java").readText() | ||
val version = project.version.toString() | ||
org.moditect.commands.AddModuleInfo(moduleInfo, null, version, inputJar, outputDir, "9", true).run() | ||
|
||
// Replace the original jar with the modulized jar. | ||
copy { | ||
from(outputDir.resolve(inputJar.fileName)) | ||
into(inputJar.parent) | ||
} | ||
} | ||
} | ||
|
||
// Let kotlin compiler know the module descriptor. | ||
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) { | ||
sourceSets.main { | ||
kotlin.srcDir("src/main/moditect") | ||
} | ||
tasks { | ||
moditect { | ||
dependsOn(jar) | ||
} | ||
jar { | ||
finalizedBy(moditect) | ||
} | ||
} | ||
|
||
// Workaround to avoid circular task dependencies, see https://github.com/moditect/moditect-gradle-plugin/issues/14 | ||
afterEvaluate { | ||
val compileJava = tasks.compileJava.get() | ||
val addDependenciesModuleInfo = tasks.addDependenciesModuleInfo.get() | ||
compileJava.setDependsOn(compileJava.dependsOn - addDependenciesModuleInfo) | ||
if (JavaVersion.current() >= JavaVersion.VERSION_1_9) { | ||
// Let kotlin compiler know the module descriptor. | ||
sourceSets.main { | ||
kotlin.srcDir("src/main/moditect") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,6 +155,11 @@ publishing { | |
id.set("brohacz") | ||
name.set("Michal Brosig") | ||
} | ||
developer { | ||
id.set("hc224") | ||
name.set("hc224") | ||
email.set("[email protected]") | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-8.3-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.