@@ -35,24 +35,27 @@ dependencies {
35
35
implementation ' com.google.code.gson:gson:2.8.9'
36
36
implementation ' me.carleslc.Simple-YAML:Simple-Yaml:1.7.2'
37
37
implementation ' com.zaxxer:HikariCP:3.3.1'
38
- compileOnly ' org.xerial:sqlite-jdbc:3.25 .2'
39
- implementation ' org.apache.logging.log4j:log4j-api:2.13.2 '
40
- compileOnly ' org.apache.logging.log4j:log4j-core:2.13.2 '
38
+ compileOnly ' org.xerial:sqlite-jdbc:3.36.0 .2'
39
+ implementation ' org.apache.logging.log4j:log4j-api:2.14.1 '
40
+ compileOnly ' org.apache.logging.log4j:log4j-core:2.14.1 '
41
41
implementation ' net.lingala.zip4j:zip4j:2.9.0'
42
42
compileOnly ' me.clip:placeholderapi:2.10.9'
43
43
implementation ' org.jetbrains:annotations:23.0.0'
44
44
45
- testImplementation ' org.junit.jupiter:junit-jupiter:5.7.2 '
45
+ testImplementation ' org.junit.jupiter:junit-jupiter:5.8.1 '
46
46
}
47
47
48
48
test {
49
49
useJUnitPlatform()
50
50
}
51
51
52
- sourceCompatibility = 1.8
53
- targetCompatibility = 1.8
54
- java. withJavadocJar()
55
- java. withSourcesJar()
52
+ java {
53
+ sourceCompatibility = JavaVersion . VERSION_1_8
54
+ targetCompatibility = JavaVersion . VERSION_1_8
55
+
56
+ withJavadocJar()
57
+ withSourcesJar()
58
+ }
56
59
57
60
tasks. withType(JavaCompile ) {
58
61
options. encoding = ' UTF-8'
@@ -66,16 +69,19 @@ tasks.withType(Javadoc) {
66
69
}
67
70
68
71
tasks. withType(Copy ) {
69
- duplicatesStrategy = ' include '
72
+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
70
73
exclude ' META-INF/**'
71
74
}
72
75
73
76
tasks. withType(Jar ) {
74
- duplicatesStrategy = ' include '
77
+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
75
78
exclude ' META-INF/**'
76
79
}
77
80
78
- shadowJar {
81
+ shadowJar {
82
+ archiveBaseName. set(' SuperCoreAPI' )
83
+ archiveClassifier. set(' ' )
84
+
79
85
relocate ' com.google' , ' xyz.theprogramsrc.supercoreapi.libs.google'
80
86
relocate ' org.apache.commons' , ' xyz.theprogramsrc.supercoreapi.libs.apache.commons'
81
87
relocate ' com.cryptomorin.xseries' , ' xyz.theprogramsrc.supercoreapi.libs.xseries'
@@ -89,15 +95,9 @@ shadowJar {
89
95
relocate ' javax.annotation' , ' xyz.theprogramsrc.supercoreapi.libs.annotation'
90
96
relocate ' com.zaxxer.hikari' , ' xyz.theprogramsrc.supercoreapi.libs.hikari'
91
97
92
- archiveBaseName. set(' SuperCoreAPI' )
93
- archiveClassifier. set(' ' )
94
- archiveVersion. set(' ' )
95
98
minimize()
96
99
}
97
100
98
- shadowJar. finalizedBy javadocJar
99
- shadowJar. finalizedBy sourcesJar
100
-
101
101
configurations {
102
102
testImplementation {
103
103
extendsFrom(compileOnly)
@@ -107,81 +107,41 @@ configurations {
107
107
sourceSets. main. java. srcDir ' src/main/java'
108
108
sourceSets. test. java. srcDir ' src/test/java'
109
109
110
- def repos = repositories
111
-
112
110
publishing {
111
+ repositories {
112
+ maven {
113
+ name = ' TheProgramSrcRepository'
114
+ credentials. username = System . getenv(' NEXUS_USERNAME' )
115
+ credentials. password = System . getenv(' NEXUS_PASSWORD' )
116
+ url = uri(version. contains(' -SNAPSHOT' ) ? ' https://repo.theprogramsrc.xyz/repository/maven-snapshots/' : ' https://repo.theprogramsrc.xyz/repository/maven-releases/' )
117
+ }
118
+ maven {
119
+ name = ' GitHubPackages'
120
+ url = ' https://maven.pkg.github.com/TheProgramSrc/SuperCoreAPI'
121
+ credentials {
122
+ username = System . getenv(' GITHUB_ACTOR' )
123
+ password = System . getenv(' GITHUB_TOKEN' )
124
+ }
125
+ }
126
+ }
113
127
publications {
114
128
mavenJava(MavenPublication ) {
115
- artifactId ' SuperCoreAPI '
129
+ artifactId ' supercoreapi '
116
130
117
- artifact(tasks[ " shadowJar " ])
131
+ from components . java
118
132
119
133
pom. withXml {
120
- def root = asNode()
121
-
122
- root. appendNode(' description' , description)
123
- root. appendNode(' packaging' , ' jar' )
124
- root. appendNode(' url' , ' https://github.com/TheProgramsrc/SuperCoreAPI' )
125
-
126
- final repositoriesNode = root. appendNode(' repositories' )
127
- repos. each {
128
- if (it. name == ' MavenLocal' ){
129
- return
130
- }
131
- def repositoryNode = repositoriesNode. appendNode(' repository' )
132
- repositoryNode. appendNode(' id' , it. name)
133
- repositoryNode. appendNode(' url' , it. url)
134
- }
135
-
136
- final dependenciesNode = root. appendNode(' dependencies' )
137
- ext. addDependency = { dep , String scope ->
138
- if (dep. group == null || dep. version == null || dep. name == null || dep. name == " unspecified" )
139
- return // ignore invalid dependencies
140
-
141
- final dependencyNode = dependenciesNode. appendNode(' dependency' )
142
- dependencyNode. appendNode(' groupId' , dep. group)
143
- dependencyNode. appendNode(' artifactId' , dep. name)
144
- dependencyNode. appendNode(' version' , dep. version)
145
- dependencyNode. appendNode(' scope' , scope)
146
-
147
- if (! dep. transitive) {
148
- // If this dependency is not transitive, we should force exclude all its dependencies from the POM
149
- final exclusionNode = dependencyNode. appendNode(' exclusions' ). appendNode(' exclusion' )
150
- exclusionNode. appendNode(' groupId' , ' *' )
151
- exclusionNode. appendNode(' artifactId' , ' *' )
152
- } else if (! dep. properties. excludeRules. empty) {
153
- // Otherwise add specified exclude rules
154
- final exclusionsNode = dependencyNode. appendNode(' exclusions' )
155
- dep. properties. excludeRules. each { rule ->
156
- final exclusionNode = exclusionsNode. appendNode(' exclusion' )
157
- exclusionNode. appendNode(' groupId' , rule. group ?: ' *' )
158
- exclusionNode. appendNode(' artifactId' , rule. module ?: ' *' )
159
- }
160
- }
161
- }
162
-
163
- configurations. compileOnly. getDependencies(). each { dep -> addDependency(dep, " provided" ) }
164
- configurations. implementation. getDependencies(). each { dep -> addDependency(dep, " compile" ) }
165
- configurations. testImplementation. getDependencies(). each { dep -> addDependency(dep, " test" ) }
134
+ asNode(). appendNode(' packaging' , ' jar' )
135
+ asNode(). remove(asNode(). get(' dependencies' ))
136
+
137
+ def dependenciesNode = asNode(). appendNode(' dependencies' )
138
+ def jetbrainsAnnotations = dependenciesNode. appendNode(' dependency' )
139
+ jetbrainsAnnotations. appendNode(' groupId' , ' org.jetbrains' )
140
+ jetbrainsAnnotations. appendNode(' artifactId' , ' annotations' )
141
+ jetbrainsAnnotations. appendNode(' version' , ' 19.0.0' )
166
142
}
167
143
}
168
144
}
169
- repositories {
170
- maven {
171
- name = ' TheProgramSrcRepository'
172
- credentials. username = System . getenv(' NEXUS_USERNAME' )
173
- credentials. password = System . getenv(' NEXUS_PASSWORD' )
174
- url = uri(version. contains(' -SNAPSHOT' ) ? ' https://repo.theprogramsrc.xyz/repository/maven-snapshots/' : ' https://repo.theprogramsrc.xyz/repository/maven-releases/' )
175
- }
176
- // maven {
177
- // name = 'GitHubPackages'
178
- // url = 'https://maven.pkg.github.com/TheProgramSrc/SuperCoreAPI'
179
- // credentials {
180
- // username = System.getenv('GITHUB_ACTOR')
181
- // password = System.getenv('GITHUB_TOKEN')
182
- // }
183
- // }
184
- }
185
145
}
186
146
187
147
javadoc {
@@ -191,3 +151,4 @@ javadoc {
191
151
}
192
152
193
153
publish. dependsOn clean, test, jar
154
+
0 commit comments