-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
124 lines (112 loc) · 3.94 KB
/
build.gradle.kts
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
124
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))
}
}
}
dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
implementation("com.squareup.okhttp3:okhttp:4.9.3")
compileOnly(getDependency("minecraft","velocity"))
compileOnly(getDependency("minecraft","bungee"))
implementation(kotlin("stdlib-jdk8"))
}
tasks.test {
useJUnit()
}
tasks.withType<KotlinCompile>() {
kotlinOptions.jvmTarget = "1.8"
}
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"
}
}
}
}
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")
}
}
}
}
}
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}