forked from LLVM-but-worse/maple-ir
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
133 lines (115 loc) · 4.45 KB
/
build.gradle
File metadata and controls
133 lines (115 loc) · 4.45 KB
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
plugins {
id 'java-library'
id("com.gradleup.shadow") version "8.3.6"
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
url 'https://repo.cleanroommc.com/releases/'
}
maven {
url 'https://jitpack.io'
}
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
apply plugin: 'java-library'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'maven-publish'
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
group 'org.mapleir'
version '2.25.2'
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
boolean isSdk = project.name.contains("sdk");
// exempt for sdk
if (!isSdk) {
implementation 'systems.manifold:manifold-ext-rt:2025.1.10'
annotationProcessor group: 'systems.manifold', name: 'manifold-ext', version: '2025.1.10'
testAnnotationProcessor group: 'systems.manifold', name: 'manifold-ext', version: '2025.1.10'
annotationProcessor 'systems.manifold:manifold-preprocessor:2025.1.10'
testAnnotationProcessor 'systems.manifold:manifold-preprocessor:2025.1.10'
}
shadowJar {
archiveClassifier.set('')
archiveVersion.set('')
}
// Add explicit dependencies between shadowJar tasks based on project dependencies
afterEvaluate {
if (project != rootProject) {
def projectDeps = configurations.runtimeClasspath.getAllDependencies()
.findAll { it instanceof ProjectDependency }
.collect { it.dependencyProject }
if (!projectDeps.isEmpty()) {
tasks.named('shadowJar').configure {
projectDeps.each { dep ->
dependsOn(dep.tasks.named('shadowJar'))
}
}
}
}
}
publishing {
publications {
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
}
}
}
compileJava {
options.encoding = "UTF-8" // Will fail on the non-ascii comments if not set
}
tasks.withType(JavaCompile).configureEach {
if (sourceCompatibility == JavaVersion.VERSION_17) {
options.compilerArgs += [
'--add-exports', 'java.base/jdk.internal.reflect=ALL-UNNAMED',
'--add-exports', 'java.base/jdk.internal.util=ALL-UNNAMED',
'--add-exports', 'java.base/sun.io.ch=ALL-UNNAMED'
]
}
}
tasks.withType(Test).configureEach {
if (sourceCompatibility == JavaVersion.VERSION_17) {
jvmArgs += [
'--add-exports', 'java.base/jdk.internal.reflect=ALL-UNNAMED',
'--add-exports', 'java.base/jdk.internal.util=ALL-UNNAMED',
'--add-exports', 'java.base/sun.io.ch=ALL-UNNAMED'
]
}
}
if (!isSdk) {
if (JavaVersion.current() != JavaVersion.VERSION_1_8 &&
sourceSets.main.allJava.files.any { it.name == "module-info.java" }) {
tasks.withType(JavaCompile) {
// if you DO define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold', '--module-path', it.classpath.asPath]
}
} else {
tasks.withType(JavaCompile) {
// If you DO NOT define a module-info.java file:
options.compilerArgs += ['-Xplugin:Manifold']
}
}
}
ext {
asm = 'org.ow2.asm:asm:9.8'
asm_commons = 'org.ow2.asm:asm-commons:9.8'
asm_tree = 'org.ow2.asm:asm-tree:9.8'
cafedude = 'com.github.Col-E:CAFED00D:2.1.1'
slf4j_api = 'org.slf4j:slf4j-api:1.7.36'
jlinker = 'com.github.xxDark:jlinker:1.0.7'
}
}
}
group 'org.mapleir'
version '2.25.2'
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
test {
useJUnitPlatform()
}