-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
133 lines (112 loc) · 3.61 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
133 lines (112 loc) · 3.61 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")
id("signing")
id("maven-publish")
id("com.github.gmazzo.buildconfig") version "6.0.9"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("org.glavo.load-maven-publish-properties") version "0.1.0"
}
group = "org.glavo.hmcl"
version = "1.0" // + "-SNAPSHOT"
description = "A Java Agent to bypass the Vulkan feature checks in Minecraft 26.2"
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:6.0.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java {
withSourcesJar()
withJavadocJar()
}
tasks.withType<JavaCompile> {
options.release.set(25)
}
buildConfig {
packageName("org.glavo.agent.vulkan")
useJavaOutput()
buildConfigField<String>("PROJECT_VERSION", provider { project.version.toString() })
}
tasks.jar {
manifest {
attributes(
"Premain-Class" to "org.glavo.agent.vulkan.VulkanBypass"
)
}
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).also {
it.jFlags!!.addAll(listOf("-Duser.language=en", "-Duser.country=", "-Duser.variant="))
it.encoding("UTF-8")
it.addStringOption("link", "https://docs.oracle.com/en/java/javase/25/docs/api/")
it.addBooleanOption("html5", true)
it.addStringOption("Xdoclint:none", "-quiet")
it.tags!!.addAll(
listOf(
"apiNote:a:API Note:",
"implNote:a:Implementation Note:",
"implSpec:a:Implementation Specification:",
)
)
}
}
tasks.withType<GenerateModuleMetadata> {
enabled = false
}
configure<PublishingExtension> {
publications {
create<MavenPublication>("maven") {
groupId = project.group.toString()
version = project.version.toString()
artifactId = project.name
from(components["java"])
pom {
name.set(project.name)
description.set(project.description)
url.set("https://github.com/HMCL-dev/VulkanBypass")
licenses {
license {
name.set("Apache-2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("glavo")
name.set("Glavo")
email.set("zjx001202@gmail.com")
}
}
scm {
url.set("https://github.com/HMCL-dev/VulkanBypass")
}
}
}
}
}
if (System.getenv("JITPACK").isNullOrBlank() && rootProject.ext.has("signing.key")) {
signing {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"].toString(),
rootProject.ext["signing.key"].toString(),
rootProject.ext["signing.password"].toString(),
)
sign(publishing.publications["maven"])
}
}
// ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(rootProject.ext["sonatypeUsername"].toString())
password.set(rootProject.ext["sonatypePassword"].toString())
}
}
}