From df4e274acbd632540b688ee3583b47920e57d5e2 Mon Sep 17 00:00:00 2001 From: Jason Spangler Date: Sat, 11 Aug 2018 23:24:25 -0500 Subject: [PATCH] Github jar release upload fix --- build.gradle | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index a8a9340..5f55b7c 100755 --- a/build.gradle +++ b/build.gradle @@ -117,7 +117,8 @@ publishing { artifactId = config.mod_id version = config.version - //from components.java + from components.java + artifact sourceJar } } } @@ -259,7 +260,7 @@ processResources { jar { classifier = "" //rename the default output, for some better sanity with scripts - archiveName = "${baseName}-${minecraft.version}-${version}.${extension}" + archiveName = getArchiveName(baseName, version, extension) exclude "**/*.bat" exclude "**/*.psd" @@ -274,6 +275,11 @@ jar { ) } +artifacts { +// archives deobfJar + archives jar +} + // -------------------------------------------------------------------------- // Local functions @@ -298,10 +304,18 @@ def getChangeInfo() { return info } +def getArchiveName(baseName, version, extension) { + return new String("${baseName}-${minecraft.version}-${version}.${extension}") +} + +def getArchiveName() { + return getArchiveName(config.mod_id, config.version, "jar") +} + // build our own archive path that is relative and unix-format // since jar.archivePath is Windows format absolute path and github plugin makes ugly Github release asset file name from it def getArchivePath() { - return new String("build/libs/${jar.archiveName}") + return new String("build/libs/"+getArchiveName()) } // -------------------------------------------------------------------------- @@ -432,11 +446,9 @@ build { // make build tasks run before publish, otherwise could upload MCP mapped jar instead of SRG mapped jar! tasks.publish.dependsOn build tasks.publishMavenPublicationToMavenLocal.dependsOn build +tasks.publishMavenPublicationToMavenLocal.dependsOn publish tasks.githubRelease.dependsOn build tasks.bintrayUpload.dependsOn build tasks.curseforge.dependsOn build -/// Uploads - - defaultTasks 'build'