-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
134 lines (116 loc) · 3.79 KB
/
build.gradle
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
plugins {
id "java-library"
id "maven-publish"
id "signing"
id "net.raphimc.class-token-replacer" version "1.1.3"
}
base {
java.toolchain.languageVersion = JavaLanguageVersion.of(8)
compileJava.options.encoding = compileTestJava.options.encoding = javadoc.options.encoding = "UTF-8"
group = project.maven_group ?: rootProject.maven_group
archivesName = project.maven_name ?: rootProject.maven_name
version = project.maven_version ?: rootProject.maven_version
}
sourceSets {
javaFxStub // Java 11+ does not include JavaFX anymore, so the JavaFX stubs are needed for the compiler
}
repositories {
mavenCentral()
}
dependencies {
compileOnly(annotationProcessor("org.projectlombok:lombok:1.18.34"))
compileOnly "org.jetbrains:annotations:26.0.1"
compileOnly sourceSets.javaFxStub.output
api "net.lenni0451.commons:httpclient:1.6.1"
api "com.google.code.gson:gson:2.11.0"
api "io.jsonwebtoken:jjwt-impl:0.12.6"
api("io.jsonwebtoken:jjwt-gson:0.12.6") {
exclude group: "com.google.code.gson", module: "gson"
}
api "org.slf4j:slf4j-api:2.0.16"
}
sourceSets {
main {
classTokenReplacer {
property("\${version}", project.version)
property("\${impl_version}", "git-${project.name}-${project.version}:${project.latestCommitHash()}")
}
}
}
java {
withSourcesJar()
withJavadocJar()
}
jar {
from("LICENSE") {
rename { "${it}_${project.name ?: rootProject.name}" }
}
}
artifacts {
archives javadocJar, sourcesJar
}
publishing {
repositories {
maven {
name = "reposilite"
url = "https://maven.lenni0451.net/" + (project.maven_version.endsWith("SNAPSHOT") ? "snapshots" : "releases")
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
maven {
name = "ossrh"
url = "https://s01.oss.sonatype.org/" + (project.maven_version.endsWith("SNAPSHOT") ? "content/repositories/snapshots/" : "service/local/staging/deploy/maven2/")
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
publications {
maven(MavenPublication) {
groupId = project.maven_group
artifactId = project.maven_name
version = project.maven_version
from components.java
pom {
name = "MinecraftAuth"
description = "Simple and easy to use Minecraft microsoft authentication library (Java and Bedrock)"
url = "https://github.com/RaphiMC/MinecraftAuth"
licenses {
license {
name = "LGPL-3.0 License"
url = "https://github.com/RaphiMC/MinecraftAuth/blob/main/LICENSE"
}
}
developers {
developer {
id = "RK_01"
}
}
scm {
connection = "scm:git:git://github.com/RaphiMC/MinecraftAuth.git"
developerConnection = "scm:git:ssh://github.com/RaphiMC/MinecraftAuth.git"
url = "https://github.com/RaphiMC/MinecraftAuth.git"
}
}
}
}
}
signing {
setRequired(false)
sign configurations.archives
sign publishing.publications.maven
}
project.tasks.withType(PublishToMavenRepository).forEach {
it.dependsOn(project.tasks.withType(Sign))
}
String latestCommitHash() {
def stdout = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = stdout
}
return stdout.toString().trim()
}