diff --git a/.editorconfig b/.editorconfig index a40feaeb38..c842fc3257 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e342c36e5..411b321ccb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14455836d6..8b38e053ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/build.gradle b/build.gradle index c9a0cefda7..99bdec4f9f 100644 --- a/build.gradle +++ b/build.gradle @@ -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 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" - } - - 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 + processResources { + inputs.property "version", project.version - filesMatching("fabric.mod.json") { - expand "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') } diff --git a/fabric-api-base/build.gradle b/fabric-api-base/build.gradle index 1e9c654839..c8e393eda6 100644 --- a/fabric-api-base/build.gradle +++ b/fabric-api-base/build.gradle @@ -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') } diff --git a/fabric-api-base/src/testmod/java/net/fabricmc/fabric/test/base/FabricApiBaseGameTest.java b/fabric-api-base/src/testmod/java/net/fabricmc/fabric/test/base/FabricApiBaseGameTest.java new file mode 100644 index 0000000000..ec02b1c4fe --- /dev/null +++ b/fabric-api-base/src/testmod/java/net/fabricmc/fabric/test/base/FabricApiBaseGameTest.java @@ -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(); + } +} diff --git a/fabric-api-base/src/testmod/resources/fabric.mod.json b/fabric-api-base/src/testmod/resources/fabric.mod.json index 9811f2ed31..200c12b705 100644 --- a/fabric-api-base/src/testmod/resources/fabric.mod.json +++ b/fabric-api-base/src/testmod/resources/fabric.mod.json @@ -8,6 +8,9 @@ "entrypoints": { "main": [ "net.fabricmc.fabric.test.base.FabricApiBaseTestInit" + ], + "fabric-gametest" : [ + "net.fabricmc.fabric.test.base.FabricApiBaseGameTest" ] } } diff --git a/fabric-api-lookup-api-v1/build.gradle b/fabric-api-lookup-api-v1/build.gradle index f5fb5b65f2..d8992615ae 100644 --- a/fabric-api-lookup-api-v1/build.gradle +++ b/fabric-api-lookup-api-v1/build.gradle @@ -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') } diff --git a/fabric-biome-api-v1/build.gradle b/fabric-biome-api-v1/build.gradle index 089621b156..b001ee1fa1 100644 --- a/fabric-biome-api-v1/build.gradle +++ b/fabric-biome-api-v1/build.gradle @@ -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') } diff --git a/fabric-blockrenderlayer-v1/build.gradle b/fabric-blockrenderlayer-v1/build.gradle index 3aab45b152..d945519d61 100644 --- a/fabric-blockrenderlayer-v1/build.gradle +++ b/fabric-blockrenderlayer-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-blockrenderlayer-v1" -version = getSubprojectVersion(project, "1.1.7") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-command-api-v1/build.gradle b/fabric-command-api-v1/build.gradle index c4bc56c740..b4cd26235e 100644 --- a/fabric-command-api-v1/build.gradle +++ b/fabric-command-api-v1/build.gradle @@ -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, [ diff --git a/fabric-commands-v0/build.gradle b/fabric-commands-v0/build.gradle index 385fcc9df2..4d7ab0ca17 100644 --- a/fabric-commands-v0/build.gradle +++ b/fabric-commands-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-commands-v0" -version = getSubprojectVersion(project, "0.2.3") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-containers-v0/build.gradle b/fabric-containers-v0/build.gradle index 7ae73623d6..0bcec17b1c 100644 --- a/fabric-containers-v0/build.gradle +++ b/fabric-containers-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-containers-v0" -version = getSubprojectVersion(project, "0.1.14") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-content-registries-v0/build.gradle b/fabric-content-registries-v0/build.gradle index f498a2c4ec..22d90ca280 100644 --- a/fabric-content-registries-v0/build.gradle +++ b/fabric-content-registries-v0/build.gradle @@ -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") diff --git a/fabric-crash-report-info-v1/build.gradle b/fabric-crash-report-info-v1/build.gradle index 82caeed44f..1909659a61 100644 --- a/fabric-crash-report-info-v1/build.gradle +++ b/fabric-crash-report-info-v1/build.gradle @@ -1,2 +1,2 @@ archivesBaseName = "fabric-crash-report-info-v1" -version = getSubprojectVersion(project, "0.1.6") +version = getSubprojectVersion(project) diff --git a/fabric-dimensions-v1/build.gradle b/fabric-dimensions-v1/build.gradle index bec9f5e24f..0aefdd6001 100644 --- a/fabric-dimensions-v1/build.gradle +++ b/fabric-dimensions-v1/build.gradle @@ -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, [ diff --git a/fabric-dimensions-v1/src/testmod/java/net/fabricmc/fabric/test/dimension/FabricDimensionTest.java b/fabric-dimensions-v1/src/testmod/java/net/fabricmc/fabric/test/dimension/FabricDimensionTest.java index c19ba11809..9fe2294e85 100644 --- a/fabric-dimensions-v1/src/testmod/java/net/fabricmc/fabric/test/dimension/FabricDimensionTest.java +++ b/fabric-dimensions-v1/src/testmod/java/net/fabricmc/fabric/test/dimension/FabricDimensionTest.java @@ -68,6 +68,11 @@ public void onInitialize() { 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); diff --git a/fabric-entity-events-v1/build.gradle b/fabric-entity-events-v1/build.gradle index 34daf7e8c3..96cfc6fce4 100644 --- a/fabric-entity-events-v1/build.gradle +++ b/fabric-entity-events-v1/build.gradle @@ -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') } diff --git a/fabric-events-interaction-v0/build.gradle b/fabric-events-interaction-v0/build.gradle index 16cab2c019..891d6cf6f6 100644 --- a/fabric-events-interaction-v0/build.gradle +++ b/fabric-events-interaction-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-events-interaction-v0" -version = getSubprojectVersion(project, "0.4.13") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-events-lifecycle-v0/build.gradle b/fabric-events-lifecycle-v0/build.gradle index fc7c5ff693..93f914f77d 100644 --- a/fabric-events-lifecycle-v0/build.gradle +++ b/fabric-events-lifecycle-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-events-lifecycle-v0" -version = getSubprojectVersion(project, "0.2.2") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-game-rule-api-v1/build.gradle b/fabric-game-rule-api-v1/build.gradle index f55a3db03c..256c5ce763 100644 --- a/fabric-game-rule-api-v1/build.gradle +++ b/fabric-game-rule-api-v1/build.gradle @@ -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') } diff --git a/fabric-gametest-api-v1/build.gradle b/fabric-gametest-api-v1/build.gradle index da3e4a2edb..2d80d689bf 100644 --- a/fabric-gametest-api-v1/build.gradle +++ b/fabric-gametest-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-gametest-api-v1" -version = getSubprojectVersion(project, "1.0.3") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-item-api-v1/build.gradle b/fabric-item-api-v1/build.gradle index 7799d76819..692eb5ead9 100644 --- a/fabric-item-api-v1/build.gradle +++ b/fabric-item-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-item-api-v1" -version = getSubprojectVersion(project, "1.2.5") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-item-groups-v0/build.gradle b/fabric-item-groups-v0/build.gradle index 7aa9dcdc19..c83073e88f 100644 --- a/fabric-item-groups-v0/build.gradle +++ b/fabric-item-groups-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-item-groups-v0" -version = getSubprojectVersion(project, "0.3.1") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-key-binding-api-v1/build.gradle b/fabric-key-binding-api-v1/build.gradle index 1d4c913672..7b44b62cf9 100644 --- a/fabric-key-binding-api-v1/build.gradle +++ b/fabric-key-binding-api-v1/build.gradle @@ -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') } diff --git a/fabric-keybindings-v0/build.gradle b/fabric-keybindings-v0/build.gradle index 0851668014..cb060cf98d 100644 --- a/fabric-keybindings-v0/build.gradle +++ b/fabric-keybindings-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-keybindings-v0" -version = getSubprojectVersion(project, "0.2.3") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-key-binding-api-v1' diff --git a/fabric-lifecycle-events-v1/build.gradle b/fabric-lifecycle-events-v1/build.gradle index 551185c5f4..16b42c9051 100644 --- a/fabric-lifecycle-events-v1/build.gradle +++ b/fabric-lifecycle-events-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-lifecycle-events-v1" -version = getSubprojectVersion(project, "1.4.7") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-loot-tables-v1/build.gradle b/fabric-loot-tables-v1/build.gradle index 7e7051cca4..9303f46c44 100644 --- a/fabric-loot-tables-v1/build.gradle +++ b/fabric-loot-tables-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-loot-tables-v1" -version = getSubprojectVersion(project, "1.0.6") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-mining-level-api-v1/build.gradle b/fabric-mining-level-api-v1/build.gradle index f46187cc77..e4d63320fa 100644 --- a/fabric-mining-level-api-v1/build.gradle +++ b/fabric-mining-level-api-v1/build.gradle @@ -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') } diff --git a/fabric-mining-levels-v0/build.gradle b/fabric-mining-levels-v0/build.gradle index 545b51ebd1..b9d19b94ac 100644 --- a/fabric-mining-levels-v0/build.gradle +++ b/fabric-mining-levels-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-mining-levels-v0" -version = getSubprojectVersion(project, "0.1.4") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-models-v0/build.gradle b/fabric-models-v0/build.gradle index 44f4c72bc4..2a5dd55e8d 100644 --- a/fabric-models-v0/build.gradle +++ b/fabric-models-v0/build.gradle @@ -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') } diff --git a/fabric-networking-api-v1/build.gradle b/fabric-networking-api-v1/build.gradle index f2cd097aa5..14afa4dc9e 100644 --- a/fabric-networking-api-v1/build.gradle +++ b/fabric-networking-api-v1/build.gradle @@ -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') } diff --git a/fabric-networking-v0/build.gradle b/fabric-networking-v0/build.gradle index f0f71a0a6b..b7f35ca7b2 100644 --- a/fabric-networking-v0/build.gradle +++ b/fabric-networking-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-networking-v0" -version = getSubprojectVersion(project, "0.3.3") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-object-builder-api-v1/build.gradle b/fabric-object-builder-api-v1/build.gradle index ecb3c7af75..d814b477ec 100644 --- a/fabric-object-builder-api-v1/build.gradle +++ b/fabric-object-builder-api-v1/build.gradle @@ -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, [ diff --git a/fabric-object-builders-v0/build.gradle b/fabric-object-builders-v0/build.gradle index f73e9fdc45..8b1e8a4cbb 100644 --- a/fabric-object-builders-v0/build.gradle +++ b/fabric-object-builders-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-object-builders" -version = getSubprojectVersion(project, "0.7.4") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-particles-v1/build.gradle b/fabric-particles-v1/build.gradle index cf51af61e5..f8beb79947 100644 --- a/fabric-particles-v1/build.gradle +++ b/fabric-particles-v1/build.gradle @@ -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") diff --git a/fabric-registry-sync-v0/build.gradle b/fabric-registry-sync-v0/build.gradle index 8529268b46..8f2bdc1fe4 100644 --- a/fabric-registry-sync-v0/build.gradle +++ b/fabric-registry-sync-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-registry-sync-v0" -version = getSubprojectVersion(project, "0.8.3") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-renderer-api-v1/build.gradle b/fabric-renderer-api-v1/build.gradle index 8342be6f0f..e58f5c3004 100644 --- a/fabric-renderer-api-v1/build.gradle +++ b/fabric-renderer-api-v1/build.gradle @@ -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') } diff --git a/fabric-renderer-indigo/build.gradle b/fabric-renderer-indigo/build.gradle index b3ef7d949a..11e18c8156 100644 --- a/fabric-renderer-indigo/build.gradle +++ b/fabric-renderer-indigo/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-renderer-indigo" -version = getSubprojectVersion(project, "0.4.10") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-renderer-registries-v1/build.gradle b/fabric-renderer-registries-v1/build.gradle index edd9038e28..36807df7e7 100644 --- a/fabric-renderer-registries-v1/build.gradle +++ b/fabric-renderer-registries-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-renderer-registries-v1" -version = getSubprojectVersion(project, "3.2.5") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-rendering-data-attachment-v1/build.gradle b/fabric-rendering-data-attachment-v1/build.gradle index 3b5e07cc28..f8b123d46d 100644 --- a/fabric-rendering-data-attachment-v1/build.gradle +++ b/fabric-rendering-data-attachment-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-rendering-data-attachment-v1" -version = getSubprojectVersion(project, "0.2.1") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-rendering-fluids-v1/build.gradle b/fabric-rendering-fluids-v1/build.gradle index ab9dc63687..583bb42f09 100644 --- a/fabric-rendering-fluids-v1/build.gradle +++ b/fabric-rendering-fluids-v1/build.gradle @@ -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') } diff --git a/fabric-rendering-v0/build.gradle b/fabric-rendering-v0/build.gradle index a35302c7a0..7a3d8232b3 100644 --- a/fabric-rendering-v0/build.gradle +++ b/fabric-rendering-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-rendering-v0" -version = getSubprojectVersion(project, "1.1.7") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base', diff --git a/fabric-rendering-v1/build.gradle b/fabric-rendering-v1/build.gradle index 4f708f5f8b..3cbec3aae7 100644 --- a/fabric-rendering-v1/build.gradle +++ b/fabric-rendering-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-rendering-v1" -version = getSubprojectVersion(project, "1.10.1") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-resource-loader-v0/build.gradle b/fabric-resource-loader-v0/build.gradle index bded20bad4..c4adf0e9b6 100644 --- a/fabric-resource-loader-v0/build.gradle +++ b/fabric-resource-loader-v0/build.gradle @@ -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') } diff --git a/fabric-screen-api-v1/build.gradle b/fabric-screen-api-v1/build.gradle index 5d487f7bce..82b934a000 100644 --- a/fabric-screen-api-v1/build.gradle +++ b/fabric-screen-api-v1/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-screen-api-v1" -version = getSubprojectVersion(project, "1.0.5") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-screen-handler-api-v1/build.gradle b/fabric-screen-handler-api-v1/build.gradle index 015305ccbd..cd060ba94d 100644 --- a/fabric-screen-handler-api-v1/build.gradle +++ b/fabric-screen-handler-api-v1/build.gradle @@ -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, [ diff --git a/fabric-structure-api-v1/build.gradle b/fabric-structure-api-v1/build.gradle index 445e93b515..95c2e76953 100644 --- a/fabric-structure-api-v1/build.gradle +++ b/fabric-structure-api-v1/build.gradle @@ -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' diff --git a/fabric-tag-extensions-v0/build.gradle b/fabric-tag-extensions-v0/build.gradle index 4ece7ce2f0..ac1e923320 100644 --- a/fabric-tag-extensions-v0/build.gradle +++ b/fabric-tag-extensions-v0/build.gradle @@ -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') } diff --git a/fabric-textures-v0/build.gradle b/fabric-textures-v0/build.gradle index 8c01059e1c..5264d54bd2 100644 --- a/fabric-textures-v0/build.gradle +++ b/fabric-textures-v0/build.gradle @@ -1,5 +1,5 @@ archivesBaseName = "fabric-textures-v0" -version = getSubprojectVersion(project, "1.0.7") +version = getSubprojectVersion(project) moduleDependencies(project, [ 'fabric-api-base' diff --git a/fabric-tool-attribute-api-v1/build.gradle b/fabric-tool-attribute-api-v1/build.gradle index 4ccac4ccae..08f02c4800 100644 --- a/fabric-tool-attribute-api-v1/build.gradle +++ b/fabric-tool-attribute-api-v1/build.gradle @@ -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, [ diff --git a/fabric-transfer-api-v1/build.gradle b/fabric-transfer-api-v1/build.gradle index b37878aefe..bfa13e02fd 100644 --- a/fabric-transfer-api-v1/build.gradle +++ b/fabric-transfer-api-v1/build.gradle @@ -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') } diff --git a/gradle.properties b/gradle.properties index 3ad283407e..69a465a389 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/module-versioning.gradle b/gradle/module-versioning.gradle new file mode 100644 index 0000000000..c1752bd779 --- /dev/null +++ b/gradle/module-versioning.gradle @@ -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 + } +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023..7454180f2a 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a254e..e750102e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/gradlew b/gradlew index 4f906e0c81..c53aefaa5f 100755 --- a/gradlew +++ b/gradlew @@ -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 +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 -# 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 +# 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. # 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 +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 - 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\"" + 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 - i=`expr $i + 1` + # 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 - 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" ;; - 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; +# * $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. +# -# 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" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@"