diff --git a/build.gradle b/build.gradle index 5f9fbcc12..3eeb3c3a8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,37 +1,60 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - -archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group +def ENV = System.getenv() + +base { + archivesName = project.archives_base_name +} + repositories { + + mavenLocal() + mavenCentral() + + exclusiveContent { + + forRepository { + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + } + + filter { + includeGroup "maven.modrinth" + } + + } maven { - name = "Ladysnake Libs" - url = 'https://ladysnake.jfrog.io/artifactory/mods' + name = "Ladysnake Mods (Releases)" + url = "https://maven.ladysnake.org/releases" } maven { - name = "JitPack" - url = 'https://jitpack.io' + name = "Ladysnake Mods (Snapshots)" + url = "https://maven.ladysnake.org/snapshots" } maven { - url = 'https://maven.cafeteria.dev' + url = "https://maven.cafeteria.dev" content { - includeGroup 'net.adriantodt.fabricmc' + includeGroup "net.adriantodt.fabricmc" } } maven { - url "https://maven.shedaniel.me/" + url "https://maven.shedaniel.me" } maven { - url "https://maven.terraformersmc.com/" + url "https://maven.terraformersmc.com" + } + maven { + name = "JitPack" + url = 'https://jitpack.io' } - mavenLocal() } loom { @@ -49,29 +72,26 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" - include "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" + // Cardinal Components API + include(modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}")) + include(modApi("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}")) - modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" - include "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" + // PlayerAbilityLib + include(modApi("io.github.ladysnake:PlayerAbilityLib:${pal_version}")) - modImplementation "io.github.ladysnake:PlayerAbilityLib:${pal_version}" - include "io.github.ladysnake:PlayerAbilityLib:${pal_version}" + // Calio + include(modApi("io.github.apace100:calio:${project.calio_version}")) - modImplementation "com.github.apace100:calio:${project.calio_version}" - include "com.github.apace100:calio:${project.calio_version}" - - modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") { + // Cloth Config + include(modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}")) { exclude(group: "net.fabricmc.fabric-api") } - include "me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}" - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" + // Mod Menu + modImplementation("com.terraformersmc:modmenu:${project.modmenu_version}") - modImplementation "com.github.DaFuqs:AdditionalEntityAttributes:${project.aea_version}" - include "com.github.DaFuqs:AdditionalEntityAttributes:${project.aea_version}" - // modImplementation "de.dafuqs:AdditionalEntityAttributes:${project.aea_version}" - // include "de.dafuqs:AdditionalEntityAttributes:${project.aea_version}" + // Additional Entity Attributes + include(modImplementation("maven.modrinth:AdditionalEntityAttributes:${project.aea_version}")) } processResources { @@ -81,9 +101,10 @@ processResources { expand "version": project.version } - def environment = System.getenv("ENVIRONMENT"); - if (environment != "production") { - from(rootProject.rootDir.absolutePath + "/testdata") { into 'data' } + if (ENV.ENVIRONMENT != "production") { + from(rootProject.rootDir.absolutePath + "/testdata") { + into "data" + } } } @@ -108,25 +129,22 @@ java { // if it is present. // If you remove this line, sources will not be generated. withSourcesJar() + + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} + rename { "${it}_${project.base.archivesName.get()}"} } } // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } + create("mavenJava", MavenPublication) { + from components.java } } @@ -137,5 +155,14 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. mavenLocal() + if (ENV.MAVEN_URL && ENV.MAVEN_USERNAME && ENV.MAVEN_PASSWORD) { + maven { + url = ENV.MAVEN_URL + credentials { + username = ENV.MAVEN_USERNAME + password = ENV.MAVEN_PASSWORD + } + } + } } } diff --git a/gradle.properties b/gradle.properties index 7f31395b6..556b06518 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,22 +1,23 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G +org.gradle.parallel=true # Fabric Properties minecraft_version=1.19.2 yarn_mappings=1.19.2+build.9 - loader_version=0.14.9 + loader_version=0.15.11 # Mod Properties - mod_version = 2.6.1 - maven_group = com.github.apace100 - archives_base_name = Apoli-1.19.2 + mod_version = 2.6.1+mc.1.19.2 + maven_group = io.github.apace100 + archives_base_name = Apoli # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api fabric_version=0.60.0+1.19.2 cca_version=5.0.1 pal_version=1.6.0 - calio_version=v1.7.0 + calio_version=1.7.0+mc.1.19.x clothconfig_version=8.0.75 modmenu_version=4.0.5 - aea_version=95f13798d1 + aea_version=1.2.0+1.19.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e0..b82aa23a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index f91a4fe7e..b02216baa 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,7 @@ pluginManagement { name = 'Fabric' url = 'https://maven.fabricmc.net/' } + mavenCentral() gradlePluginPortal() } }