forked from MinecraftForge/ForgeFlower
-
Notifications
You must be signed in to change notification settings - Fork 2
/
fernflower.gradle
135 lines (118 loc) · 3.7 KB
/
fernflower.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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'eclipse'
archivesBaseName = 'forgeflower'
ext {
CHANGELOG = rootProject.file('build/changelog.txt')
}
sourceSets {
main.java.srcDirs = ['src']
test.java.srcDirs = ['test']
java9.java.srcDirs = ['java9']
}
repositories {
mavenCentral()
maven { url = "https://libraries.minecraft.net/" }
maven { url = 'https://maven.minecraftforge.net/' }
}
dependencies {
// The Java9 code depends on (can see) the "main" source set
java9Implementation sourceSets.main.output
testImplementation 'junit:junit:4.+'
testImplementation 'org.hamcrest:hamcrest-core:1.3'
testImplementation 'org.assertj:assertj-core:3.+'
testImplementation 'com.google.code.gson:gson:2.8.0'
testImplementation 'net.minecraftforge:DiffPatch:2.0.5:all'
}
java.toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
// Default all standard Java compile tasks to Java 8
// We'll specify Java 9 only for the java9 compile task
tasks.withType(JavaCompile) {
options.deprecation = true
}
compileJava9Java {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(9)
}
}
eclipse {
classpath {
sourceSets -= [sourceSets.java9]
}
project {
name 'ForgeFlower'
}
}
jar {
into('META-INF/versions/9') {
from sourceSets.java9.output
}
manifest {
attributes(
'Main-Class' : 'org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler',
'Multi-Release': 'true'
)
}
}
task sourceJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allJava
}
artifacts {
archives sourceJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
if (CHANGELOG.exists()) {
artifact source: CHANGELOG, classifier: 'changelog'
}
artifact tasks.sourceJar
pom {
groupId = project.group
version = project.version
artifactId = project.archivesBaseName
name = project.archivesBaseName
packaging = 'jar'
description = 'Fernflower from https://github.com/JetBrains/intellij-community as standalone library, With Forges Modifications'
url = 'https://github.com/MinecraftForge/ForgeFlower'
scm {
url = 'https://github.com/MinecraftForge/ForgeFlower'
connection = 'scm:git:git://github.com/MinecraftForge/ForgeFlower.git'
developerConnection = 'scm:git:[email protected]:MinecraftForge/ForgeFlower.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/MinecraftForge/ForgeFlower/issues'
}
licenses {
license {
name = 'Apache License 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0'
distribution = 'repo'
}
}
}
}
}
repositories {
maven {
if (System.env.MAVEN_USER) {
url 'https://maven.minecraftforge.net/'
authentication {
basic(BasicAuthentication)
}
credentials {
username = System.env.MAVEN_USER ?: 'not'
password = System.env.MAVEN_PASSWORD ?: 'set'
}
} else {
url 'file://' + rootProject.file('repo').getAbsolutePath()
}
}
}
}