Skip to content

Migrate to Kotlin and upgrade dependencies #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.