-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
80 lines (64 loc) · 1.52 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
plugins {
id("java-library")
id("maven-publish")
}
group = "net.lostluma"
version = project.property("version").toString()
base {
archivesName = "battery"
}
repositories {
mavenCentral()
}
dependencies {
implementation(libs.annotations)
}
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
}
tasks.withType<Jar> {
from("LICENSE")
}
tasks.withType<AbstractArchiveTask> {
isReproducibleFileOrder = true
isPreserveFileTimestamps = false
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
/**
* Builds the bundled Jar.
*
* Put all variants of the library into a `library/` directory first!
*/
tasks.register<Jar>("buildBundled") {
archiveClassifier = "bundled"
from(files("library/"))
from(sourceSets.main.get().output)
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = group.toString()
artifactId = base.archivesName.get()
version = version
from(components["java"])
artifact(tasks.named("buildBundled").get())
}
}
repositories {
maven {
url = uri("https://maven.lostluma.net/releases")
credentials {
username = project.properties["maven.username"].toString()
password = project.properties["maven.password"].toString()
}
}
}
}