1
+ import org.apache.tools.ant.filters.ReplaceTokens
2
+
3
+ plugins {
4
+ id ' org.jetbrains.kotlin.jvm' version ' 1.6.0'
5
+ id ' maven-publish'
6
+ id ' com.github.johnrengelman.shadow' version ' 7.1.0'
7
+ id ' com.dorongold.task-tree' version ' 2.1.0'
8
+ }
9
+
10
+ group ' xyz.theprogramsrc'
11
+ version ' 0.1.0-SNAPSHOT'
12
+ description ' Just a logger for the SimpleCore API'
13
+
14
+ repositories {
15
+ mavenCentral()
16
+ maven { url ' https://repo.theprogramsrc.xyz/repository/maven-snapshots/' }
17
+ maven { url ' https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
18
+ maven { url ' https://oss.sonatype.org/content/repositories/snapshots/' }
19
+ maven { url ' https://oss.sonatype.org/content/repositories/releases/' }
20
+ maven { url ' https://oss.sonatype.org/content/groups/public/' }
21
+ }
22
+
23
+ dependencies {
24
+ compileOnly ' org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
25
+ compileOnly ' org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
26
+ compileOnly ' net.md-5:bungeecord-api:1.17-R0.1-SNAPSHOT'
27
+ compileOnly ' xyz.theprogramsrc:simplecoreapi:0.0.1.1-SNAPSHOT'
28
+
29
+ testImplementation ' org.junit.jupiter:junit-jupiter:5.8.2'
30
+ }
31
+
32
+ shadowJar {
33
+ archiveBaseName. set(' LoggingModule' )
34
+ archiveClassifier. set(' ' )
35
+ }
36
+
37
+ test {
38
+ useJUnitPlatform()
39
+ }
40
+
41
+ java {
42
+ sourceCompatibility = JavaVersion . VERSION_11
43
+ targetCompatibility = JavaVersion . VERSION_11
44
+ withJavadocJar()
45
+ withSourcesJar()
46
+ }
47
+
48
+ processResources {
49
+ filter ReplaceTokens , tokens : [name : rootProject. name, version : project. version. toString(), description : project. description]
50
+ }
51
+
52
+ tasks. withType(JavaCompile ) {
53
+ options. encoding = ' UTF-8'
54
+ }
55
+
56
+ tasks. withType(Javadoc ) {
57
+ failOnError false
58
+ options. addStringOption(' Xdoclint:none' , ' -quiet' )
59
+ options. addStringOption(' encoding' , ' UTF-8' )
60
+ options. addStringOption(' charSet' , ' UTF-8' )
61
+ }
62
+
63
+ tasks. withType(Copy ) {
64
+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
65
+ exclude ' META-INF/**'
66
+ }
67
+
68
+ tasks. withType(Jar ) {
69
+ duplicatesStrategy = DuplicatesStrategy . INCLUDE
70
+ exclude ' META-INF/**'
71
+ }
72
+
73
+ configurations {
74
+ testImplementation {
75
+ extendsFrom(compileOnly)
76
+ }
77
+ }
78
+
79
+ sourceSets {
80
+ main. kotlin. srcDirs + = ' src/main/kotlin'
81
+ main. resources. srcDirs + = ' src/main/resources'
82
+ }
83
+
84
+ publishing {
85
+ repositories {
86
+ maven {
87
+ name = ' TheProgramSrcRepository'
88
+ credentials. username = System . getenv(' NEXUS_USERNAME' )
89
+ credentials. password = System . getenv(' NEXUS_PASSWORD' )
90
+ url = uri(version. contains(' -SNAPSHOT' ) ? ' https://repo.theprogramsrc.xyz/repository/maven-snapshots/' : ' https://repo.theprogramsrc.xyz/repository/maven-releases/' )
91
+ }
92
+ // maven {
93
+ // name = 'GitHubPackages'
94
+ // url = 'https://maven.pkg.github.com/TheProgramSrc/SimpleCore-LoggingModule'
95
+ // credentials {
96
+ // username = System.getenv('GITHUB_ACTOR')
97
+ // password = System.getenv('GITHUB_TOKEN')
98
+ // }
99
+ // }
100
+ }
101
+ publications {
102
+ mavenJava(MavenPublication ) {
103
+ artifactId = ' loggingmodule'
104
+
105
+ from components. java
106
+
107
+ pom. withXml {
108
+ asNode(). appendNode(' packaging' , ' jar' )
109
+ asNode(). remove(asNode(). get(' dependencies' ))
110
+ }
111
+ }
112
+ }
113
+ }
114
+
115
+ javadoc {
116
+ if (JavaVersion . current(). isJava9Compatible()) {
117
+ options. addBooleanOption(' html5' , true )
118
+ }
119
+ }
120
+
121
+ publish. dependsOn clean, test, jar, shadowJar
0 commit comments