mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-25 00:52:31 -04:00
Replace moditect with extra-java-module-info
This commit is contained in:
@@ -18,7 +18,7 @@ There are no real formal contribution guidelines right now, they will maybe come
|
||||
|
||||
All XPipe components target [Java 21](https://openjdk.java.net/projects/jdk/20/) and make full use of the Java Module System (JPMS).
|
||||
All components are modularized, including all their dependencies.
|
||||
In case a dependency is (sadly) not modularized yet, module information is manually added using [moditect](https://github.com/moditect/moditect-gradle-plugin).
|
||||
In case a dependency is (sadly) not modularized yet, module information is manually added using [extra-java-module-info](https://github.com/gradlex-org/extra-java-module-info).
|
||||
Further, note that as this is a pretty complicated Java project that fully utilizes modularity,
|
||||
many IDEs still have problems building this project properly.
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
}
|
||||
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
id 'application'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -34,6 +33,19 @@ dependencies {
|
||||
compileOnly 'org.junit.jupiter:junit-jupiter-api:5.9.3'
|
||||
compileOnly 'org.junit.jupiter:junit-jupiter-params:5.9.3'
|
||||
|
||||
implementation 'io.github.g00fy2:versioncompare:1.5.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-data:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-ast:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-builder:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-sequence:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-misc:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-dependency:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-collection:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-format:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-html:0.64.0'
|
||||
implementation 'com.vladsch.flexmark:flexmark-util-visitor:0.64.0'
|
||||
|
||||
implementation 'info.picocli:picocli:4.7.5'
|
||||
implementation 'org.kohsuke:github-api:1.317'
|
||||
implementation 'io.sentry:sentry:6.33.0'
|
||||
@@ -147,7 +159,7 @@ run {
|
||||
systemProperty 'io.xpipe.app.developerMode', "true"
|
||||
systemProperty 'io.xpipe.app.logLevel', "trace"
|
||||
systemProperty 'io.xpipe.app.fullVersion', rootProject.fullVersion
|
||||
systemProperty 'io.xpipe.app.showcase', 'false'
|
||||
systemProperty 'io.xpipe.app.showcase', 'true'
|
||||
// systemProperty "io.xpipe.beacon.port", "21724"
|
||||
// systemProperty "io.xpipe.beacon.printMessages", "true"
|
||||
// systemProperty 'io.xpipe.app.debugPlatform', "true"
|
||||
|
||||
@@ -1,159 +1,16 @@
|
||||
dependencies {
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-data-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-ast-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-builder-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-sequence-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-misc-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-dependency-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-collection-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-format-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-html-0.64.0.jar")
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/flexmark-util-visitor-0.64.0.jar")
|
||||
extraJavaModuleInfo {
|
||||
module("com.vladsch.flexmark:flexmark", "com.vladsch.flexmark") {
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-data')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-format')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-ast')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-sequence')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-builder')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-html')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-dependency')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-collection')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-misc')
|
||||
mergeJar('com.vladsch.flexmark:flexmark-util-visitor')
|
||||
exportAllPackages()
|
||||
}
|
||||
}
|
||||
|
||||
addDependenciesModuleInfo {
|
||||
overwriteExistingFiles = true
|
||||
jdepsExtraArgs = ['-q']
|
||||
outputDirectory = file("${project.layout.buildDirectory.get()}/generated-modules")
|
||||
modules {
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark {
|
||||
exports com.vladsch.flexmark.html;
|
||||
exports com.vladsch.flexmark.html.renderer;
|
||||
exports com.vladsch.flexmark.parser;
|
||||
exports com.vladsch.flexmark.parser.core;
|
||||
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_ast;
|
||||
requires com.vladsch.flexmark_util_builder;
|
||||
requires com.vladsch.flexmark_util_sequence;
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
requires com.vladsch.flexmark_util_dependency;
|
||||
requires com.vladsch.flexmark_util_collection;
|
||||
requires com.vladsch.flexmark_util_format;
|
||||
requires com.vladsch.flexmark_util_html;
|
||||
requires com.vladsch.flexmark_util_visitor;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-data:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_data {
|
||||
exports com.vladsch.flexmark.util.data;
|
||||
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-ast:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_ast {
|
||||
exports com.vladsch.flexmark.util.ast;
|
||||
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
requires com.vladsch.flexmark_util_collection;
|
||||
requires com.vladsch.flexmark_util_sequence;
|
||||
requires com.vladsch.flexmark_util_visitor;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-builder:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_builder {
|
||||
exports com.vladsch.flexmark.util.builder;
|
||||
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-sequence:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_sequence {
|
||||
exports com.vladsch.flexmark.util.sequence;
|
||||
exports com.vladsch.flexmark.util.sequence.mappers;
|
||||
exports com.vladsch.flexmark.util.sequence.builder;
|
||||
|
||||
opens com.vladsch.flexmark.util.sequence;
|
||||
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_collection;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-misc:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_misc {
|
||||
exports com.vladsch.flexmark.util.misc;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-dependency:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_dependency {
|
||||
exports com.vladsch.flexmark.util.dependency;
|
||||
|
||||
requires com.vladsch.flexmark_util_collection;
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-collection:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_collection {
|
||||
exports com.vladsch.flexmark.util.collection;
|
||||
exports com.vladsch.flexmark.util.collection.iteration;
|
||||
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-format:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_format {
|
||||
exports com.vladsch.flexmark.util.format;
|
||||
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_sequence;
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
requires com.vladsch.flexmark_util_ast;
|
||||
requires com.vladsch.flexmark_util_collection;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-html:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_html {
|
||||
exports com.vladsch.flexmark.util.html;
|
||||
|
||||
opens com.vladsch.flexmark.util.html;
|
||||
|
||||
requires com.vladsch.flexmark_util_misc;
|
||||
requires com.vladsch.flexmark_util_sequence;
|
||||
}
|
||||
'''
|
||||
}
|
||||
module {
|
||||
artifact 'com.vladsch.flexmark:flexmark-util-visitor:0.64.0'
|
||||
moduleInfoSource = '''
|
||||
module com.vladsch.flexmark_util_visitor {
|
||||
exports com.vladsch.flexmark.util.visitor;
|
||||
}
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,9 +48,6 @@ open module io.xpipe.app {
|
||||
requires org.ocpsoft.prettytime;
|
||||
requires com.dlsc.preferencesfx;
|
||||
requires com.vladsch.flexmark;
|
||||
requires com.vladsch.flexmark_util_data;
|
||||
requires com.vladsch.flexmark_util_ast;
|
||||
requires com.vladsch.flexmark_util_sequence;
|
||||
requires com.fasterxml.jackson.core;
|
||||
requires com.fasterxml.jackson.databind;
|
||||
requires net.synedra.validatorfx;
|
||||
|
||||
@@ -2,7 +2,6 @@ plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
}
|
||||
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
|
||||
@@ -6,9 +6,11 @@ plugins {
|
||||
}
|
||||
|
||||
allprojects { subproject ->
|
||||
if (subproject.name != "cli") {
|
||||
apply plugin: 'org.gradlex.extra-java-module-info'
|
||||
apply plugin: 'org.gradlex.extra-java-module-info'
|
||||
extraJavaModuleInfo {
|
||||
failOnMissingModuleInfo.set(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def getArchName() {
|
||||
|
||||
@@ -2,7 +2,6 @@ plugins {
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'signing'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
}
|
||||
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
|
||||
1
dist/build.gradle
vendored
1
dist/build.gradle
vendored
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
id 'org.beryx.jlink' version '2.26.0'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
id "org.asciidoctor.jvm.convert" version "3.3.2"
|
||||
id 'org.jreleaser' version '1.8.0'
|
||||
id("com.netflix.nebula.ospackage") version "11.4.0"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id "org.moditect.gradleplugin" version "1.0.0-rc3"
|
||||
}
|
||||
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
plugins { id 'java'
|
||||
id 'org.moditect.gradleplugin' version '1.0.0-rc3'
|
||||
}
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
apply from: "$rootDir/gradle/gradle_scripts/extension.gradle"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
plugins { id 'java'
|
||||
id 'org.moditect.gradleplugin' version '1.0.0-rc3'
|
||||
}
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
apply from: "$rootDir/gradle/gradle_scripts/extension.gradle"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
plugins { id 'java'
|
||||
id 'org.moditect.gradleplugin' version '1.0.0-rc3'
|
||||
}
|
||||
apply from: "$rootDir/gradle/gradle_scripts/java.gradle"
|
||||
apply from: "$rootDir/gradle/gradle_scripts/extension.gradle"
|
||||
|
||||
@@ -6,7 +6,7 @@ It also contains various other types of shared build script components that are
|
||||
As the [jlink](https://docs.oracle.com/en/java/javase/17/docs/specs/man/jlink.html) tool
|
||||
effectively requires proper modules as inputs but many established java
|
||||
libraries did not add proper support yet, using an approach like this is required.
|
||||
The modules are generated with the help of [moditect](https://github.com/moditect/moditect-gradle-plugin).
|
||||
The modules are generated with the help of [extra-java-module-info](https://github.com/gradlex-org/extra-java-module-info).
|
||||
The generated `module-info.java` file contains the necessary declarations to make a library work.
|
||||
While gradle already has a [similar system](https://docs.gradle.org/current/userguide/platforms.html)
|
||||
to better share dependencies, this system is lacking several features.
|
||||
|
||||
@@ -4,7 +4,6 @@ task copyRuntimeLibs(type: Copy) {
|
||||
exclude "${project.name}.jar"
|
||||
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||
}
|
||||
copyRuntimeLibs.dependsOn(addDependenciesModuleInfo)
|
||||
jar.dependsOn(copyRuntimeLibs)
|
||||
|
||||
def dev = tasks.register('createDevOutput', Copy) {
|
||||
@@ -64,7 +63,10 @@ dependencies {
|
||||
}
|
||||
|
||||
// Gradle complains about task dependencies even though these are declared as compiled dependencies. Why?
|
||||
compileJava.dependsOn(project(':core').compileJava)
|
||||
compileJava.dependsOn(project(':beacon').compileJava)
|
||||
compileJava.dependsOn(project(':app').compileJava)
|
||||
compileJava.dependsOn(project(':core').getTasksByName('jar', true))
|
||||
compileJava.dependsOn(project(':beacon').getTasksByName('jar', true))
|
||||
compileJava.dependsOn(project(':app').getTasksByName('jar', true))
|
||||
if (project != project(':base')) {
|
||||
compileJava.dependsOn(project(':base').getTasksByName('jar', true))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
dependencies {
|
||||
implementation files("${project.layout.buildDirectory.get()}/generated-modules/versioncompare-1.5.0.jar")
|
||||
}
|
||||
|
||||
addDependenciesModuleInfo {
|
||||
overwriteExistingFiles = true
|
||||
jdepsExtraArgs = ['-q']
|
||||
outputDirectory = file("${project.layout.buildDirectory.get()}/generated-modules")
|
||||
modules {
|
||||
module {
|
||||
artifact "io.github.g00fy2:versioncompare:1.5.0"
|
||||
moduleInfoSource = '''
|
||||
module versioncompare {
|
||||
exports io.github.g00fy2.versioncompare;
|
||||
}
|
||||
'''
|
||||
}
|
||||
extraJavaModuleInfo {
|
||||
module("io.github.g00fy2:versioncompare", "versioncompare") {
|
||||
exportAllPackages()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user