aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-27 02:50:29 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2021-12-27 02:50:29 +0000
commit6e8a40242fcd7fd85a99009e5bc626972c8fa0d8 (patch)
tree6fb4a45cf17dd22748148417bc7bb0efb850cea3 /build.gradle
parentef8ac539395ce5067edfcf1b8a98ae746c476fc1 (diff)
downloadGT5-Unofficial-6e8a40242fcd7fd85a99009e5bc626972c8fa0d8.tar.gz
GT5-Unofficial-6e8a40242fcd7fd85a99009e5bc626972c8fa0d8.tar.bz2
GT5-Unofficial-6e8a40242fcd7fd85a99009e5bc626972c8fa0d8.zip
Updated Build Script.
Fixed Volumetric Flask Configurator not working. Fixed recipe for Reservoir Hatch.
Diffstat (limited to 'build.gradle')
-rw-r--r--build.gradle113
1 files changed, 86 insertions, 27 deletions
diff --git a/build.gradle b/build.gradle
index 18fedd355e..43dfa37748 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428
+//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb
/*
DO NOT CHANGE THIS FILE!
@@ -42,6 +42,7 @@ plugins {
id("org.ajoberstar.grgit") version("3.1.1")
id("com.github.johnrengelman.shadow") version("4.0.4")
id("com.palantir.git-version") version("0.12.3")
+ id("maven-publish")
}
apply plugin: 'forge'
@@ -194,7 +195,9 @@ if(file("addon.gradle").exists()) {
apply from: 'repositories.gradle'
configurations {
- implementation.extendsFrom(shadowImplementation)
+ implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored
+ implementation.extendsFrom(shadowCompile)
+ implementation.extendsFrom(shadeCompile)
}
repositories {
@@ -260,16 +263,28 @@ task relocateShadowJar(type: ConfigureShadowRelocation) {
}
shadowJar {
+ project.configurations.shadeCompile.each { dep ->
+ from(project.zipTree(dep)) {
+ exclude 'META-INF', 'META-INF/**'
+ }
+ }
+
manifest {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
- configurations = [project.configurations.shadowImplementation]
+ configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
dependsOn(relocateShadowJar)
}
jar {
+ project.configurations.shadeCompile.each { dep ->
+ from(project.zipTree(dep)) {
+ exclude 'META-INF', 'META-INF/**'
+ }
+ }
+
manifest {
attributes(getManifestAttributes())
}
@@ -343,31 +358,31 @@ tasks.withType(JavaExec).configureEach {
}
processResources
- {
- // this will ensure that this task is redone when the versions change.
- inputs.property "version", project.version
- inputs.property "mcversion", project.minecraft.version
-
- // replace stuff in mcmod.info, nothing else
- from(sourceSets.main.resources.srcDirs) {
- include 'mcmod.info'
-
- // replace version and mcversion
- expand "minecraftVersion": project.minecraft.version,
- "modVersion": versionDetails().lastTag,
- "modId": modId,
- "modName": modName
- }
+{
+ // this will ensure that this task is redone when the versions change.
+ inputs.property "version", project.version
+ inputs.property "mcversion", project.minecraft.version
- if(usesMixins.toBoolean()) {
- from refMap
- }
+ // replace stuff in mcmod.info, nothing else
+ from(sourceSets.main.resources.srcDirs) {
+ include 'mcmod.info'
- // copy everything else, thats not the mcmod.info
- from(sourceSets.main.resources.srcDirs) {
- exclude 'mcmod.info'
- }
- }
+ // replace version and mcversion
+ expand "minecraftVersion": project.minecraft.version,
+ "modVersion": versionDetails().lastTag,
+ "modId": modId,
+ "modName": modName
+ }
+
+ if(usesMixins.toBoolean()) {
+ from refMap
+ }
+
+ // copy everything else, thats not the mcmod.info
+ from(sourceSets.main.resources.srcDirs) {
+ exclude 'mcmod.info'
+ }
+}
def getManifestAttributes() {
def manifestAttributes = [:]
@@ -400,6 +415,12 @@ task sourcesJar(type: Jar) {
}
task shadowDevJar(type: ShadowJar) {
+ project.configurations.shadeCompile.each { dep ->
+ from(project.zipTree(dep)) {
+ exclude 'META-INF', 'META-INF/**'
+ }
+ }
+
from sourceSets.main.output
getArchiveClassifier().set("dev")
@@ -408,7 +429,7 @@ task shadowDevJar(type: ShadowJar) {
}
minimize() // This will only allow shading for actually used classes
- configurations = [project.configurations.shadowImplementation]
+ configurations = [project.configurations.shadowImplementation, project.configurations.shadowCompile]
}
task relocateShadowDevJar(type: ConfigureShadowRelocation) {
@@ -423,6 +444,12 @@ task circularResolverJar(type: Jar) {
}
task devJar(type: Jar) {
+ project.configurations.shadeCompile.each { dep ->
+ from(project.zipTree(dep)) {
+ exclude 'META-INF', 'META-INF/**'
+ }
+ }
+
from sourceSets.main.output
getArchiveClassifier().set("dev")
@@ -460,6 +487,38 @@ artifacts {
}
}
+// publishing
+publishing {
+ publications {
+ maven(MavenPublication) {
+ artifact source: jar
+ artifact source: sourcesJar, classifier: "src"
+ artifact source: devJar, classifier: "dev"
+ if (apiPackage) {
+ artifact source: apiJar, classifier: "api"
+ }
+
+ groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group
+ artifactId = System.getenv("ARTIFACT_ID") ?: project.name
+ version = System.getenv("ARTIFACT_VERSION") ?: project.version
+ }
+ }
+
+ repositories {
+ maven {
+ String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown"
+ String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown"
+ String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName"
+ name = "GitHubPackages"
+ url = githubRepositoryUrl
+ credentials {
+ username = System.getenv("GITHUB_ACTOR") ?: "NONE"
+ password = System.getenv("GITHUB_TOKEN") ?: "NONE"
+ }
+ }
+ }
+}
+
// Updating
task updateBuildScript {
doLast {