-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
80 lines (71 loc) · 1.89 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
plugins {
id "java-library"
id "application"
id "maven-publish"
}
group "org.moddingx"
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
repositories {
mavenCentral()
maven { url "https://maven.moddingx.org" }
}
dependencies {
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
implementation 'net.sf.jopt-simple:jopt-simple:5.0.4'
implementation 'org.jsoup:jsoup:1.17.2'
implementation 'org.moddingx:CurseWrapper:5.0'
}
application.mainClass = 'org.moddingx.modlistcreator.Main'
jar {
manifest {
attributes([
'Main-Class': application.mainClass.get()
])
}
}
task fatjar(type: Jar) {
archiveClassifier = 'fatjar'
manifest = jar.manifest
with jar
}
build.dependsOn fatjar
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
build.dependsOn sourcesJar
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
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)
}
}
}