forked from AgriCraft/AgriCraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
161 lines (146 loc) · 3.7 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
159
160
161
// QuikMod Buildscript
buildscript {
repositories {
jcenter()
maven {
name = "Forge Gradle"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "Gradle Plugins"
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath 'gradle.plugin.com.rlonryan:QuikMod:1.0.21'
}
}
// Apply QuikMod
apply plugin: 'com.rlonryan.quikmod'
apply plugin: 'maven-publish'
// Tweak MineCraft Task
minecraft {
makeObfSourceJar = false
useDepAts = true
}
// Setup Remotes
repositories {
maven {
name "chickenbones"
url "http://chickenbones.net/maven/"
}
maven {
name "Mobius Repo"
url "http://mobiusstrip.eu/maven/"
}
maven {
name "sponge"
url "http://repo.spongepowered.org/maven/"
}
maven {
name "sk89q"
url "http://maven.sk89q.com/repo/"
}
maven {
name "McJty maven"
url "http://maven.k-4u.nl/"
}
maven {
name "tterrag maven"
url "http://maven.tterrag.com/"
}
maven {
name "JEI"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name "OpenComputers"
url "http://maven.cil.li/"
}
}
// List Deps.
dependencies {
// Mods (For auto-import)
shade project(':lib/AgriCore')
compile project(':lib/InfinityLib')
compile 'com.google.guava:guava:24.0-jre'
deobfCompile "mezz.jei:jei_1.12.2:4.8.5.140"
}
// Add AgriPlants
processResources {
from('lib/AgriPlants') {
include '**/*.json'
into 'json/defaults'
}
}
// Javadoc
task mainJavadoc(type: Javadoc) {
source = sourceSets.main.allJava
title = "AgriCraft ${mod.version} Documentation"
destinationDir = file("${project.docsDir}/mainJavadoc")
failOnError = false
}
task apiJavadoc(type: Javadoc) {
source = sourceSets.main.allJava
include "**/api/**"
title = "AgriCraft ${mod.version} API Documentation"
destinationDir = file("${project.docsDir}/apiJavadoc")
failOnError = false
}
// Jars
task mainSourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
}
task mainJavadocJar(type: Jar, dependsOn: mainJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task apiJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
include "${mod.package.replace('.', '/')}/api/**/*"
classifier = 'api'
}
task apiSourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
include "${mod.package.replace('.', '/')}/api/**/*"
classifier = 'api-sources'
}
task apiJavadocJar(type: Jar, dependsOn: apiJavadoc) {
from apiJavadoc.destinationDir
classifier = 'api-javadoc'
}
// Tell build that it needs the API compiled first.
build.dependsOn apiJar
// Setup Maven Publishing
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourceJar
artifact apiJar
}
}
repositories {
if (project.hasProperty('maven_repo')) {
maven { url maven_repo }
} else {
mavenLocal()
}
}
}
// Fix Shading
jar {
configurations.shade.each { dep ->
from(project.zipTree(dep)){
exclude 'META-INF', 'META-INF/**'
exclude 'com/google', 'com/google/**'
exclude 'net/jcip', 'net/jcip/**'
exclude 'edu/umd', 'edu/umd/**'
exclude 'javassist', 'javassist/**'
exclude 'javax/annotation', 'javax/annotation/**'
}
}
}