Skip to content

Modularize application (use Java module system) #1043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk
- image: cimg/openjdk:17.0.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- checkout:
path: ~/repo

# Download and cache dependencies
- restore_cache:
keys:
Expand All @@ -44,4 +44,4 @@ jobs:

# report tests results
- run: ./gradlew jacocoTestReport coveralls

65 changes: 59 additions & 6 deletions de.peeeq.wurstscript/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'application'
id 'org.beryx.jlink' version '2.24.4'
}

import de.undercouch.gradle.tasks.download.Download
Expand All @@ -32,12 +33,12 @@ version = "1.8.1.0"

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

jacoco {
toolVersion = "0.8.5"
toolVersion = "0.8.7"
}

jacocoTestReport {
Expand Down Expand Up @@ -103,13 +104,22 @@ dependencies {
implementation group: 'net.sourceforge.jchardet', name: 'jchardet', version: '1.0'

// Crigges' jmpq
implementation 'com.github.inwc3:jmpq3:0aaca2373d'
implementation 'com.github.inwc3:jmpq3:1.9.5'

// Water's wc3 libs
implementation 'com.github.inwc3:wc3libs:7ece74aecc'
implementation 'com.github.inwc3:wc3libs:1.1.2'

// The setup tool for wurst.build handling
implementation 'com.github.wurstscript:wurstsetup:4c65824b40'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.4'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.12.4'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.4'
implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.32'
implementation 'io.github.microutils:kotlin-logging:1.6.26'


implementation 'javax.servlet:javax.servlet-api:3.0.1'

testImplementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.12.0.202106070339-r'

implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
Expand Down Expand Up @@ -201,7 +211,6 @@ gen.dependsOn generateGrammarSource

compileJava.dependsOn gen


test {
// set minimal heap size required to run tests:
jvmArgs = ['-Xms256m']
Expand Down Expand Up @@ -230,3 +239,47 @@ task downloadAndUnzipFile(dependsOn: downloadZipFile, type: Copy) {
}

apply from: 'deploy.gradle'

jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher{
name = 'de.peeeq.wurstio.Main'
jvmArgs = []
}
}

ext.moduleName = 'de.peeeq.wurstscript'
application.mainModule = 'de.peeeq.wurstscript'

compileJava {
inputs.property('moduleName', moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath
]
classpath = files()
}
}

jlink {

targetPlatform("linux_x64") {
jdkHome = jdkDownload("https://corretto.aws/downloads/latest/amazon-corretto-17-x64-linux-jdk.tar.gz")
}

targetPlatform("linux_aarch64") {
jdkHome = jdkDownload("https://corretto.aws/downloads/latest/amazon-corretto-17-aarch64-linux-jdk.tar.gz")
}

targetPlatform("win") {
jdkHome = jdkDownload("https://corretto.aws/downloads/latest/amazon-corretto-17-x64-windows-jdk.zip")
}

targetPlatform("mac_x64") {
jdkHome = jdkDownload("https://corretto.aws/downloads/latest/amazon-corretto-17-x64-macos-jdk.tar.gz")
}

targetPlatform("mac_aarch64") {
jdkHome = jdkDownload("https://corretto.aws/downloads/latest/amazon-corretto-17-aarch64-macos-jdk.tar.gz")
}
}
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.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading