From cf0743435ed60e74214eb5caf55092117afbe686 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sat, 9 Dec 2023 17:08:47 +0100 Subject: [PATCH] update gradle update deps sa remove not use action scripts --- .github/workflows/buildscript-maintenance.yml | 39 --------- .github/workflows/release-packages.yml | 86 ------------------- build.gradle | 30 ++----- dependencies.gradle | 4 +- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/java/com/colen/postea/Postea.java | 22 +++-- 6 files changed, 24 insertions(+), 159 deletions(-) delete mode 100644 .github/workflows/buildscript-maintenance.yml delete mode 100644 .github/workflows/release-packages.yml diff --git a/.github/workflows/buildscript-maintenance.yml b/.github/workflows/buildscript-maintenance.yml deleted file mode 100644 index a9d5486..0000000 --- a/.github/workflows/buildscript-maintenance.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This workflow only meant for the source mod you shouldn't bring it into your own project - -name: Buildscript maintenance - -on: - push: - branches: [ master, main ] - paths: - - build.gradle - workflow_dispatch: { } - -jobs: - buildscript-maintenance: - runs-on: ubuntu-latest - # Avoid running this workflow on forks - if: github.repository == 'GTNewHorizons/ExampleMod1.7.10' - permissions: - contents: write - pull-requests: write - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Ensure build script version is up to date - id: update-buildscript - run: | - new_version="$(date +%s)" - sed --in-place "1s!^//version:.*!//version: $new_version!g" build.gradle - echo "::set-output name=new_version::$new_version" - - - name: Create Pull Request - id: create-pull-request - uses: peter-evans/create-pull-request@v4 - with: - add-paths: build.gradle - commit-message: '[ci skip] update build script version to ${{ steps.update-buildscript.outputs.new_version }}' - branch: buildscript-maintenance - title: Update build script version to ${{ steps.update-buildscript.outputs.new_version }} - body: This pull request is created by the buildscript-maintenance workflow diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml deleted file mode 100644 index 9a1f6bc..0000000 --- a/.github/workflows/release-packages.yml +++ /dev/null @@ -1,86 +0,0 @@ -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release latest starter and migration packages - -on: - push: - branches: [ master, main ] - tags: [ '*' ] - -jobs: - zip-and-release-packages: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set release version - run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - - name: Prepare release folder - run: | - mkdir packages - - - name: Zip starter - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/starter.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update_version" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages.yml" \ - \ - -x "*docs/*" \ - -x "README.md" \ - -x "LICENSE" \ - -x "gtnhShared/*" \ - \ - -x "packages/" \ - -x "packages/starter.zip" \ - -x "packages/migration.zip" - - - name: Zip migration - uses: montudor/action-zip@v1 - with: - args: > - zip -r packages/migration.zip . \ - \ - -x "*.git/*" \ - \ - -x ".github/scripts/update_version" \ - -x ".github/workflows/buildscript-maintenance.yml" \ - -x ".github/workflows/release-packages.yml" \ - \ - -x "*docs/*" \ - -x "*src/*" \ - -x "LICENSE" \ - -x "README.md" \ - -x "gtnhShared/*" \ - \ - -x "packages/" \ - -x "packages/starter.zip" \ - -x "packages/migration.zip" - - - name: Update latest tag - uses: "marvinpinto/action-automatic-releases@latest" - if: ${{ (github.ref == 'master' || github.ref == 'main') }} - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-packages" - prerelease: true - title: "Latest starter and migration packages" - files: packages/* - - - name: Release named version - if: ${{ !(github.ref == 'master' || github.ref == 'main') }} - uses: "marvinpinto/action-automatic-releases@latest" - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "${{ env.RELEASE_VERSION }}-packages" - prerelease: false - title: "${{ env.RELEASE_VERSION }} starter and migration packages" - files: packages/* diff --git a/build.gradle b/build.gradle index e59189c..8507c7d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1697697256 +//version: 1701530445 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit buildscript { repositories { - mavenCentral() - - maven { - name 'forge' - url 'https://maven.minecraftforge.net' - } maven { // GTNH RetroFuturaGradle and ASM Fork name "GTNH Maven" url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" allowInsecureProtocol = true } - maven { - name 'sonatype' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - maven { - name 'Scala CI dependencies' - url 'https://repo1.maven.org/maven2/' - } - mavenLocal() } } @@ -302,7 +287,7 @@ if (apiPackage) { } if (accessTransformersFile) { - for (atFile in accessTransformersFile.split(",")) { + for (atFile in accessTransformersFile.split(" ")) { String targetFile = "src/main/resources/META-INF/" + atFile.trim() if (!getFile(targetFile).exists()) { throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile) @@ -646,7 +631,7 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.7.1" +def mixinProviderVersion = "0.1.13" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" ext.mixinProviderSpec = mixinProviderSpec @@ -793,12 +778,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies" } dependencies { - def lwjgl3ifyVersion = '1.5.1' + def lwjgl3ifyVersion = '1.5.7' if (modId != 'lwjgl3ify') { java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") } if (modId != 'hodgepodge') { - java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17') + java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35') } java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} @@ -1187,9 +1172,8 @@ publishing { version = System.getenv("RELEASE_VERSION") ?: identifiedVersion } } - repositories { - if (usesMavenPublishing.toBoolean()) { + if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { maven { url = mavenPublishUrl allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven @@ -1311,7 +1295,7 @@ def addCurseForgeRelation(String type, String name) { // Updating -def buildscriptGradleVersion = "8.2.1" +def buildscriptGradleVersion = "8.5" tasks.named('wrapper', Wrapper).configure { gradleVersion = buildscriptGradleVersion diff --git a/dependencies.gradle b/dependencies.gradle index d0661df..6348326 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -35,6 +35,6 @@ */ dependencies { // api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") -// api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.71:dev') - api('com.github.GTNewHorizons:NotEnoughIds:1.4.6:dev') +// api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.104:dev') + api('com.github.GTNewHorizons:NotEnoughIds:1.5.3:dev') } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d..1af9e09 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/com/colen/postea/Postea.java b/src/main/java/com/colen/postea/Postea.java index 1afb0f7..f707399 100644 --- a/src/main/java/com/colen/postea/Postea.java +++ b/src/main/java/com/colen/postea/Postea.java @@ -1,15 +1,17 @@ package com.colen.postea; +import java.util.function.Function; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; + import com.colen.postea.API.BlockReplacementManager; import com.colen.postea.Utility.BlockConversionInfo; + import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.ModContainer; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; - -import java.util.function.Function; @Mod(modid = Tags.MODID, version = Tags.VERSION, name = Tags.MODNAME, acceptedMinecraftVersions = "[1.7.10]") @SuppressWarnings("unused") @@ -18,7 +20,8 @@ public class Postea { @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - ModContainer activeMod = Loader.instance().activeModContainer(); + ModContainer activeMod = Loader.instance() + .activeModContainer(); String modID = activeMod.getModId(); String v = activeMod.getVersion(); @@ -26,13 +29,15 @@ public class Postea { BlockConversionInfo blockConversionInfoNew = new BlockConversionInfo(); - if ((blockConversionInfoOld.x == -1) && (blockConversionInfoOld.y == 3) && (blockConversionInfoOld.z == -1)) { + if ((blockConversionInfoOld.x == -1) && (blockConversionInfoOld.y == 3) + && (blockConversionInfoOld.z == -1)) { blockConversionInfoNew.blockID = Block.getIdFromBlock(Blocks.wool); blockConversionInfoNew.metadata = 1; return blockConversionInfoNew; } - if ((blockConversionInfoOld.x == -1) && (blockConversionInfoOld.y == 3) && (blockConversionInfoOld.z == 1)) { + if ((blockConversionInfoOld.x == -1) && (blockConversionInfoOld.y == 3) + && (blockConversionInfoOld.z == 1)) { blockConversionInfoNew.blockID = Block.getIdFromBlock(Blocks.wool); blockConversionInfoNew.metadata = 1; return blockConversionInfoNew; @@ -44,7 +49,8 @@ public class Postea { return blockConversionInfoNew; } - if ((blockConversionInfoOld.x == 1) && (blockConversionInfoOld.y == 3) && (blockConversionInfoOld.z == -1)) { + if ((blockConversionInfoOld.x == 1) && (blockConversionInfoOld.y == 3) + && (blockConversionInfoOld.z == -1)) { blockConversionInfoNew.blockID = Block.getIdFromBlock(Blocks.wool); blockConversionInfoNew.metadata = 1; return blockConversionInfoNew;