forked from natanfudge/Abstractarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
160 lines (119 loc) · 4.88 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
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.0"
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.0'
id "com.jfrog.bintray" version "1.8.5"
id "maven-publish"
}
def resultTestSet = sourceSets.create("resultTest")
def resultTestMcSet = sourceSets.create("resultTestMcOnly")
apply plugin: MetaUtils
def mcJarWithInterfaces
metaUtils {
def mcJar = createJarTest("testOriginalJar")
def apiRuntime = createJarTest("apiRuntime")
mcJarWithInterfaces = createAttachInterfacesTask(mcJar.output.classesDirs.files)
mcJar.compileClasspath += apiRuntime.output
resultTestSet.compileClasspath += apiRuntime.output
resultTestSet.runtimeClasspath += apiRuntime.output
resultTestMcSet.compileClasspath += apiRuntime.output
resultTestMcSet.runtimeClasspath += apiRuntime.output
resultTestMcSet.compileClasspath += sourceSets.test.compileClasspath
resultTestMcSet.runtimeClasspath += sourceSets.test.runtimeClasspath
resultTestMcSet.compileClasspath += mcJar.output
resultTestSet.compileClasspath += resultTestMcSet.output
resultTestSet.runtimeClasspath += resultTestMcSet.output
sourceSets.test.runtimeClasspath += apiRuntime.output // For verifying asm output
tasks.attachInterfaces.dependsOn("testOriginalJarClasses")
tasks.compileResultTestKotlin.dependsOn(tasks.attachInterfaces)
// tasks.test.dependsOn(tasks.attachInterfaces)
}
tasks.compileTestOriginalJarJava.options.compilerArgs += "-parameters"
configurations {
resultTestCompile.extendsFrom testCompile
resultTestRuntime.extendsFrom testRuntime
}
task resultTest(type: Test) {
group 'Verification'
description 'Runs the resultTest tests.'
testClassesDirs = resultTestSet.output.classesDirs
classpath = resultTestSet.runtimeClasspath
useJUnitPlatform()
maxHeapSize = '1G'
}
build.dependsOn(resultTest)
group("io.github.febb")
version(abstractor_version)
archivesBaseName = "abstractor"
repositories {
mavenCentral()
jcenter()
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://dl.bintray.com/febb/maven" }
}
dependencies {
implementation("org.ow2.asm:asm:8.0.1")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation 'org.ow2.asm:asm-tree:8.0.1'
implementation 'com.squareup:javapoet:1.12.1'
implementation 'org.ow2.asm:asm-util:8.0.1'
api "io.github.febb:metautils:0.2.1+build.+"
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC") // JVM dependency
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
// implementation 'io.github.fudge:forgedflower:1.7.0'
// implementation "net.fabricmc:fabric-loom:0.4.24"
// implementation('org.jetbrains:intellij-fernflower:1.2.0.15')
implementation "net.fabricmc:tiny-mappings-parser:0.3.0+build.17"
testOriginalJarCompileOnly "org.jetbrains:annotations:19.0.0"
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.3.72'
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.4.2')
resultTestImplementation 'org.jetbrains.kotlin:kotlin-test-junit5:1.3.72'
resultTestRuntime('org.junit.jupiter:junit-jupiter-engine:5.4.2')
resultTestCompileOnly(files("build/resources/test/abstractedAsmApi.jar"))
resultTestCompileOnly(files("build/resources/test/abstractedAsmApi-sources.jar"))
resultTestRuntime(files("build/resources/test/abstractedAsm.jar"))
resultTestImplementation(mcJarWithInterfaces)
apiRuntimeImplementation(mcJarWithInterfaces)
apiRuntimeCompileOnly(files("build/resources/test/abstractedAsmApi.jar"))
apiRuntimeRuntime(files("build/resources/test/abstractedAsm.jar"))
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
test {
useJUnitPlatform()
maxHeapSize = '1G'
}
java {
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
from project.components.java
pom.withXml {
def root = asNode()
root.appendNode('description', 'Interface wrapper generator')
root.appendNode('name', 'Abstractor')
root.appendNode('url', "https://github.com/IntransientMC/Abstractarr")
}
}
}
}
bintray {
user = project.hasProperty('bintray_user') ? project.property('bintray_user') : ""
key = project.hasProperty('bintray_api_key') ? project.property('bintray_api_key') : ""
publications = ["mavenJava"]
publish = true //[Default: false] Whether version should be auto published after an upload
pkg {
repo = "maven"
userOrg = "febb"
name = "Abstractor"
licenses = ["mit"]
version {
name = abstractor_version
released = new Date()
}
}
}