diff options
author | bombcar <github@bombcar.com> | 2022-01-04 12:08:07 -0600 |
---|---|---|
committer | bombcar <github@bombcar.com> | 2022-01-04 12:08:07 -0600 |
commit | a19a1f0dc03088ed00e128f79225f65431e768b6 (patch) | |
tree | c52e434bb5158c8539e89dce0b6f20e7e7e1b416 /build.gradle | |
parent | 57208a027190813b5fd93f1ed4f17334b3fb3083 (diff) | |
download | GT5-Unofficial-a19a1f0dc03088ed00e128f79225f65431e768b6.tar.gz GT5-Unofficial-a19a1f0dc03088ed00e128f79225f65431e768b6.tar.bz2 GT5-Unofficial-a19a1f0dc03088ed00e128f79225f65431e768b6.zip |
update buildscript
Diffstat (limited to 'build.gradle')
-rw-r--r-- | build.gradle | 82 |
1 files changed, 54 insertions, 28 deletions
diff --git a/build.gradle b/build.gradle index 2ec9a2ebac..43dfa37748 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: be36e1399d5622c152db7c530c48e17cde0ce1bb +//version: 8fa7883b6196c1765266f4e6ddf3118d5043aafb /* DO NOT CHANGE THIS FILE! @@ -195,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 { @@ -261,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()) } @@ -344,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 = [:] @@ -401,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") @@ -409,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) { @@ -424,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") @@ -469,7 +495,7 @@ publishing { artifact source: sourcesJar, classifier: "src" artifact source: devJar, classifier: "dev" if (apiPackage) { - archives source: apiJar, classifier: "api" + artifact source: apiJar, classifier: "api" } groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group |