Skip to content

Commit

Permalink
Switch to gradle, because
Browse files Browse the repository at this point in the history
  • Loading branch information
Bios-Marcel committed Jul 25, 2024
1 parent 635a08f commit bbcb7bb
Show file tree
Hide file tree
Showing 17 changed files with 457 additions and 789 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ jobs:
- name: Build artifact
shell: bash
run: |
./mvnw -f antlr.xml dependency:get -Dartifact="org.antlr:antlr4-runtime:4.13.1:jar"
./mvnw -f antlr.xml generate-resources
./mvnw compile package javafx:jlink jpackage:jpackage
./gradlew.bat build jpackage
- name: Upload build artifact
uses: actions/upload-artifact@v4
Expand Down
23 changes: 4 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,6 @@ target/
*.iml
*.ipr

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

Expand All @@ -42,3 +23,7 @@ storage/

# Generated code
/gen

# Gradle
build/
.gradle/
16 changes: 16 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties

This file was deleted.

71 changes: 0 additions & 71 deletions antlr.xml

This file was deleted.

82 changes: 82 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
plugins {
id("application")
id("org.openjfx.javafxplugin") version "0.1.0"
id("antlr")
id("org.panteleyev.jpackageplugin") version "1.6.0"
}

repositories {
mavenCentral()
}

dependencies {
implementation("org.antlr:antlr4-runtime:4.13.1")
implementation("org.jspecify:jspecify:0.3.0")
implementation("org.apache.commons:commons-csv:1.11.0")
implementation("org.eclipse.store:storage-embedded:1.3.2")
implementation("org.eclipse.store:storage-embedded-configuration:1.3.2")
implementation("org.slf4j:slf4j-nop:2.0.13")

testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.0")

antlr("org.antlr:antlr4:4.13.1")
}

application {
mainModule = "link.biosmarcel.baka"
mainClass = "link.biosmarcel.baka.Main"
}

tasks.generateGrammarSource {
maxHeapSize = "64m"
arguments = arguments +
listOf(
"-visitor", "-long-messages",
"-package", "link.biosmarcel.baka"
)
outputDirectory = File("${layout.buildDirectory.get()}/generated-src/antlr/main/link/biosmarcel/baka")
}

javafx {
version = "22.0.2"
modules = listOf("javafx.controls")
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(22)
}
}

task("copyDependencies", Copy::class) {
from(configurations.runtimeClasspath).into("${layout.buildDirectory.get()}/jmods")
}

task("copyJar", Copy::class) {
from(tasks.jar).into("${layout.buildDirectory.get()}/jmods")
}

tasks.jpackage {
dependsOn("build", "copyDependencies", "copyJar")

appVersion = project.version.toString()
appName = "Baka"
vendor = "biosmarcel"
// FIXME Generate runtime
runtimeImage = System.getProperty("java.home")
module = "link.biosmarcel.baka/link.biosmarcel.baka.Main"
modulePaths = listOf("${layout.buildDirectory.get()}/jmods")
destination = "${layout.buildDirectory.get()}/dist"
javaOptions = listOf("-Dfile.encoding=UTF-8")

windows {
winMenu = true
winPerUserInstall = true
icon = "icon.ico"
winUpgradeUuid = "992b362a-998c-4a30-ab65-7c380540aefa"
}
}

version = "1.0.0"

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.vfs.watch=true
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit bbcb7bb

Please sign in to comment.