Skip to content

Instantly share code, notes, and snippets.

@Nessiesson
Created March 7, 2020 17:50
Show Gist options
  • Save Nessiesson/acf961d26c7f8a3aeba55d7bcae62ce4 to your computer and use it in GitHub Desktop.
Save Nessiesson/acf961d26c7f8a3aeba55d7bcae62ce4 to your computer and use it in GitHub Desktop.
buildscript {
ext.kotlin_version = '1.3.70'
repositories {
jcenter()
maven { url = "https://files.minecraftforge.net/maven" }
maven { url = "https://repo.spongepowered.org/maven" }
maven { url = "https://plugins.gradle.org/m2" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.4"
}
}
apply plugin: "kotlin"
apply plugin: "net.minecraftforge.gradle.liteloader"
apply plugin: "org.spongepowered.mixin"
apply plugin: "com.github.johnrengelman.shadow"
version = "1.0.0"
def mcVersion = "'"
if (!project.hasProperty("mcVersion")) {
mcVersion = "1.12.2"
} else {
mcVersion = project.getProperty("mcVersion")
}
println mcVersion
def modName = "KotlinMod".toString()
def modId = modName.toLowerCase()
group = "nessiesson.$modId"
minecraft {
version = mcVersion
mappings = "stable_39"
runDir = "run"
makeObfSourceJar = false
replace "@VERSION@", project.version
replace "@NAME@", modName
}
mixin {
defaultObfuscationEnv notch
add sourceSets.main, "mixins.${modId}.refmap.json"
}
litemod.json {
author = "nessie".toString()
name = modName
displayName = modName
mcversion = mcVersion
description = "A very KotlinMod."
mixinConfigs += "mixins.${modId}.json".toString()
}
jar {
classifier = ""
baseName = "$modName-$mcVersion"
from litemod.outputs
}
runClient {
jvmArgs "-Dmixin.debug=true"
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
shadowJar {
classifier = ""
extension = project.jar.extension
}
tasks.build.dependsOn(shadowJar)
compileKotlin.kotlinOptions.jvmTarget = "1.8"
compileTestKotlin.kotlinOptions.jvmTarget = "1.8"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment