mirror of
https://github.com/GTNewHorizons/BloodArsenal.git
synced 2026-11-18 19:39:14 +00:00
Merge pull request #4 from TehNut/master
Update build scripts for Jenkins+Maven
This commit is contained in:
commit
ec6ff0d16f
3 files changed
+39
-30
No files matched your search
+36
-28
@@ -11,17 +11,16 @@ buildscript {
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
ext.configFile = file "build.properties"
|
||||
configFile.withReader {
|
||||
def prop = new Properties()
|
||||
prop.load(it)
|
||||
project.ext.config = new ConfigSlurper().parse prop
|
||||
}
|
||||
def build_number = 'CUSTOM'
|
||||
|
||||
version = config.mc_version + "-" + config.mod_version + "-" + config.build_number
|
||||
group= config.package_group
|
||||
archivesBaseName = config.mod_name
|
||||
if (System.getenv('BUILD_NUMBER') != null)
|
||||
build_number = System.getenv('BUILD_NUMBER')
|
||||
|
||||
group = package_group
|
||||
archivesBaseName = mod_name
|
||||
version = "${mc_version}-${mod_version}-${build_number}"
|
||||
|
||||
import org.ajoberstar.grgit.Grgit
|
||||
|
||||
@@ -31,8 +30,16 @@ if (new File(projectDir, '.git').exists()) {
|
||||
gitHash = repo.log().find().abbreviatedId
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = config.mc_version + "-" + config.forge_version
|
||||
version = "${mc_version}-${forge_version}"
|
||||
runDir = "run"
|
||||
|
||||
if (project.hasProperty('mappings_version'))
|
||||
@@ -52,13 +59,11 @@ processResources {
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude '**/*.info'
|
||||
exclude '**/*.properties'
|
||||
exclude '**/*.db'
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
dependsOn "incrementBuildNumber"
|
||||
classifier = ''
|
||||
classifier = ''
|
||||
manifest.mainAttributes(
|
||||
"Built-By": System.getProperty('user.name'),
|
||||
"Created-By": "${System.getProperty('java.vm.version')} + (${System.getProperty('java.vm.vendor')})",
|
||||
@@ -92,18 +97,21 @@ tasks.withType(JavaCompile) { task ->
|
||||
task.options.encoding = 'UTF-8'
|
||||
}
|
||||
|
||||
task("incrementBuildNumber") {
|
||||
// increment build number
|
||||
doFirst {
|
||||
// increment
|
||||
config.build_number = (config.build_number.toString().toInteger()) + 1
|
||||
|
||||
// write back to the file
|
||||
configFile.withWriter {
|
||||
config.toProperties().store(it, "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Uncomment this line if you want to auto-upload to CurseForge when you build. This requires you to setup curse.gradle yourself.
|
||||
// fileTree('gradle').include('curse.gradle').collect().sort().each { apply from: it }
|
||||
publishing {
|
||||
tasks.publish.dependsOn 'build'
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
artifact sourceJar
|
||||
artifact javadocJar
|
||||
artifact deobfJar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
if (project.hasProperty('maven_repo')) {
|
||||
maven { url maven_repo }
|
||||
} else {
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
mod_name=BloodArsenal
|
||||
package_group=com.arc.bloodarsenal
|
||||
mod_version=1.0.0
|
||||
package_group=com.arc.bloodarsenal
|
||||
|
||||
mc_version=1.7.10
|
||||
forge_version=10.13.2.1232
|
||||
build_number=1
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = 'BloodArsenal'
|
||||
Reference in new issue
Block a user