-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
105 lines (87 loc) · 2.45 KB
/
Copy pathbuild.gradle
File metadata and controls
105 lines (87 loc) · 2.45 KB
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
apply plugin: 'java'
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.1-SNAPSHOT'
}
}
dependencies {
testCompile 'junit:junit:4.10'
}
/*
// make an env variable
ext.env = System.getenv()
// define the properties file
ext.configFile = file "build.properties"
configFile.withReader {
// read config. it shall from now on be referenced as simply config or as project.config
def prop = new Properties()
prop.load(it)
ext.config = new ConfigSlurper().parse prop
}
// parsing build numbers to use in the version
// set build "number" to release if building local
ext.buildNumber = "release"
// drone.io
if (env.DRONE_BUILD_NUMBER)
ext.buildNumber = env.DRONE_BUILD_NUMBER
// jenkins
else if (env.BUILD_NUMBER)
ext.buildNumber = env.BUILD_NUMBER
apply plugin: 'forge'
// we want to build on 1.6
targetCompatibility = JavaVersion.VERSION_1_6
version = "${config.minecraft_version}-${config.mod_version}.${buildNumber}"
group = "info.coremodding.moarmor"
archivesBaseName = "MoArmor"
minecraft {
version = "${config.minecraft_version}-${config.forge_version}"
}
test {
ignoreFailures = true
}
processResources {
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
include 'version.properties'
// replace version and mcversion
expand 'version': config.mod_version, 'mcversion': config.minecraft_version
}
// copy everything else, except the ones we already did
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude 'version.properties'
}
}
// creates a javadoc jar
// don't have any javadocs cause don't need them cause don't have an api
//task javadocJar(type: Jar, dependsOn: javadoc) {
// from 'build/docs/javadoc'
// appendix = 'javadoc'
//}
// creates an API jar
// don't have an api yet
//task apiJar(type: Jar) {
// from(sourceSets.main.java)
// {
// include "info/coremodding/realchemics/api/*"
// }
// appendix = 'api'
//}
// add the javadoc and api jars
// don't have either yet
//artifacts {
// archives javadocJar
// archives apiJar
//}