From 04e2a73dc42c23a7441fd7903fe5cf271b24ac46 Mon Sep 17 00:00:00 2001 From: DevSrSouza Date: Wed, 19 Aug 2020 01:41:42 -0300 Subject: [PATCH] adding icon to the plugin, better demonstrations at README and a description for the Plugin --- README.md | 15 +++--- build.gradle.kts | 46 +++++++++++++++---- .../kotlinbukkitapi/tooling/Annotator.kt | 35 -------------- src/main/resources/META-INF/pluginIcon.svg | 1 + 4 files changed, 48 insertions(+), 49 deletions(-) delete mode 100644 src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/tooling/Annotator.kt create mode 100644 src/main/resources/META-INF/pluginIcon.svg diff --git a/README.md b/README.md index b734093..c26b2f9 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,20 @@ -# KotlinBukkitAPI-Tooling [WIP] +# KotlinBukkitAPI-Tooling The KotlinBukkitAPI Tooling is plugin for IntelliJ that helps developers using [KotlinBukkitAPI](https://github.com/DevSrSouza/KotlinBukkitAPI) and scripts for [Bukkript](https://github.com/DevSrSouza/Bukkript). ## Features - [Menu Preview](#Menu-Preview) - -#### Future Features - -- Tooling for Bukkript scripts. +- Tooling for [Bukkript Scripts](#Bukkript-Script). ## Menu Preview When using KotlinBukkitAPI Menu DSL you have a good preview of how the slots are arranged in the Menu in the game. -![Preview](https://media.giphy.com/media/iDOK1cb41kqHCw6BH8/giphy.gif) \ No newline at end of file +![Preview](https://i.imgur.com/9MzzAzs.gif) + +## [Bukkript Script](https://github.com/DevSrSouza/Bukkript/) + +The plugin provides out of the box Bukkript Script resolution (`.bk.kts` files). + +![Preview](https://i.imgur.com/exlwVUs.gif) \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 05b412f..d7428d0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,10 @@ plugins { kotlin("jvm") version "1.4.0" } +val kotlinVersion = "1.4.0" +val kotlinBukkitAPIVersion = "0.1.0-SNAPSHOT" +val bukkriptVersion = "0.1.0-SNAPSHOT" + group = "br.com.devsrsouza.kotlinbukkitapi" version = "0.0.1-SNAPSHOT" @@ -16,7 +20,7 @@ dependencies { implementation(kotlin("stdlib-jdk8")) val changing = Action { isChanging = true } - api("br.com.devsrsouza.bukkript:script-definition-embedded:0.1.0-SNAPSHOT", changing) + api("br.com.devsrsouza.bukkript:script-definition-embedded:$bukkriptVersion", changing) testCompile("junit", "junit", "4.12") } @@ -27,9 +31,11 @@ intellij { setPlugins("java", "Kotlin") } + configure { sourceCompatibility = JavaVersion.VERSION_1_8 } + tasks { compileKotlin { kotlinOptions.jvmTarget = "1.8" @@ -40,14 +46,38 @@ tasks { } tasks.getByName("patchPluginXml") { pluginDescription(""" - The KotlinBukkitAPI Tooling adds Tooling to IntelliJ API when using KotlinBukkitAPI and Bukkript. - """.trimIndent()) -} + + +
-listOf("compileKotlin", "compileTestKotlin").forEach { - tasks.getByName(it) { - kotlinOptions.jvmTarget = "1.8" - } + The KotlinBukkitAPI Tooling is plugin for IntelliJ that helps developers using KotlinBukkitAPI and scripts for Bukkript. This libraries help build extensions for Minecraft Server using Spigot server. + +
+ + + + + + + +
+ + + +
+
+ +

Demonstration

+ +
+ + + """.trimIndent()) } configurations.all { diff --git a/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/tooling/Annotator.kt b/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/tooling/Annotator.kt deleted file mode 100644 index 191a88c..0000000 --- a/src/main/kotlin/br/com/devsrsouza/kotlinbukkitapi/tooling/Annotator.kt +++ /dev/null @@ -1,35 +0,0 @@ -package br.com.devsrsouza.kotlinbukkitapi.tooling - -import com.intellij.lang.annotation.AnnotationHolder -import com.intellij.lang.annotation.Annotator -import com.intellij.openapi.fileEditor.FileEditorManager -import com.intellij.openapi.fileEditor.TextEditorWithPreview -import com.intellij.openapi.wm.IdeFocusManager -import com.intellij.psi.PsiElement -import org.jetbrains.kotlin.psi.KtCallExpression -import javax.swing.SwingUtilities - - -/* -* This annotator if the file has menu declaration, he set the file editor -* to the KotlinBukkitAPI one. -* -object TestAnnotator : Annotator { - override fun annotate(element: PsiElement, holder: AnnotationHolder) { - if(element is KtCallExpression && isMenuCall(element)) { - val project = element.project - val fileEditorManager = FileEditorManager.getInstance(project) - - SwingUtilities.invokeLater { - val virtualFile = element.containingFile.virtualFile - - if(fileEditorManager.selectedEditor is TextEditorWithPreview) return@invokeLater - - fileEditorManager.setSelectedEditor( - virtualFile, - MenuPreviewFileEditorProvider.ID - ) - } - } - } -}*/ diff --git a/src/main/resources/META-INF/pluginIcon.svg b/src/main/resources/META-INF/pluginIcon.svg new file mode 100644 index 0000000..3afaacc --- /dev/null +++ b/src/main/resources/META-INF/pluginIcon.svg @@ -0,0 +1 @@ +kotlinbukkitapi-logo \ No newline at end of file