Skip to content

Instantly share code, notes, and snippets.

@ekgame
Created September 19, 2017 21:14
Show Gist options
  • Save ekgame/f4113c138aa879890ce7b5b2859bbac7 to your computer and use it in GitHub Desktop.
Save ekgame/f4113c138aa879890ce7b5b2859bbac7 to your computer and use it in GitHub Desktop.
Gradle buildscript for bukkit to shadow Kotlin runtime
group 'lt.ekgame' // change the group to what suits you
version '0.0.1-SNAPSHOT'
buildscript {
ext.kotlin_version = '1.1.4-3' // May need to be hhanged
ext.bukkit_version = "1.12.1-R0.1-SNAPSHOT" // May need to be hhanged
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
configurations {
shadow
compile.extendsFrom provided
provided.extendsFrom shadow
}
repositories {
mavenCentral()
maven {
url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
}
dependencies {
shadow "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.bukkit:bukkit:$bukkit_version"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
task fatJar(type: ShadowJar) {
configurations = [project.configurations.shadow]
from(project.sourceSets.main.output)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment