From 03f4d5ae8fdeb6a767fefc766f6e4dff33452884 Mon Sep 17 00:00:00 2001 From: hazae41 Date: Thu, 11 Apr 2019 22:31:00 +0200 Subject: [PATCH] Update README.md --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 646a303..020d32b 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,35 @@ It includes Kotlin stdlib and a lot of tools for Minecraft plugins development. [Go to JitPack](https://jitpack.io/#Hazae41/Kotlin4MC/master-SNAPSHOT) +# Getting started + +To avoid classpath conflict, you need to use package relocation + +Add the following **at the top** of your **build.gradle** + + plugins { + id 'com.github.johnrengelman.shadow' version '4.0.2' + } + + import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation + task relocateShadowJar(type: ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = rootProject.name + } + + tasks.shadowJar { + classifier = 'bundle' + dependsOn tasks.relocateShadowJar + } + + artifacts { + archives shadowJar + } + +Then use the shadowJar task to build your jar + +# Usage + ### Simplified componentization You can componentize and colorize any message @@ -465,4 +494,4 @@ val delay = config.getLong("delay").not(0) // Assignment + Check ```kotlin val delay = config.getLong("delay") // Assignment if(delay == 0) return warning("Delay should not be 0") // Check -``` \ No newline at end of file +```