Skip to content

Commit

Permalink
Merge pull request #9 from PolyhedralDev/dev/bump-6.4.1
Browse files Browse the repository at this point in the history
Dev/bump 6.4.1
  • Loading branch information
duplexsystem authored Dec 9, 2023
2 parents d41d2bd + 6a837c6 commit 8c1e77f
Show file tree
Hide file tree
Showing 20 changed files with 859 additions and 254 deletions.
552 changes: 526 additions & 26 deletions .editorconfig

Large diffs are not rendered by default.

46 changes: 32 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,48 @@ name: Java CI

on:
push:
tags:
- "v*.*.*"
- *
pull_request:
- *


jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up JDK 17
uses: actions/setup-java@v2
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '17'
distribution: 'adopt'
- name: Build with Gradle
run: ./gradlew build
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- uses: burrunan/gradle-cache-action@03c71a8ba93d670980695505f48f49daf43704a6
name: Build Terra
with:
# Specifies arguments for Gradle execution
# If arguments is missing or empty, then Gradle is not executed
arguments: build
# arguments can be multi-line for better readability
# arguments: |
# --no-paralell
# build
# -x test
# Gradle version to use for execution:
# wrapper (default), current, rc, nightly, release-nightly, or
# versions like 6.6 (see https://services.gradle.org/versions/all)
gradle-version: wrapper
# Properties are passed as -Pname=value
properties: |
kotlin.js.compiler=ir
kotlin.parallel.tasks.in.project=true
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: startsWith(github.ref, 'refs/tags/')
with:
body: "Please download the jar specific to your platform.
Or, if you're not sure which jar to use, then use the `-all.jar` file."
files: |
build/libs/BiomeTool-*-all.jar
build/libs/BiomeTool-*-win.jar
build/libs/BiomeTool-*-osx.jar
build/libs/BiomeTool-*-linux.jar
build/libs/BiomeTool-*-all.jar
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,4 @@ gradle-app.setting
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
!gradle/wrapper/gradle-wrapper.properties

**/.vale.ini
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ It should work with most Terra addons, it's been tested extensively and verified

## Downloading

To download the biome tool jar, go to the [releases page](https://github.com/PolyhedralDev/BiomeTool/releases/latest/), and you can find a selection of jars to download. Download the
To download the biome tool jar, go to the [releases page](https://github.com/PolyhedralDev/BiomeTool/releases/latest/), and you can find a
selection of jars to download. Download the
correct one for your platform.

- For Windows, download the `BiomeTool-*-win.jar` file.
Expand Down
169 changes: 100 additions & 69 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import java.net.URL

plugins {
application
kotlin("jvm") version "1.6.10"
id("org.openjfx.javafxplugin") version "0.0.10"
id("com.github.johnrengelman.shadow") version "7.1.0"
kotlin("jvm") version "1.9.21"
id("org.openjfx.javafxplugin") version "0.1.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
}

var mainClassName: String by application.mainClass
mainClassName = "com.dfsek.terra.biometool.BiomeToolLauncher"

group = "com.dfsek"
version = "0.4.7"
version = "0.4.8"

val runDir = file("$buildDir/run")

Expand All @@ -37,17 +37,17 @@ java {
}

val javafxModules = listOf(
"base",
"controls",
// "fxml",
"graphics",
"media",
// "swing",
// "web",
)
"base",
"controls",
// "fxml",
"graphics",
"media",
// "swing",
// "web",
)

javafx {
version = "17"
version = "17.0.9"
modules = javafxModules.map { "javafx.$it" }
}

Expand All @@ -59,14 +59,29 @@ val implementation: Configuration by configurations.implementation
val runtimeClasspath: Configuration by configurations.runtimeClasspath

val linuxImplementation: Configuration by configurations.creating {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named<Usage>(Usage.JAVA_RUNTIME))
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named<OperatingSystemFamily>("linux"))
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named<MachineArchitecture>("x86-64"))
}
extendsFrom(implementation)
}

val windowsImplementation: Configuration by configurations.creating {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named<Usage>(Usage.JAVA_RUNTIME))
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named<OperatingSystemFamily>("windows"))
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named<MachineArchitecture>("x86-64"))
}
extendsFrom(implementation)
}

val osxImplementation: Configuration by configurations.creating {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named<Usage>(Usage.JAVA_RUNTIME))
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named<OperatingSystemFamily>("mac"))
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named<MachineArchitecture>("x86-64"))
}
extendsFrom(implementation)
}

Expand All @@ -83,71 +98,75 @@ val bootstrapTerraAddon: Configuration by configurations.creating {

dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
val terraGitHash = "358e09d05"

val terraGitHash = "3aef97738"

bootstrapTerraAddon("com.dfsek.terra:api-addon-loader:0.1.0-BETA+$terraGitHash")
bootstrapTerraAddon("com.dfsek.terra:manifest-addon-loader:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-image:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-pipeline:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-extrusion:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-pipeline:v2-1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-image:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-image:v2-1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-pipeline:1.0.2-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-pipeline:v2-1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-provider-single:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:biome-query-api:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:chunk-generator-noise-3d:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:chunk-generator-noise-3d:1.2.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:command-addons:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:command-packs:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:command-profiler:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:command-structures:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-biome:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-distributors:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-distributors:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-feature:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-flora:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-locators:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-noise-function:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-ore:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-flora:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-locators:1.1.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-noise-function:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-number-predicate:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-ore:1.1.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-palette:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-structure:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:config-structure:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:generation-stage-feature:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:generation-stage-structure:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:language-yaml:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-mutator:0.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-sponge-loader:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-terrascript-loader:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:terrascript-function-check-noise-3d:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:library-image:1.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:locator-slant-noise-3d:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:palette-block-shortcut:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:pipeline-image:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-block-shortcut:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-mutator:0.1.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-sponge-loader:1.0.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:structure-terrascript-loader:1.2.0-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:terrascript-function-check-noise-3d:1.0.1-BETA+$terraGitHash")
terraAddon("com.dfsek.terra:terrascript-function-sampler:1.0.0-BETA+$terraGitHash")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2-native-mt")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.5.2-native-mt")
implementation("com.dfsek.terra:base:6.2.1-BETA+$terraGitHash")
implementation("ca.solo-studios:slf4k:0.4.6")
implementation("ch.qos.logback:logback-classic:1.2.11")
implementation("com.google.guava:guava:31.1-jre")


implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")

implementation("com.dfsek.terra:base:6.4.1-BETA+$terraGitHash")

implementation("ca.solo-studios:slf4k:0.5.3")

implementation("ch.qos.logback:logback-classic:1.4.14")

implementation("com.google.guava:guava:32.1.3-jre")

implementation("no.tornado:tornadofx:1.7.20") {
exclude("org.jetbrains.kotlin")
}
implementation("commons-io:commons-io:2.11.0")

implementation("commons-io:commons-io:2.15.1")

for (javafxModule in javafxModules) {
val mavenCoordinates = "org.openjfx:javafx-$javafxModule:${javafx.version}"

linuxImplementation("$mavenCoordinates:linux")
windowsImplementation("$mavenCoordinates:win")
osxImplementation("$mavenCoordinates:mac")
}

// Jansi for terminal colouring on Windows
windowsImplementation("org.fusesource.jansi:jansi:2.4.0")
windowsImplementation("org.fusesource.jansi:jansi:2.4.1")
}

tasks.test {
Expand All @@ -164,21 +183,21 @@ val javadoc by tasks.javadoc
tasks.withType<ShadowJar>() {
if (name == ShadowJavaPlugin.SHADOW_JAR_TASK_NAME)
return@withType

group = "Jar"
description = "A platform jar for $archiveClassifier with runtime dependencies"
manifest.inheritFrom(jar.manifest)

from(sourceSets.main.orNull?.output)
configurations.add(project.configurations.runtimeClasspath.orNull)
exclude("META-INF/INDEX.LIST", "META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "module-info.class")

tasks.register<ConfigureShadowRelocation>(
ConfigureShadowRelocation.taskName(this)
) {
ConfigureShadowRelocation.taskName(this)
) {
this@withType.dependsOn(this)
}

doFirst {
archiveVersion.set(project.version.toString())
}
Expand Down Expand Up @@ -215,31 +234,43 @@ val shadowJarAll by tasks.creating(ShadowJar::class) {
configurations = listOf(linuxImplementation, windowsImplementation, osxImplementation)
}

tasks.named("shadowDistZip") {
dependsOn(shadowJarAll)
}

tasks.named("shadowDistTar") {
dependsOn(shadowJarAll)
}

tasks.named("startShadowScripts") {
dependsOn(shadowJarAll)
}

tasks.withType<Jar>() {
entryCompression = ZipEntryCompression.STORED
manifest {
attributes(
"Main-Class" to mainClassName,
"Built-By" to System.getProperties()["user.name"],
"Built-Jdk" to System.getProperties()["java.version"],
"Name" to project.name,
"Add-Opens" to "javafx.graphics/javafx.scene",
)
"Main-Class" to mainClassName,
"Built-By" to System.getProperties()["user.name"],
"Built-Jdk" to System.getProperties()["java.version"],
"Name" to project.name,
"Add-Opens" to "javafx.graphics/javafx.scene",
)
}
}

val downloadDefaultPacks: Task by tasks.creating() {
group = "application"

doFirst {
val defaultPack = URL("https://github.com/PolyhedralDev/TerraOverworldConfig/releases/download/latest/default.zip")
val fileName = defaultPack.file.substring(defaultPack.file.lastIndexOf("/"))

file("$runDir/packs/").mkdirs()

defaultPack.openStream().transferTo(file("$runDir/packs/$fileName").outputStream())
}

}

val prepareRunAddons by tasks.creating(Sync::class) {
Expand All @@ -250,20 +281,20 @@ val prepareRunAddons by tasks.creating(Sync::class) {
val terraBoostrapJars = bootstrapTerraAddon.resolvedConfiguration.firstLevelModuleDependencies.flatMap { dependency ->
dependency.moduleArtifacts.map { it.file }
}

from(terraAddonJars)

from(terraBoostrapJars) {
into("bootstrap")
}

into("$runDir/addons")
}

tasks.getByName<JavaExec>("run") {
dependsOn(prepareRunAddons, downloadDefaultPacks)
runDir.mkdirs()

workingDir = runDir
@Suppress("UselessCallOnNotNull") // Thanks Kotlin
jvmArgs = jvmArgs.orEmpty() + listOf("--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED")
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 8c1e77f

Please sign in to comment.