forked from BloodyMods/ExNihiloCreatio
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
118 lines (92 loc) · 3.56 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
kotlin("jvm") version "1.3.40"
idea
id("fabric-loom") version "0.2.5-SNAPSHOT"
}
base {
archivesBaseName = ext["archive-base-name"].toString()
}
val minecraft: String by ext
val modVersion = ext["mod-version"] ?: error("Version was null")
val localBuild = ext["local-build"].toString().toBoolean()
version = "$modVersion+$minecraft" + if (localBuild) "-local" else ""
if (localBuild) {
println("Note: local build mode enabled in gradle.properties; all dependencies might not work!")
}
allprojects {
apply(plugin = "java")
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
if (localBuild) {
mavenLocal()
}
maven (url = "https://maven.fabricmc.net/")
maven(url = "https://minecraft.curseforge.com/api/maven") { name = "CurseForge" }
// For cotton, polyester and json-factory
maven(url = "http://server.bbkr.space:8081/artifactory/libs-release")
maven(url = "http://server.bbkr.space:8081/artifactory/libs-snapshot")
// For Artifice
maven (url = "https://maven.swordglowsblue.com" )
// For LibBlockAttributes
maven(url = "https://mod-buildcraft.com/maven") { name = "BuildCraft" }
maven (url = "http://maven.sargunv.s3-website-us-west-2.amazonaws.com/")
jcenter()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.getByName<ProcessResources>("processResources") {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to project.version
)
)
}
}
}
minecraft {
}
inline fun DependencyHandler.modCompileAndInclude(str: String, block: ExternalModuleDependency.() -> Unit = {}) {
modCompile(str, block)
include(str, block)
}
inline fun DependencyHandler.includedMod(str: String, block: ExternalModuleDependency.() -> Unit = {}) {
modImplementation(str, block)
include(str, block)
}
inline fun DependencyHandler.includedMod(group: String, name: String, version: String, block: ExternalModuleDependency.() -> Unit = {}) {
modImplementation(group, name, version, dependencyConfiguration = block)
include(group, name, version, dependencyConfiguration = block)
}
dependencies {
/**
* Gets a version string with the [key].
*/
fun v(key: String) = ext[key].toString()
minecraft("com.mojang:minecraft:"+v("minecraft"))
mappings("net.fabricmc:yarn:"+v("yarn_mappings"))
// Fabric
modCompile("net.fabricmc:fabric-loader:"+v("loader_version"))
modCompile("net.fabricmc.fabric-api:fabric-api:"+v("fabric_api"))
modCompile("net.fabricmc:fabric-language-kotlin:"+v("fabric_kotlin"))
compileOnly("net.fabricmc:fabric-language-kotlin:"+v("fabric_kotlin"))
// Other mods
modCompileAndInclude("towelette:Towelette:"+v("towelette_version"))
modCompileAndInclude("io.github.cottonmc:cotton:"+v("cotton_version"))
modCompile("alexiil.mc.lib:libblockattributes-all:" + v("libblockattributes_version"))
// Artifice
modImplementation("artificemc:artifice:"+v("artifice_version"))
include("artificemc:artifice:"+v("artifice_version"))
// Roughly Enough Items
modCompile("me.shedaniel:RoughlyEnoughItems:"+v("rei_version"))
// Other libraries
compileOnly("org.apiguardian:apiguardian-api:1.0.0")
}