@@ -34,9 +34,10 @@ dependencies {
3434}
3535
3636// Mod version
37- version = ext. modversion = " 3.0.7 "
37+ version = ext. modversion = " 3.0.8 "
3838boolean isBeta = false
3939group = " org.dimdev.dimdoors"
40+ archivesBaseName = " DimensionalDoors"
4041
4142// Build number
4243String fullVersion = version
@@ -48,10 +49,7 @@ if (System.getenv("TRAVIS_BUILD_NUMBER") != null) {
4849if (isBeta) {
4950 fullVersion + = " -b"
5051}
51-
52- // Jar name format
53- archivesBaseName = " DimensionalDoors"
54- jar. archiveName = " DimensionalDoors-" + fullVersion + " .jar" // Constant name for travis
52+ String jarVersion = fullVersion. replace(" +" , " -" ) // Github/Travis doesn't seem to support + in filenames
5553
5654// Minecraft, MCP, Forge, and Java versions
5755sourceCompatibility = targetCompatibility = " 1.8"
@@ -64,7 +62,7 @@ minecraft {
6462 runDir = " run"
6563 mappings = mcpversion
6664 replace ' ${version}' , fullVersion
67- makeObfSourceJar = false // Unobfuscated sources jar
65+ makeObfSourceJar = false
6866}
6967
7068// Tasks
@@ -73,22 +71,33 @@ compileJava {
7371}
7472
7573jar {
74+ archiveName = archivesBaseName + " -" + jarVersion + " .jar"
7675 from configurations. embed. collect { it. isDirectory() ? it : zipTree(it) }
7776}
7877
78+ task sourcesJar (type : Jar , dependsOn : classes) {
79+ archiveName = archivesBaseName + " -" + jarVersion + " -sources.jar"
80+ classifier = ' sources'
81+ from sourceSets. main. allSource
82+ }
83+
84+ artifacts {
85+ archives sourcesJar
86+ }
87+
7988processResources {
80- // this will ensure that this task is redone when the versions change.
89+ // This will ensure that this task is redone when the versions change.
8190 inputs. property " version" , project. version
8291 inputs. property " mcversion" , project. minecraft. version
8392
84- // replace stuff in mcmod.info, nothing else
93+ // Replace stuff in mcmod.info, nothing else
8594 from(sourceSets. main. resources. srcDirs) {
8695 include ' mcmod.info'
8796 // replace version and mcversion
8897 expand ' version' : project. version, ' mcversion' : project. minecraft. version
8998 }
9099
91- // copy everything else, thats not the mcmod.info
100+ // Copy everything else except mcmod.info
92101 from(sourceSets. main. resources. srcDirs) {
93102 exclude ' mcmod.info'
94103 }
0 commit comments