-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
110 lines (96 loc) · 3.53 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
// Calculate the appropriate natives for the current OS (just for running tests)
val lwjglNatives = Pair(
System.getProperty("os.name")!!,
System.getProperty("os.arch")!!
).let { (name, arch) ->
when {
arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } ->
if (arrayOf("arm", "aarch64").any { arch.startsWith(it) })
"natives-linux${if (arch.contains("64") || arch.startsWith("armv8")) "-arm64" else "-arm32"}"
else if (arch.startsWith("ppc"))
"natives-linux-ppc64le"
else if (arch.startsWith("riscv"))
"natives-linux-riscv64"
else
"natives-linux"
arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } ->
"natives-macos${if (arch.startsWith("aarch64")) "-arm64" else ""}"
arrayOf("Windows").any { name.startsWith(it) } ->
if (arch.contains("64"))
"natives-windows${if (arch.startsWith("aarch64")) "-arm64" else ""}"
else
"natives-windows-x86"
else ->
throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually")
}
}
group = "io.github.mudbill"
version = "3.0.0"
plugins {
id("java-library")
id("maven-publish")
id("signing")
}
java {
withSourcesJar()
withJavadocJar()
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
}
// Make the compiled code compatible with Java 1.8
tasks.withType<JavaCompile> {
options.release = 8
}
repositories {
mavenCentral()
}
val lwjglVersion = "3.3.0"
dependencies {
// Support all version of 3, but not 4 (because at this time there is no 4 so it should be tested first)
implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion"))
implementation("org.lwjgl", "lwjgl-opengl")
testRuntimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives)
testRuntimeOnly("org.lwjgl", "lwjgl-opengl", classifier = lwjglNatives)
testRuntimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives)
testImplementation("org.lwjgl", "lwjgl-glfw")
}
publishing {
repositories {
maven {
url = uri(layout.buildDirectory.dir("repository"))
}
}
publications {
create<MavenPublication>("java") {
from(components["java"])
pom {
name = "DDS for LWJGL"
description =
"dds-lwjgl is a tiny library for parsing DirectDraw Surface texture files for use in LWJGL's OpenGL in Java."
url = "https://github.com/Mudbill/dds-lwjgl"
inceptionYear = "2018"
licenses {
license {
name = "GPL-3.0"
url = "https://www.gnu.org/licenses/gpl-3.0.en.html"
}
}
developers {
developer {
id = "mudbill"
name = "Magnus Bull"
email = "mudbill@buttology.net"
}
}
scm {
connection = "scm:git:git:github.com/Mudbill/dds-lwjgl.git"
developerConnection = "scm:git:ssh://github.com/Mudbill/dds-lwjgl.git"
url = "https://github.com/Mudbill/dds-lwjgl"
}
}
}
}
}
signing {
sign(publishing.publications["java"])
}