Skip to content

Commit 90321a2

Browse files
authored
2.1.1 - Migrate to Kotlin and upgrade dependencies (#16)
1 parent ef6659a commit 90321a2

File tree

8 files changed

+81
-262
lines changed

8 files changed

+81
-262
lines changed

build.gradle

-56
This file was deleted.

build.gradle.kts

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
fun properties(key: String) = project.findProperty(key).toString()
4+
5+
plugins {
6+
id("java")
7+
id("org.jetbrains.kotlin.jvm") version "1.6.21"
8+
id("org.jetbrains.intellij") version "1.5.3"
9+
}
10+
apply(plugin = "org.jetbrains.intellij")
11+
apply(plugin = "java")
12+
apply(plugin = "idea")
13+
14+
group = "com.herbert.george.flutter-snippets"
15+
16+
var versionString: String = "${properties("version")}-${properties("releaseChannel")}-${properties("iteration")}"
17+
18+
version = versionString
19+
20+
repositories {
21+
mavenCentral()
22+
}
23+
24+
dependencies {
25+
testImplementation("junit:junit:4.12")
26+
}
27+
28+
tasks {
29+
// Set the JVM compatibility versions
30+
properties("javaVersion").let {
31+
withType<JavaCompile> {
32+
sourceCompatibility = it
33+
targetCompatibility = it
34+
}
35+
withType<KotlinCompile> {
36+
kotlinOptions.jvmTarget = it
37+
}
38+
}
39+
patchPluginXml {
40+
version.set(versionString)
41+
changeNotes.set("Upgrade project to run use Kotlin and the latest IntelliJ plugins and IDEs")
42+
sinceBuild.set(properties("pluginSinceBuild"))
43+
}
44+
publishPlugin {
45+
channels.set(listOf(properties("releaseChannel")))
46+
token.set(properties("intellijToken"))
47+
}
48+
runPluginVerifier {
49+
ideVersions.set(
50+
listOf(
51+
"IC-221.5591.52",
52+
"IC-222.2270.31"
53+
)
54+
)
55+
verifierVersion.set("latest")
56+
}
57+
}
58+
59+
intellij {
60+
plugins.set(
61+
listOf("java", "Dart:${properties("dartVersion")}", "io.flutter:${properties("flutterVersion")}")
62+
)
63+
version.set(properties("ideaVersion"))
64+
type.set(properties("ideaType"))
65+
pluginName.set(properties("pluginName"))
66+
}
67+
68+
69+

settings.gradle

-2
This file was deleted.

settings.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rootProject.name = "flutter-snippets"
2+

src/main/java/FlutterContext.java

-14
This file was deleted.

src/main/kotlin/FlutterContext.kt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import com.intellij.codeInsight.template.TemplateActionContext
2+
import com.intellij.codeInsight.template.TemplateContextType
3+
4+
class FlutterContext protected constructor() : TemplateContextType("FLUTTER", "Flutter") {
5+
override fun isInContext(templateActionContext: TemplateActionContext): Boolean {
6+
return templateActionContext.file.name.endsWith(".dart")
7+
}
8+
}

src/main/resources/META-INF/plugin.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<idea-plugin>
2+
<idea-plugin url="https://plugins.jetbrains.com/plugin/12348-flutter-snippets">
33
<id>com.herbert.george.flutter-snippets</id>
44
<name>Flutter Snippets</name>
55
<vendor>George Herbert</vendor>
66
<description><![CDATA[
7-
For full details of the available snippet, please <a href="https://github.com/georgeherby/flutter-snippets/blob/master/README.md">visit here</a>
7+
For full details of the available snippets, please <a href="https://github.com/georgeherby/flutter-snippets/blob/master/README.md">visit here</a>
88
]]></description>
99
<depends>com.intellij.modules.java</depends>
1010
<extensions defaultExtensionNs="com.intellij">

verifier.gradle

-188
This file was deleted.

0 commit comments

Comments
 (0)