forked from ldtteam/minecolonies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
136 lines (108 loc) · 3.23 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
buildscript {
repositories {
jcenter()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
}
}
plugins {
id "org.sonarqube" version "2.1-rc3"
}
sonarqube {
properties{
property "sonar.host.url", "http://home.kk-sc.de:9000"
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectName", "Minecolonies"
property "sonar.branch", System.getenv()['TRAVIS_BRANCH'] != null ? System.getenv()['TRAVIS_BRANCH'] : System.getenv()['bamboo_repository_branch_name']
}
}
apply plugin: 'net.minecraftforge.gradle.forge'
apply plugin: 'jacoco'
jacocoTestReport {
reports {
xml.enabled true
}
}
dependencies {
testCompile 'junit:junit:4.11'
testCompile "org.mockito:mockito-core:1.+"
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.6.5'
testCompile group: 'org.powermock', name: 'powermock-api-mockito', version: '1.6.5'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
compile 'com.intellij:annotations:+@jar'
}
ext.configFile = file "build.properties"
configFile.withReader {
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
group = "com.minecolonies"
config.buildnumber = System.getenv()['TRAVIS_BUILD_NUMBER'] != null ? System.getenv()['TRAVIS_BUILD_NUMBER'] : "${config.minecolonies_build}"
version = "${config.minecraft_version}-${config.minecolonies_major}.${config.minecolonies_minor}.${config.buildnumber}"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
minecraft {
version = config.minecraft_version + "-" + config.forge_version
runDir = "run"
mappings = "${config.minecolonies_mappings}"
replace "@VERSION@", project.version
replaceIn "lib/Constants.java"
if (project.hasProperty("signature"))
replace "@FINGERPRINT@", signature
}
processResources {
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint"
}
//task sourceJar(type: Jar) {
// from sourceSets.main.allSource
// appendix = 'src'
//}
task deobfJar(type: Jar) {
from sourceSets.main.output
appendix = 'deobf'
}
task incrementBuildNumber() {
dependsOn "reobf"
doLast {
config.minecolonies_build = (config.minecolonies_build.toString().toInteger()) + 1
configFile.withWriter {
config.toProperties().store(it, "")
}
}
}
jar {
appendix = 'universal'
archiveName = "minecolonies-universal-" + project.version + ".jar"
manifest {
attributes 'FMLAT': "minecolonies_at.cfg"
}
}
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = true
}
}
task copyToLib(type: Copy) {
// into "build/lib"
into "lib"
from configurations.runtime
}