-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
123 lines (111 loc) · 4.13 KB
/
build.gradle.kts
File metadata and controls
123 lines (111 loc) · 4.13 KB
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
118
119
120
121
122
123
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.5.31"
id("maven-publish")
id("com.github.johnrengelman.shadow") version "6.1.0"
}
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.5.0")
classpath("com.github.jengelman.gradle.plugins:shadow:6.1.0")
}
}
group = "net.neverstopgaming"
version = "1.0"
repositories {
mavenCentral()
for (field in Repositories::class.java.declaredFields) {
if (field.name != "INSTANCE") {
println("Added Repository: " + field.get(null))
maven(field.get(null))
}
}
maven {
url = uri("https://repo.neverstopgaming.net/repository/maven-internal/")
credentials {
this.username = System.getenv("repoName") ?: System.getenv("NEXUS_USER") ?: System.getProperty("publishName")
this.password = System.getenv("repoPassword") ?: System.getenv("NEXUS_PASSWORD") ?: System.getProperty("publishPassword")
}
}
}
dependencies {
testImplementation(kotlin("test"))
compileOnly(getDependency("simplecloud", "plugin"))
compileOnly(getDependency("google", "gson"))
compileOnly(getDependency("simplecloud", "launcher"))
compileOnly(getDependency("components", "minimessage"))
implementation(getDependency("database", "influxdb"))
}
tasks.test {
useJUnit()
}
tasks {
shadowJar {
archiveFileName.set("${project.name}-${Properties.version}-full.jar")
exclude("META-INF/**")
doFirst {
//Set Manifest
manifest {
attributes["Implementation-Title"] = project.name
attributes["Implementation-Version"] = Properties.version
attributes["Specification-Version"] = Properties.version
attributes["Implementation-Vendor"] = "NeverStopGaming.net"
attributes["Built-By"] = System.getProperty("user.name")
attributes["Build-Jdk"] = System.getProperty("java.version")
attributes["Created-By"] = "Gradle ${gradle.gradleVersion}"
attributes["Commit-Hash"] = getCommitHash()
attributes["Launcher-Agent-Class"] = "eu.vironlab.vextension.dependency.DependencyAgent"
}
}
}
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
if (System.getProperty("publishName") != null && System.getProperty("publishPassword") != null) {
publishing {
(components["java"] as AdhocComponentWithVariants).withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) {
skip()
}
publications {
create<MavenPublication>(project.name) {
groupId = Properties.group
artifactId = project.name
version = Properties.version
from(components["java"])
pom {
name.set(project.name)
url.set("https://github.com/NeverStopGaming/Backend")
properties.put("inceptionYear", "2021")
licenses {
license {
name.set("All Rights Reserved")
url.set("All Rights Reserved")
distribution.set("repo")
}
}
developers {
developer {
id.set("Chaoten")
name.set("Ben Chaoten")
email.set("chaoten@NeverStopGaming.net")
}
}
}
}
repositories {
maven("https://repo.NeverStopGaming.net/repository/maven-internal/") {
this.name = "maven-internal"
credentials {
this.password = System.getProperty("publishPassword")
this.username = System.getProperty("publishName")
}
}
}
}
}
}