-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
83 lines (71 loc) · 2.44 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
import net.minecraftforge.gradle.user.UserBaseExtension
import org.gradle.jvm.tasks.Jar
// gradle.properties
val modGroup: String by extra
val modVersion: String by extra
val modBaseName: String by extra
val forgeVersion: String by extra
val mappingVersion: String by extra
buildscript {
repositories {
mavenCentral()
maven(url = "https://files.minecraftforge.net/maven")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
classpath("net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT") {
//classpath("net.minecraftforge.gradle.forge:net.minecraftforge.gradle.forge.gradle.plugin:2.0.2") {
isChanging = true
}
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50")
}
}
plugins {
java
scala
}
apply {
plugin("net.minecraftforge.gradle.forge")
plugin("kotlin")
}
version = modVersion
group = modGroup
configure<UserBaseExtension> {
version = forgeVersion
runDir = "run"
// the mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work.
// simply re-run your setup task after changing the mappings to update your workspace.
mappings = mappingVersion
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
}
repositories {
jcenter()
mavenCentral()
maven(url = "http://maven.shadowfacts.net/")
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.50")
implementation("net.shadowfacts:Forgelin:1.8.4")
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}
// processResources
val Project.minecraft: UserBaseExtension
get() = extensions.getByName<UserBaseExtension>("minecraft")
tasks.withType<Jar> {
// this will ensure that this task is redone when the versions change.
inputs.properties += "version" to project.version
inputs.properties += "mcversion" to project.minecraft.version
baseName = modBaseName
// replace stuff in mcmod.info, nothing else
filesMatching("/mcmod.info") {
expand(
mapOf(
"version" to project.version,
"mcversion" to project.minecraft.version
)
)
}
}