-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
68 lines (61 loc) · 1.66 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
plugins {
id 'java-library'
id 'maven-publish'
}
group = 'org.moddingx'
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
repositories {
mavenCentral()
}
dependencies {
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation 'org.apache.commons:commons-text:1.12.0'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'org.jsoup:jsoup:1.17.2'
}
task fatjar(type: Jar) {
archiveClassifier = 'fatjar'
manifest = jar.manifest
with jar
}
build.dependsOn fatjar
task configureFatJar {
doLast {
configurations.runtimeClasspath.each { dep ->
fatjar.from(project.zipTree(dep)) {
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class'
duplicatesStrategy DuplicatesStrategy.INCLUDE
}
}
}
outputs.upToDateWhen { false }
}
fatjar.dependsOn configureFatJar
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
build.dependsOn sourcesJar
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
pom {
licenses {
license {
name = "The Apache License, Version 2.0"
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
}
}
}
repositories {
maven {
name 'moddingx'
url 'https://maven.moddingx.org/release'
credentials(PasswordCredentials)
}
}
}