Skip to content

Instantly share code, notes, and snippets.

@autaut03
Created September 16, 2019 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save autaut03/a4b7226d1a6e974bc16e8cdb0f1f8567 to your computer and use it in GitHub Desktop.
Save autaut03/a4b7226d1a6e974bc16e8cdb0f1f8567 to your computer and use it in GitHub Desktop.
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter()
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'kotlin'
apply plugin: 'eclipse'
group = 'net.alexwells.roomery'
archivesBaseName = 'Roomery'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileKotlin.kotlinOptions.jvmTarget = compileTestKotlin.kotlinOptions.jvmTarget = '1.8'
repositories {
maven { url 'https://minecraft.curseforge.com/api/maven/' }
mavenCentral()
}
configurations {
mod
}
dependencies {
minecraft forgeVersion
compile "kottle:Kottle:$kottleVersion"
mod "kottle:Kottle:$kottleVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
minecraft {
mappings channel: mappingsChannel, version: mappingsVersion
runs {
client = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
// console colors
properties 'forge.logging.noansi': 'false'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
}
server = {
// recommended logging data for a userdev environment
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console
properties 'forge.logging.console.level': 'debug'
// console colors
properties 'forge.logging.noansi': 'false'
workingDirectory project.file('run').canonicalPath
source sourceSets.main
}
}
}
task installMods(type: Copy, dependsOn: "deinstallMods") {
from { configurations.mod }
include "**/*.jar"
into file("run/mods")
}
task deinstallMods(type: Delete) {
delete fileTree(dir: "run/mods", include: "*.jar")
}
project.afterEvaluate {
project.tasks['prepareRuns'].dependsOn(project.tasks['installMods'])
}
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