forked from GTNewHorizons/NotEnoughItems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
158 lines (135 loc) · 3.66 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "jitpack"
url = "https://jitpack.io"
}
}
dependencies {
classpath "com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"
}
}
plugins {
id("org.ajoberstar.grgit") version("3.1.1")
}
//add dependency repositories
repositories {
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven"
}
}
apply plugin: "java"
apply plugin: "idea"
apply plugin: 'forge'
idea {
module {
inheritOutputDirs = true
downloadJavadoc = true
downloadSources = true
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
group = "codechicken"
archivesBaseName = "NotEnoughItems"
// Define properties file
ext.configFile = file "build.properties"
configFile.withReader {
// Load config. It shall from now be referenced as simply config or project.config
def prop = new Properties()
prop.load(it)
project.ext.config = new ConfigSlurper().parse prop
}
//
//configurations.all {
// resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
// setTransitive(false)
//}
configurations {
shade
compile.extendsFrom shade
}
dependencies {
compile "codechicken:CodeChickenLib:${config.mc_version}-${config.ccl_version}:dev"
compile "codechicken:CodeChickenCore:${config.mc_version}-${config.ccc_version}:dev"
shade "org.apache.commons:commons-csv:1.5"
}
version = "${project.config.mod_version}"
println config.mc_version + "-" + config.forge_version
// Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here
minecraft {
version = config.mc_version + "-" + config.forge_version
}
def root = project.projectDir;
sourceSets {
main {
java {
srcDir new File(root, "src")
}
resources {
srcDir new File(root, "resources")
}
}
}
processResources {
//redo task if any of these properties change
inputs.property "version", project.version
inputs.property "mc_version", config.mc_version
// Replace properties in info files
from(sourceSets.main.resources.srcDirs) {
include '*.info'
expand 'version':project.version,'mc_version':config.mc_version
}
// Move access transformer to META-INF
rename '(.+_at.cfg)', 'META-INF/$1'
//
// // copy everything else, that's not the mcmod.info
// from(sourceSets.main.resources.srcDirs) {
// exclude "mcmod.info"
// }
}
version = "${project.minecraft.version}-${project.version}"
def commonManifest = {
attributes 'FMLCorePlugin': 'codechicken.nei.asm.NEICorePlugin'
attributes 'FMLAT': 'nei_at.cfg'
}
jar {
getArchiveClassifier().set("universal")
manifest commonManifest
configurations.shade.each { dep ->
from(project.zipTree(dep)){
exclude 'META-INF', 'META-INF/**'
}
}
}
task sourceJar(type: Jar) {
from sourceSets.main.java
from new File(root, "dev")
getArchiveClassifier().set("src")
}
task devJar(type: Jar) {
from sourceSets.main.output
getArchiveClassifier().set("dev")
manifest commonManifest
}
// Tell the artifact system about our extra jars
artifacts {
archives sourceJar, devJar
}
minecraft {
srgExtra "PK: org/apache/commons/csv nei/org/apache/commons/csv"
srgExtra "PK: org/apache/commons/csv/CSVFormat nei/org/apache/commons/csv/CSVFormat"
}