This repository has been archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
126 lines (98 loc) · 2.85 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
125
126
import net.minecraftforge.gradle.user.patcherUser.forge.ForgeExtension
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val kotlinVersion = "1.3.50"
val ktorVersion = "1.2.5"
val coroutinesVersion = "1.3.2"
fun ktor(module: String) = "io.ktor:ktor-$module:$ktorVersion"
fun ktor() = "io.ktor:ktor:$ktorVersion"
val sourceCompatibility = JavaVersion.VERSION_1_8
val targetCompatibility = JavaVersion.VERSION_1_8
var modVersion = "DEV_${Math.abs(System.currentTimeMillis().hashCode())}"
//Getting the Version if we Build on Travis
if (System.getenv()["RELEASE_VERSION"] != null) {
modVersion = "${System.getenv()["RELEASE_VERSION"]}"
}
buildscript {
repositories {
jcenter()
maven { url = uri("http://files.minecraftforge.net/maven") }
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50")
classpath("net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT") {
exclude(group = "net.sf.trove4j", module = "trove4j")
}
}
}
apply(plugin = "net.minecraftforge.gradle.forge")
apply(plugin = "kotlin")
plugins {
kotlin("jvm") version "1.3.50"
kotlin("plugin.serialization") version "1.3.50"
java
idea
}
idea {
module {
inheritOutputDirs = true
}
}
version = modVersion
group = "net.unaussprechlich.warlordsplus"
configure<ForgeExtension> {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_22"
makeObfSourceJar = false
replace("@VERSION@", modVersion)
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
val embed by configurations.creating
configurations.compile.extendsFrom(embed)
repositories {
jcenter()
mavenCentral()
"http://dl.bintray.com/kotlin".let {
maven { setUrl("$it/ktor") }
maven { setUrl("$it/kotlinx") }
}
}
dependencies {
embed(kotlin("stdlib-jdk8"))
embed(kotlin("reflect"))
embed("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
embed(ktor("client-cio"))
embed(ktor("client-serialization-jvm")) {
exclude(group = "org.jetbrains.kotlin")
}
testImplementation(kotlin("test"))
testImplementation(kotlin("test-junit"))
}
tasks.create<Delete>("kotlinCleanHotfix") {
delete = setOf(
"WarlordsPlus.kotlin_module"
)
}
tasks {
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.includeRuntime = true
}
withType<ProcessResources> {
copy {
from("src/main/resources")
into("build/classes/java/main")
}
}
withType<Jar> {
manifest {
attributes("ModSide" to "CLIENT")
}
from(embed.map { if (it.isDirectory) it else zipTree(it) })
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
}
}