-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
147 lines (118 loc) · 3.84 KB
/
build.gradle.kts
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
import java.io.*
plugins{
`java-library`
`maven-publish`
}
val arcVersion: String by project
val mindustryVersion: String by project
val entVersion: String by project
val javapoetVersion: String by project
fun arc(module: String): String{
return "com.github.Anuken.Arc$module:$arcVersion"
}
fun mindustry(module: String): String{
return "com.github.Anuken.Mindustry$module:$mindustryVersion"
}
fun entity(module: String): String{
return "com.github.GlennFolker.EntityAnno$module:$entVersion"
}
fun javapoet(): String{
return "com.squareup:javapoet:$javapoetVersion"
}
allprojects{
apply(plugin = "java-library")
sourceSets["main"].java.setSrcDirs(listOf(layout.projectDirectory.file("src")))
dependencies{
annotationProcessor(entity(":downgrader"))
}
repositories{
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://oss.sonatype.org/content/repositories/releases/")
maven("https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main")
maven("https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository")
maven("https://jitpack.io")
}
}
project(":annotations"){
sourceSets["main"].resources.setSrcDirs(listOf(layout.projectDirectory.file("assets")))
dependencies{
implementation(arc(":arc-core"))
implementation(arc(":g3d"))
implementation(javapoet())
}
tasks.withType<JavaCompile>().configureEach{
options.apply{
isIncremental = true
encoding = "UTF-8"
compilerArgs.add("-Xlint:-options")
}
sourceCompatibility = "17"
targetCompatibility = "8"
doFirst{
sourceCompatibility = "8"
}
}
}
project(":"){
apply(plugin = "maven-publish")
group = "com.github.GlennFolker"
java{
withJavadocJar()
withSourcesJar()
}
dependencies{
annotationProcessor(project(":annotations"))
compileOnly(project(":annotations"))
compileOnlyApi(arc(":arc-core"))
compileOnlyApi(arc(":g3d"))
}
tasks.withType<Jar>().configureEach{
exclude("gltfrenzy/spec/**")
metaInf{
from(layout.projectDirectory.file("LICENSE"))
}
}
tasks.withType<JavaCompile>().configureEach{
sourceCompatibility = "17"
options.apply{
release = 8
compilerArgs.add("-Xlint:-options")
isIncremental = true
encoding = "UTF-8"
}
}
tasks.withType<Javadoc>().configureEach{
options{
encoding = "UTF-8"
val exports = (project.property("org.gradle.jvmargs") as String)
.split(Regex("\\s+"))
.filter{it.startsWith("--add-opens")}
.map{"--add-exports ${it.substring("--add-opens=".length)}"}
.reduce{accum, arg -> "$accum $arg"}
val opts = File(temporaryDir, "exports.options")
BufferedWriter(FileWriter(opts, Charsets.UTF_8, false)).use{it.write("-Xdoclint:none $exports")}
optionFiles(opts)
}
}
publishing.publications.register<MavenPublication>("maven"){
from(components["java"])
pom{
name = "glTFrenzy"
description = "A glTF loader for Arc-based projects."
url = "https://github.com/GlennFolker/glTFrenzy"
inceptionYear = "2024"
licenses{
license{
name = "GPL-3.0-or-later"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
distribution = "repo"
}
}
issueManagement{
system = "GitHub Issue Tracker"
url = "https://github.com/GlennFolker/EntityAnno/issues"
}
}
}
}