-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
134 lines (115 loc) · 3.63 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
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'scala'
apply plugin: 'forge'
def baseVersion = "1.3.0"
def jenkins = System.env.JENKINS_URL != null
def buildNum = System.env.BUILD_NUMBER
minecraft{
assetDir = "runtime/client/assets"
version = '1.7.2-10.12.1.1060'
}
def simpleVersion = jenkins ? baseVersion + "." + buildNum : baseVersion + "-SNAPSHOT"
group = 'alternativemods.alteng'
version = minecraft.version + "-" + simpleVersion
repositories {
maven {
url 'http://maven.reening.nl'
}
}
configurations {
packed
included
compile.extendsFrom packed
compile.extendsFrom included
}
dependencies {
packed 'jk_5.commons:CommonsConfig:0.1'
runtime 'com.googlecode.efficient-java-matrix-library:ejml:0.23' //For IC2 compat
compile 'com.mod-buildcraft:buildcraft:5.0.4.+:dev'
//compile 'codechicken:ForgeMultipart:1.7.2-1.1.0.268:dev'
//compile 'codechicken:CodeChickenLib:1.7.2-1.1.0.72:dev'
testCompile 'junit:junit:4.11'
}
jar {
from {
configurations.packed.collect {
it.isDirectory() ? it : zipTree(it).matching {
exclude "META-INF", "META-INF/**", "*META-INF*", "meta-inf"
exclude "**.jar", "**/*.jar", "*.jar"
}
}
//Maybe a bit ugly, but meh
configurations.included.collect {
fileTree(it).matching {
include "**CommonsConfig-0.1.jar"
}
}
}
manifest {
attributes "Created-By": jenkins ? "Jenkins" : "Gradle"
attributes "Implementation-Title": "AlternativeEnergy"
attributes "Implementation-Vendor": "AlternativeMods"
attributes "Implementation-Vendor-Id": "alternativemods"
attributes "Implementation-Version": simpleVersion
//attributes "FMLCorePlugin": "alternativemods.alteng.coremod.AltEngCoremod"
//attributes "FMLCorePluginContainsFMLMod": "true"
}
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'dev'
manifest {
attributes "Created-By": jenkins ? "Jenkins" : "Gradle"
attributes "Implementation-Title": "AlternativeEnergy"
attributes "Implementation-Vendor": "AlternativeMods"
attributes "Implementation-Vendor-Id": "alternativemods"
attributes "Implementation-Version": simpleVersion
//attributes "FMLCorePlugin": "alternativemods.alteng.coremod.AltEngCoremod"
//attributes "FMLCorePluginContainsFMLMod": "true"
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives sourceJar
archives deobfJar
}
build.dependsOn sourceJar, deobfJar
processResources {
inputs.property "version", simpleVersion
inputs.property "mcversion", project.minecraft.version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'version.properties'
expand 'version':simpleVersion, 'mcversion':project.minecraft.version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'version.properties'
}
}
if(jenkins){
//Don't fail the build on failed tests on jenkins. Jenkins will mark it as unstable then
test.ignoreFailures = true
}
task(sign) << {
//Will finish this later
}
reobf.finalizedBy(sign)