Skip to content

Commit

Permalink
2.1.1 - Migrate to Kotlin and upgrade dependencies (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeherby authored Jun 5, 2022
1 parent ef6659a commit 90321a2
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 262 deletions.
56 changes: 0 additions & 56 deletions build.gradle

This file was deleted.

69 changes: 69 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

fun properties(key: String) = project.findProperty(key).toString()

plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "1.6.21"
id("org.jetbrains.intellij") version "1.5.3"
}
apply(plugin = "org.jetbrains.intellij")
apply(plugin = "java")
apply(plugin = "idea")

group = "com.herbert.george.flutter-snippets"

var versionString: String = "${properties("version")}-${properties("releaseChannel")}-${properties("iteration")}"

version = versionString

repositories {
mavenCentral()
}

dependencies {
testImplementation("junit:junit:4.12")
}

tasks {
// Set the JVM compatibility versions
properties("javaVersion").let {
withType<JavaCompile> {
sourceCompatibility = it
targetCompatibility = it
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = it
}
}
patchPluginXml {
version.set(versionString)
changeNotes.set("Upgrade project to run use Kotlin and the latest IntelliJ plugins and IDEs")
sinceBuild.set(properties("pluginSinceBuild"))
}
publishPlugin {
channels.set(listOf(properties("releaseChannel")))
token.set(properties("intellijToken"))
}
runPluginVerifier {
ideVersions.set(
listOf(
"IC-221.5591.52",
"IC-222.2270.31"
)
)
verifierVersion.set("latest")
}
}

intellij {
plugins.set(
listOf("java", "Dart:${properties("dartVersion")}", "io.flutter:${properties("flutterVersion")}")
)
version.set(properties("ideaVersion"))
type.set(properties("ideaType"))
pluginName.set(properties("pluginName"))
}



2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = "flutter-snippets"

14 changes: 0 additions & 14 deletions src/main/java/FlutterContext.java

This file was deleted.

8 changes: 8 additions & 0 deletions src/main/kotlin/FlutterContext.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import com.intellij.codeInsight.template.TemplateActionContext
import com.intellij.codeInsight.template.TemplateContextType

class FlutterContext protected constructor() : TemplateContextType("FLUTTER", "Flutter") {
override fun isInContext(templateActionContext: TemplateActionContext): Boolean {
return templateActionContext.file.name.endsWith(".dart")
}
}
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<idea-plugin>
<idea-plugin url="https://plugins.jetbrains.com/plugin/12348-flutter-snippets">
<id>com.herbert.george.flutter-snippets</id>
<name>Flutter Snippets</name>
<vendor>George Herbert</vendor>
<description><![CDATA[
For full details of the available snippet, please <a href="https://github.com/georgeherby/flutter-snippets/blob/master/README.md">visit here</a>
For full details of the available snippets, please <a href="https://github.com/georgeherby/flutter-snippets/blob/master/README.md">visit here</a>
]]></description>
<depends>com.intellij.modules.java</depends>
<extensions defaultExtensionNs="com.intellij">
Expand Down
188 changes: 0 additions & 188 deletions verifier.gradle

This file was deleted.

0 comments on commit 90321a2

Please sign in to comment.