Update Loom and Loader. Cleanup/improve buildscript.

This commit is contained in:
modmuss50 2021-11-12 12:48:58 +00:00
parent 2e160e0f26
commit b4f4f6cda4
57 changed files with 526 additions and 296 deletions
.editorconfig
.github/workflows
build.gradle
fabric-api-base
build.gradle
src/testmod
java/net/fabricmc/fabric/test/base
resources
fabric-api-lookup-api-v1
fabric-biome-api-v1
fabric-blockrenderlayer-v1
fabric-command-api-v1
fabric-commands-v0
fabric-containers-v0
fabric-content-registries-v0
fabric-crash-report-info-v1
fabric-dimensions-v1
build.gradle
src/testmod/java/net/fabricmc/fabric/test/dimension
fabric-entity-events-v1
fabric-events-interaction-v0
fabric-events-lifecycle-v0
fabric-game-rule-api-v1
fabric-gametest-api-v1
fabric-item-api-v1
fabric-item-groups-v0
fabric-key-binding-api-v1
fabric-keybindings-v0
fabric-lifecycle-events-v1
fabric-loot-tables-v1
fabric-mining-level-api-v1
fabric-mining-levels-v0
fabric-models-v0
fabric-networking-api-v1
fabric-networking-v0
fabric-object-builder-api-v1
fabric-object-builders-v0
fabric-particles-v1
fabric-registry-sync-v0
fabric-renderer-api-v1
fabric-renderer-indigo
fabric-renderer-registries-v1
fabric-rendering-data-attachment-v1
fabric-rendering-fluids-v1
fabric-rendering-v0
fabric-rendering-v1
fabric-resource-loader-v0
fabric-screen-api-v1
fabric-screen-handler-api-v1
fabric-structure-api-v1
fabric-tag-extensions-v0
fabric-textures-v0
fabric-tool-attribute-api-v1
fabric-transfer-api-v1
gradle.properties
gradle
gradlew

View file

@ -11,6 +11,9 @@ indent_style = tab
[*.java]
indent_style = tab
ij_continuation_indent_size = 8
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,*,|,net.minectaft.**,|,net.fabricmc.**
ij_java_class_count_to_use_import_on_demand = 999
[*.json]
indent_style = space

View file

@ -4,13 +4,15 @@ jobs:
build:
strategy:
matrix:
java: [16-jdk]
java: [16-jdk, 17-jdk]
runs-on: ubuntu-20.04
container:
image: openjdk:${{ matrix.java }}
image: eclipse-temurin:${{ matrix.java }}
options: --user root
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- run: ./gradlew check build publishToMavenLocal --stacktrace --parallel --warning-mode=fail
- run: mkdir run && echo "eula=true" >> run/eula.txt

View file

@ -4,7 +4,7 @@ jobs:
build:
runs-on: ubuntu-20.04
container:
image: adoptopenjdk:16-jdk
image: eclipse-temurin:17-jdk
options: --user root
steps:
- run: apt update && apt install git -y && git --version

View file

@ -1,6 +1,6 @@
buildscript {
dependencies {
classpath 'org.kohsuke:github-api:1.114'
classpath 'org.kohsuke:github-api:1.135'
}
}
@ -9,7 +9,7 @@ plugins {
id "eclipse"
id "idea"
id "maven-publish"
id "fabric-loom" version "0.10.54" apply false
id "fabric-loom" version "0.10.55" apply false
id "org.cadixdev.licenser" version "0.6.1"
id "org.ajoberstar.grgit" version "3.1.0"
id "com.matthewprenger.cursegradle" version "1.4.0"
@ -18,20 +18,19 @@ plugins {
def ENV = System.getenv()
class Globals {
static def baseVersion = "0.42.2"
static def mcVersion = "1.18-pre1"
static def yarnVersion = "+build.2"
static def loaderVersion = "0.11.7"
static def preRelease = true
}
version = Globals.baseVersion + "+" + (ENV.GITHUB_RUN_NUMBER ? "" : "local-") + getBranch()
version = project.version + "+" + (ENV.GITHUB_RUN_NUMBER ? "" : "local-") + getBranch()
logger.lifecycle("Building Fabric: " + version)
import org.apache.commons.codec.digest.DigestUtils
def getSubprojectVersion(project, version) {
def getSubprojectVersion(project) {
// Get the version from the gradle.properties file
def version = project.properties["${project.name}-version"]
if (!version) {
throw new NullPointerException("Could not find version for " + project.name)
}
if (grgit == null) {
return version + "+nogit"
}
@ -42,7 +41,7 @@ def getSubprojectVersion(project, version) {
return version + "+uncommited"
}
return version + "+" + latestCommits.get(0).id.substring(0, 8) + DigestUtils.sha256Hex(Globals.mcVersion).substring(0, 2)
return version + "+" + latestCommits.get(0).id.substring(0, 8) + DigestUtils.sha256Hex(project.rootProject.minecraft_version).substring(0, 2)
}
def getBranch() {
@ -61,28 +60,12 @@ def getBranch() {
}
def moduleDependencies(project, List<String> depNames) {
def deps = depNames.iterator().collect { project.dependencies.project(path: ":$it", configuration: 'dev') }
def deps = depNames.iterator().collect { project.dependencies.project(path: ":$it", configuration: 'namedElements') }
project.dependencies {
deps.each {
api it
}
}
project.publishing {
publications {
mavenJava(MavenPublication) {
pom.withXml {
def depsNode = asNode().appendNode("dependencies")
deps.each {
def depNode = depsNode.appendNode("dependency")
depNode.appendNode("groupId", it.group)
depNode.appendNode("artifactId", it.name)
depNode.appendNode("version", it.version)
depNode.appendNode("scope", "compile")
}
}
}
}
}
}
allprojects {
@ -123,13 +106,9 @@ allprojects {
}
dependencies {
minecraft "com.mojang:minecraft:$Globals.mcVersion"
mappings "net.fabricmc:yarn:${Globals.mcVersion}${Globals.yarnVersion}:v2"
modApi "net.fabricmc:fabric-loader:${Globals.loaderVersion}"
}
configurations {
dev
minecraft "com.mojang:minecraft:$rootProject.minecraft_version"
mappings "net.fabricmc:yarn:${rootProject.minecraft_version}${project.yarn_version}:v2"
modApi "net.fabricmc:fabric-loader:${project.loader_version}"
}
loom {
@ -140,32 +119,17 @@ allprojects {
mavenLocal()
}
jar {
archiveClassifier = "dev"
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
afterEvaluate {
remapJar {
input = file("${project.buildDir}/libs/$archivesBaseName-${project.version}-dev.jar")
archiveFileName = "${archivesBaseName}-${project.version}.jar"
}
artifacts {
dev file: file("${project.buildDir}/libs/$archivesBaseName-${project.version}-dev.jar"), type: "jar", builtBy: jar
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
license {
header rootProject.file("HEADER")
include "**/*.java"
}
license {
header rootProject.file("HEADER")
include "**/*.java"
}
task sourcesJar(type: Jar, dependsOn: classes) {
@ -175,18 +139,23 @@ allprojects {
checkstyle {
configFile = rootProject.file("checkstyle.xml")
toolVersion = "8.43"
toolVersion = "9.1"
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
}
// Apply auxiliary buildscripts to submodules
// This must be done after all plugins are applied to subprojects
apply from: "gradle/module-validation.gradle"
apply from: "gradle/module-versioning.gradle"
javadoc {
options {
@ -224,46 +193,52 @@ task javadocJar(type: Jar) {
build.dependsOn javadocJar
// Runs a dedicated headless server with all test mods that closes once complete.
loom {
runs {
gametest {
inherit testmodServer
name "Game Test"
// Enable the gametest runner
vmArg "-Dfabric-api.gametest"
vmArg "-Dfabric-api.gametest.report-file=${project.buildDir}/junit.xml"
runDir "build/gametest"
}
autoTestServer {
inherit testmodServer
name "Auto Test Server"
vmArg "-Dfabric.autoTest"
}
}
}
test.dependsOn runGametest
subprojects {
dependencies {
testmodImplementation sourceSets.main.output
// Make all modules depend on the gametest api to try and promote its usage.
if (project.name != "fabric-gametest-api-v1")
testmodImplementation project(path: ':fabric-gametest-api-v1', configuration: 'namedElements')
}
publishing {
publications {
mavenJava(MavenPublication) {
afterEvaluate {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
from components.java
}
}
setupRepositories(repositories)
}
// Required as moduleDependencies modifies the pom
loom.disableDeprecatedPomGeneration(publishing.publications.mavenJava)
javadoc.enabled = false
afterEvaluate {
// Disable the gen sources task on sub projects, saves you being here for a year.
// Disable the gen sources task on sub projects
genSourcesWithFernFlower.enabled = false
genSourcesWithCfr.enabled = false
unpickJar.enabled = false
@ -306,6 +281,7 @@ publishing {
setupRepositories(repositories)
}
// Required until the deprecation is removed. Fabric API's main jar that is published to maven does not contain sub modules.
loom.disableDeprecatedPomGeneration(publishing.publications.mavenJava)
void setupRepositories(RepositoryHandler repositories) {
@ -340,7 +316,7 @@ def devOnlyModules = [
dependencies {
afterEvaluate {
subprojects.each {
api project(path: ":${it.name}", configuration: "dev")
api project(path: ":${it.name}", configuration: "namedElements")
if (!(it.name in devOnlyModules)) {
include project("${it.name}:")
@ -359,12 +335,12 @@ curseforge {
project {
id = "306612"
changelog = ENV.CHANGELOG ?: "No changelog provided"
releaseType = Globals.preRelease ? "beta" : "release"
releaseType = project.prerelease ? "beta" : "release"
addGameVersion "1.18-Snapshot"
addGameVersion "Fabric"
mainArtifact(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")) {
displayName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion"
mainArtifact(remapJar) {
displayName = "[$project.minecraft_version] Fabric API $project.version"
}
afterEvaluate {
@ -390,10 +366,10 @@ task github(dependsOn: remapMavenJar) {
def repository = github.getRepository(ENV.GITHUB_REPOSITORY)
def releaseBuilder = new GHReleaseBuilder(repository, version as String)
releaseBuilder.name("[$Globals.mcVersion] Fabric API $Globals.baseVersion")
releaseBuilder.name("[$project.minecraft_version] Fabric API $project.version")
releaseBuilder.body(ENV.CHANGELOG ?: "No changelog provided")
releaseBuilder.commitish(getBranch())
releaseBuilder.prerelease(Globals.preRelease)
releaseBuilder.prerelease(project.prerelease)
def ghRelease = releaseBuilder.create()
ghRelease.uploadAsset(file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar"), "application/java-archive");
@ -408,13 +384,13 @@ task modrinth(type: com.modrinth.minotaur.TaskModrinthUpload, dependsOn: remapMa
token = ENV.MODRINTH_TOKEN
projectId = "P7dR8mSH"
versionNumber = version
versionName = "[$Globals.mcVersion] Fabric API $Globals.baseVersion"
releaseType = Globals.preRelease ? "beta" : "release"
versionName = "[$project.minecraft_version] Fabric API $project.version"
releaseType = project.prerelease ? "beta" : "release"
changelog = ENV.CHANGELOG ?: "No changelog provided"
uploadFile = file("${project.buildDir}/libs/${archivesBaseName}-${version}.jar")
uploadFile = remapJar
addGameVersion(Globals.mcVersion)
addGameVersion(project.minecraft_version)
addLoader('fabric')
}

View file

@ -1,7 +1,7 @@
archivesBaseName = "fabric-api-base"
version = getSubprojectVersion(project, "0.4.0")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
}

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.fabricmc.fabric.test.base;
import org.spongepowered.asm.mixin.MixinEnvironment;
import net.minecraft.test.GameTest;
import net.minecraft.test.TestContext;
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
public class FabricApiBaseGameTest {
@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
public void auditMixins(TestContext context) {
MixinEnvironment.getCurrentEnvironment().audit();
context.complete();
}
}

View file

@ -8,6 +8,9 @@
"entrypoints": {
"main": [
"net.fabricmc.fabric.test.base.FabricApiBaseTestInit"
],
"fabric-gametest" : [
"net.fabricmc.fabric.test.base.FabricApiBaseGameTest"
]
}
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-api-lookup-api-v1"
version = getSubprojectVersion(project, "1.3.2")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',
@ -7,5 +7,5 @@ moduleDependencies(project, [
])
dependencies {
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'namedElements')
}

View file

@ -1,12 +1,12 @@
archivesBaseName = "fabric-biome-api-v1"
version = getSubprojectVersion(project, "5.0.3")
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file("src/main/resources/fabric-biome-api-v1.accesswidener")
}
dependencies {
testmodImplementation project(path: ':fabric-api-base', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-api-base', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-blockrenderlayer-v1"
version = getSubprojectVersion(project, "1.1.7")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,8 +1,8 @@
archivesBaseName = "fabric-command-api-v1"
version = getSubprojectVersion(project, "1.1.4")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
}
moduleDependencies(project, [

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-commands-v0"
version = getSubprojectVersion(project, "0.2.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-containers-v0"
version = getSubprojectVersion(project, "0.1.14")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-content-registries-v0"
version = getSubprojectVersion(project, "0.3.2")
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file("src/main/resources/fabric-content-registries-v0.accesswidener")

View file

@ -1,2 +1,2 @@
archivesBaseName = "fabric-crash-report-info-v1"
version = getSubprojectVersion(project, "0.1.6")
version = getSubprojectVersion(project)

View file

@ -1,10 +1,10 @@
archivesBaseName = "fabric-dimensions-v1"
version = getSubprojectVersion(project, "2.1.4")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
}
moduleDependencies(project, [

View file

@ -68,6 +68,11 @@ public class FabricDimensionTest implements ModInitializer {
WORLD_KEY = RegistryKey.of(Registry.WORLD_KEY, new Identifier("fabric_dimension", "void"));
if (System.getProperty("fabric-api.gametest") != null) {
// The gametest server does not support custom worlds
return;
}
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
ServerWorld overworld = server.getWorld(World.OVERWORLD);
ServerWorld world = server.getWorld(WORLD_KEY);

View file

@ -1,12 +1,12 @@
archivesBaseName = "fabric-entity-events-v1"
version = getSubprojectVersion(project, "1.3.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'
])
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-networking-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-registry-sync-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-networking-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-registry-sync-v0', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-events-interaction-v0"
version = getSubprojectVersion(project, "0.4.13")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-events-lifecycle-v0"
version = getSubprojectVersion(project, "0.2.2")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,12 +1,12 @@
archivesBaseName = "fabric-game-rule-api-v1"
version = getSubprojectVersion(project, "1.0.8")
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file("src/main/resources/fabric-game-rule-api-v1.accesswidener")
}
dependencies {
testmodImplementation project(path: ':fabric-api-base', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-api-base', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-gametest-api-v1"
version = getSubprojectVersion(project, "1.0.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-item-api-v1"
version = getSubprojectVersion(project, "1.2.5")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-item-groups-v0"
version = getSubprojectVersion(project, "0.3.1")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,8 +1,8 @@
archivesBaseName = "fabric-key-binding-api-v1"
version = getSubprojectVersion(project, "1.0.5")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-api-base', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-api-base', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-keybindings-v0"
version = getSubprojectVersion(project, "0.2.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-key-binding-api-v1'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-lifecycle-events-v1"
version = getSubprojectVersion(project, "1.4.7")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-loot-tables-v1"
version = getSubprojectVersion(project, "1.0.6")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-mining-level-api-v1"
version = getSubprojectVersion(project, "1.0.1")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',
@ -8,5 +8,5 @@ moduleDependencies(project, [
])
dependencies {
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-mining-levels-v0"
version = getSubprojectVersion(project, "0.1.4")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,11 +1,11 @@
archivesBaseName = "fabric-models-v0"
version = getSubprojectVersion(project, "0.3.2")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'
])
dependencies {
testmodImplementation project(path: ':fabric-renderer-registries-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-renderer-registries-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
}

View file

@ -1,12 +1,12 @@
archivesBaseName = "fabric-networking-api-v1"
version = getSubprojectVersion(project, "1.0.16")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'
])
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-key-binding-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-key-binding-api-v1', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-networking-v0"
version = getSubprojectVersion(project, "0.3.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,8 +1,8 @@
archivesBaseName = "fabric-object-builder-api-v1"
version = getSubprojectVersion(project, "1.10.10")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
}
moduleDependencies(project, [

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-object-builders"
version = getSubprojectVersion(project, "0.7.4")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-particles-v1"
version = getSubprojectVersion(project, "0.2.6")
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file("src/main/resources/fabric-particles-v1.accesswidener")

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-registry-sync-v0"
version = getSubprojectVersion(project, "0.8.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,17 +1,17 @@
archivesBaseName = "fabric-renderer-api-v1"
version = getSubprojectVersion(project, "0.4.7")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'
])
dependencies {
testmodImplementation project(path: ':fabric-blockrenderlayer-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-models-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-renderer-indigo', configuration: 'dev')
testmodImplementation project(path: ':fabric-rendering-data-attachment-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-tool-attribute-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-blockrenderlayer-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-models-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-renderer-indigo', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-rendering-data-attachment-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-tool-attribute-api-v1', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-renderer-indigo"
version = getSubprojectVersion(project, "0.4.10")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-renderer-registries-v1"
version = getSubprojectVersion(project, "3.2.5")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-rendering-data-attachment-v1"
version = getSubprojectVersion(project, "0.2.1")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-rendering-fluids-v1"
version = getSubprojectVersion(project, "0.1.16")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',
@ -7,5 +7,5 @@ moduleDependencies(project, [
])
dependencies {
testmodImplementation project(path: ':fabric-textures-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-textures-v0', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-rendering-v0"
version = getSubprojectVersion(project, "1.1.7")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-rendering-v1"
version = getSubprojectVersion(project, "1.10.1")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,7 +1,7 @@
archivesBaseName = "fabric-resource-loader-v0"
version = getSubprojectVersion(project, "0.4.9")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-api-base', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-api-base', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-screen-api-v1"
version = getSubprojectVersion(project, "1.0.5")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,13 +1,13 @@
archivesBaseName = "fabric-screen-handler-api-v1"
version = getSubprojectVersion(project, "1.1.9")
version = getSubprojectVersion(project)
loom {
accessWidenerPath = file('src/main/resources/fabric-screen-handler-api-v1.accesswidener')
}
dependencies {
testmodImplementation(project(path: ':fabric-object-builder-api-v1', configuration: 'dev'))
testmodRuntimeOnly(project(path: ':fabric-resource-loader-v0', configuration: 'dev'))
testmodImplementation(project(path: ':fabric-object-builder-api-v1', configuration: 'namedElements'))
testmodRuntimeOnly(project(path: ':fabric-resource-loader-v0', configuration: 'namedElements'))
}
moduleDependencies(project, [

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-structure-api-v1"
version = getSubprojectVersion(project, "2.0.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-lifecycle-events-v1',
'fabric-api-base'

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-tag-extensions-v0"
version = getSubprojectVersion(project, "1.2.3")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',
@ -7,7 +7,7 @@ moduleDependencies(project, [
])
dependencies {
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-key-binding-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-command-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-key-binding-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
}

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-textures-v0"
version = getSubprojectVersion(project, "1.0.7")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base'

View file

@ -1,10 +1,10 @@
archivesBaseName = "fabric-tool-attribute-api-v1"
version = getSubprojectVersion(project, "1.3.1")
version = getSubprojectVersion(project)
dependencies {
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-lifecycle-events-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
}
moduleDependencies(project, [

View file

@ -1,5 +1,5 @@
archivesBaseName = "fabric-transfer-api-v1"
version = getSubprojectVersion(project, "1.5.1")
version = getSubprojectVersion(project)
moduleDependencies(project, [
'fabric-api-base',
@ -10,9 +10,9 @@ moduleDependencies(project, [
])
dependencies {
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-rendering-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'dev')
testmodImplementation project(path: ':fabric-tool-attribute-api-v1', configuration: 'dev')
testmodImplementation project(path: ':fabric-object-builder-api-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-rendering-v1', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-resource-loader-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-tag-extensions-v0', configuration: 'namedElements')
testmodImplementation project(path: ':fabric-tool-attribute-api-v1', configuration: 'namedElements')
}

View file

@ -1 +1,55 @@
org.gradle.jvmargs=-Xmx2560M
version=0.42.2
minecraft_version=1.18-pre1
yarn_version=+build.2
loader_version=0.12.5
prerelease=true
# Do not manually update, use the bumpversions task:
fabric-api-base-version=0.4.0
fabric-api-lookup-api-v1-version=1.3.2
fabric-biome-api-v1-version=5.0.3
fabric-blockrenderlayer-v1-version=1.1.7
fabric-command-api-v1-version=1.1.4
fabric-commands-v0-version=0.2.3
fabric-containers-v0-version=0.1.14
fabric-content-registries-v0-version=0.3.2
fabric-crash-report-info-v1-version=0.1.6
fabric-dimensions-v1-version=2.1.4
fabric-entity-events-v1-version=1.3.3
fabric-events-interaction-v0-version=0.4.13
fabric-events-lifecycle-v0-version=0.2.2
fabric-game-rule-api-v1-version=1.0.8
fabric-gametest-api-v1-version=1.0.3
fabric-item-api-v1-version=1.2.5
fabric-item-groups-v0-version=0.3.1
fabric-key-binding-api-v1-version=1.0.5
fabric-keybindings-v0-version=0.2.3
fabric-lifecycle-events-v1-version=1.4.7
fabric-loot-tables-v1-version=1.0.6
fabric-mining-level-api-v1-version=1.0.1
fabric-mining-levels-v0-version=0.1.4
fabric-models-v0-version=0.3.2
fabric-networking-api-v1-version=1.0.16
fabric-networking-v0-version=0.3.3
fabric-object-builder-api-v1-version=1.10.10
fabric-object-builders-v0-version=0.7.4
fabric-particles-v1-version=0.2.6
fabric-registry-sync-v0-version=0.8.3
fabric-renderer-api-v1-version=0.4.7
fabric-renderer-indigo-version=0.4.10
fabric-renderer-registries-v1-version=3.2.5
fabric-rendering-data-attachment-v1-version=0.2.1
fabric-rendering-fluids-v1-version=0.1a.16
fabric-rendering-v0-version=1.1.7
fabric-rendering-v1-version=1.10.1
fabric-resource-loader-v0-version=0.4.9
fabric-screen-api-v1-version=1.0.5
fabric-screen-handler-api-v1-version=1.1.9
fabric-structure-api-v1-version=2.0.3
fabric-tag-extensions-v0-version=1.2.3
fabric-textures-v0-version=1.0.7
fabric-tool-attribute-api-v1-version=1.3.1
fabric-transfer-api-v1-version=1.5.1

View file

@ -0,0 +1,105 @@
/**
* This task should be used to easily bump the major/minor/patch version of a fabric-api module.
* It will automatically bump the versions of dependent modules.
*/
task bumpVersions(type: BumpVersionTask)
class BumpVersionTask extends DefaultTask {
BumpVersionTask() {
group = "publishing"
outputs.upToDateWhen { false }
}
@TaskAction
void runTask() {
def scanner = new Scanner(System.in)
def toUpdate = [:]
while (true) {
println "Enter module name to update, or done to continue"
def input = scanner.nextLine()
if (input == "done") {
break
}
def subProject = project.getChildProjects().get(input)
if (!subProject) {
println "Could not find project with name: $input"
continue
}
while (true) {
println "Bump version for ${subProject.name}:"
println "0) Bump Major"
println "1) Bump Minor"
println "2) Bump Patch"
input = scanner.nextLine()
if (!(input in ["0", "1", "2"])) {
println "Invalid input"
continue
}
toUpdate.put(subProject, input as Integer)
break
}
}
while (true) {
def temp = [:]
toUpdate.keySet().forEach { p ->
project.childProjects.values().forEach { cp ->
def config = cp.configurations.api
config.allDependencies.forEach { dep ->
if (dep.name == p.name) {
if (!toUpdate.containsKey(cp)) {
println "Bumping patch of ${cp.name} as it depends on ${p.name}"
temp.put(cp, 2) // Bump patch
}
}
}
}
}
if (temp.isEmpty()) {
break
}
toUpdate.putAll(temp)
}
def gpFile = project.file("gradle.properties")
def props = project.properties
def text = gpFile.text
toUpdate.forEach { p, i ->
def version = props."${p.name}-version"
if (!version) {
throw new NullPointerException("Could not find version for " + p.name)
}
def split = version.split("\\.")
split[i] = (split[i] as Integer) + 1
def newVersion = split.join(".")
println "${p.name}: $version -> $newVersion"
text = text.replace(
"${p.name}-version=$version",
"${p.name}-version=$newVersion"
)
}
gpFile.text = text
}
}

Binary file not shown.

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

269
gradlew vendored
View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,67 +17,101 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -106,80 +140,95 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"