Skip to content

Commit

Permalink
Github jar release upload fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stormwind99 committed Aug 12, 2018
1 parent b3fd7ac commit df4e274
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ publishing {
artifactId = config.mod_id
version = config.version

//from components.java
from components.java
artifact sourceJar
}
}
}
Expand Down Expand Up @@ -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"
Expand All @@ -274,6 +275,11 @@ jar {
)
}

artifacts {
// archives deobfJar
archives jar
}

// --------------------------------------------------------------------------
// Local functions

Expand All @@ -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())
}

// --------------------------------------------------------------------------
Expand Down Expand Up @@ -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'

0 comments on commit df4e274

Please sign in to comment.