-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
162 lines (135 loc) · 4 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import io.izzel.taboolib.gradle.*
plugins {
`java-library`
`maven-publish`
signing
id("io.izzel.taboolib") version "2.0.11"
id("org.jetbrains.kotlin.jvm") version "1.9.22"
id("org.jetbrains.dokka") version "1.9.20"
}
tasks.javadoc {
this.options {
encoding = "UTF-8"
}
}
val order: String? by project
val api: String? by project
task("versionModify") {
project.version = project.version.toString() + (order?.let { "-$it" } ?: "")
}
taboolib {
description {
contributors {
name("Glom_")
}
dependencies {}
}
env {
// basic
install(UNIVERSAL)
install(KETHER)
}
version {
if(project.gradle.startParameter.taskNames.getOrNull(0) == "taboolibBuildApi" || api != null){
println("api!")
isSkipKotlinRelocate =true
isSkipKotlin = true
}
taboolib = "6.1.1-beta17"
}
relocate("org.openjdk.nashorn", "com.skillw.nashorn")
relocate("jdk.nashorn", "com.skillw.nashorn.legacy")
relocate("com.esotericsoftware.reflectasm", "com.skillw.asahi.reflectasm")
}
tasks.withType<Jar> {
// Otherwise you'll get a "No main manifest attribute" error
manifest {
attributes["Main-Class"] = "com.skillw.asahi.Playground"
}
// To avoid the duplicate handling strategy error
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// To add all of the dependencies
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("com.esotericsoftware:reflectasm:1.11.9")
compileOnly("com.google.code.gson:gson:2.9.0")
implementation(kotlin("stdlib-jdk8"))
compileOnly(fileTree("libs"))
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
publishing {
repositories {
maven {
url = if (project.version.toString().contains("-SNAPSHOT")) {
uri("https://s01.oss.sonatype.org/content/repositories/snapshots")
} else {
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
credentials {
username = project.findProperty("username").toString()
password = project.findProperty("password").toString()
}
authentication {
create<BasicAuthentication>("basic")
}
}
mavenLocal()
}
publications {
create<MavenPublication>("library") {
from(components["java"])
version = project.version.toString()
groupId = project.group.toString()
pom {
name.set(project.name)
description.set("Dynamic Script Lang.")
url.set("https://github.com/Glom-c/Asahi/")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/Glom-c/Asahi/blob/main/LICENSE")
}
}
developers {
developer {
id.set("Skillw")
name.set("Glom_")
email.set("[email protected]")
}
}
scm {
connection.set("...")
developerConnection.set("...")
url.set("...")
}
}
}
}
}
signing {
sign(publishing.publications.getAt("library"))
}