forked from MinecraftForge/Installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
186 lines (160 loc) · 4.95 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:5.2.1'
}
}
repositories {
mavenCentral()
maven {
url "https://libraries.minecraft.net/"
}
flatDir {
name "fileRepo"
dirs "repo"
}
}
group = 'net.minecraftforge'
archivesBaseName = 'installer'
version = '1.7'
targetCompatibility = '1.6'
sourceCompatibility = '1.6'
dependencies {
compile 'net.sf.jopt-simple:jopt-simple:4.5'
compile 'net.sourceforge.argo:argo:3.7'
compile 'com.google.guava:guava:14.0'
compile 'org.tukaani:xz:1.3'
compile 'org.ow2.asm:asm:5.2'
}
task compilej6(type: JavaCompile) {
source = fileTree(dir: "src/main/java")
classpath = sourceSets.main.compileClasspath
destinationDir = sourceSets.main.output.classesDir
includes = ['net/minecraftforge/installer/Java6Gate.java']
sourceCompatibility = 1.6
targetCompatibility = 1.6
}
compileJava {
excludes = ['**/Java6Gate.java']
sourceCompatibility = 1.8
targetCompatibility = 1.8
options.encoding = 'UTF-8'
}
tasks.compileJava.dependsOn('compilej6')
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task fatJar(type: Jar, dependsOn: jar) {
inputs.file jar.archivePath
from(configurations.compile.collect { zipTree(it).matching { include '**/*.class' } })
manifest { attributes 'Main-Class': 'net.minecraftforge.installer.Java6Gate' }
}
fatJar.doFirst {
from zipTree(jar.archivePath)
}
task packerJar(type: Jar, dependsOn: jar) {
doFirst {
from zipTree(jar.archivePath)
}
classifier = 'packer'
inputs.file jar.archivePath
from(configurations.compile.collect { zipTree(it).matching { include '**/*.class' } })
manifest { attributes 'Main-Class': 'net.minecraftforge.installer.LibraryPacker' }
}
task transformerJar(type: Jar, dependsOn: jar) {
doFirst {
from zipTree(jar.archivePath)
}
classifier = 'transformer'
inputs.file jar.archivePath
from(configurations.compile.collect { zipTree(it).matching { include '**/*.class' } })
manifest { attributes 'Main-Class': 'net.minecraftforge.installer.transform.LibraryTransformer' }
}
task shrinkJar(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
inputs.file fatJar.archivePath
ext {
outDir = file("${buildDir}/proguard")
obfuscatedJar = "${outDir}/${jar.baseName}.jar"
}
outDir.mkdirs()
injars jar.archivePath
outjars obfuscatedJar
libraryjars configurations.compile
configuration 'proguard.pro'
}
task shrinkOutput(type: Jar, dependsOn: shrinkJar) {
classifier = 'shrunk'
from zipTree(shrinkJar.obfuscatedJar)
manifest { attributes 'Main-Class': 'net.minecraftforge.installer.Java6Gate' }
}
artifacts {
archives fatJar
archives sourcesJar
archives shrinkOutput
archives packerJar
archives transformerJar
}
jar {
classifier = 'thin'
exclude 'argo/**'
exclude '**/*.tsrg'
manifest { attributes 'Main-Class': 'net.minecraftforge.installer.Java6Gate' }
}
uploadArchives {
repositories {
add getProject().repositories.mavenLocal()
}
repositories.mavenDeployer {
if (project.hasProperty('forgeMavenPass')) {
logger.info('Publishing to files server')
repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
authentication(userName: "forge", password: project.getProperty('forgeMavenPass'))
}
} else {
logger.info('Publishing to repo folder')
repository(url: 'file://localhost/' + project.file('repo').getAbsolutePath())
}
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
}
pom.project {
name project.archivesBaseName
packaging 'jar'
description 'Minecraft Forge Installer'
url 'https://github.com/MinecraftForge/Installer'
scm {
url 'https://github.com/MinecraftForge/Installer'
connection 'scm:git:git://github.com/MinecraftForge/Installer.git'
developerConnection 'scm:git:[email protected]:MinecraftForge/Installer.git'
}
issueManagement {
system 'github'
url 'https://github.com/MinecraftForge/Installer/issues'
}
developers {
developer {
id 'cpw'
name 'cpw'
roles { role 'developer' }
}
developer {
id 'LexManos'
name 'Lex Manos'
roles { role 'developer' }
}
}
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}