-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
117 lines (95 loc) · 3.48 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'org.jetbrains.dokka' version '1.7.20'
}
def projectVersion = (System.getenv("VERSION") ?: '0.1.1-SNAPSHOT').replaceFirst("v", "").replace('/', '')
group 'xyz.theprogramsrc'
version projectVersion
description 'Download dependencies from repositories programmatically!'
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://repo.theprogramsrc.xyz/repository/maven-public/' }
maven { url 'https://repo.theprogramsrc.xyz/repository/simplecoreapi-modules/' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://oss.sonatype.org/content/repositories/releases/' }
maven { url 'https://oss.sonatype.org/content/groups/public/' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://repo.codemc.org/repository/maven-public' }
maven { url 'https://repo.codemc.org/repository/nms' }
maven { url 'https://jitpack.io' }
}
dependencies {
compileOnly 'org.jetbrains.kotlin:kotlin-stdlib:1.7.20'
compileOnly 'org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT'
compileOnly 'net.md-5:bungeecord-api:1.18-R0.1-SNAPSHOT'
compileOnly 'xyz.theprogramsrc:simplecoreapi:0.1.10-SNAPSHOT'
compileOnly 'xyz.theprogramsrc:filesmodule:0.1.0-SNAPSHOT'
implementation 'org.json:json:20220924'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
}
shadowJar {
mergeServiceFiles()
exclude('**/*.kotlin_metadata')
exclude('**/*.kotlin_builtins')
archiveBaseName.set('DependencyDownloaderModule')
archiveClassifier.set('')
}
test {
useJUnitPlatform()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
processResources {
filter ReplaceTokens, tokens: [name: rootProject.name, version: project.version.toString(), description: project.description, git_short: System.getenv("GIT_COMMIT_SHORT_HASH") ?: "unknown", git_full: System.getenv("GIT_COMMIT_LONG_HASH") ?: "unknown"]
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
tasks.withType(Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
configurations {
testImplementation {
extendsFrom(compileOnly)
}
}
tasks.named("dokkaHtml") {
outputDirectory.set(file(project.buildDir.absolutePath + '/dokka'))
}
publishing {
repositories {
if(System.getenv('env') == 'prod'){
maven {
name = 'TheProgramSrcRepository'
credentials.username = System.getenv('NEXUS_USERNAME')
credentials.password = System.getenv('NEXUS_PASSWORD')
url = uri("https://repo.theprogramsrc.xyz/repository/simplecoreapi-modules/")
}
}else{
mavenLocal()
}
}
publications {
mavenKotlin(MavenPublication) { publication ->
artifactId = 'dependencydownloadermodule'
from components.java
pom.withXml {
asNode().appendNode('packaging', 'jar')
if(asNode().get('dependencies')[0] != null) {
asNode().remove(asNode().get('dependencies')[0])
}
}
}
}
}
publish.dependsOn clean, test, jar, shadowJar