Skip to content

Commit 3b6fd55

Browse files
committed
update, sync template 1.7.0
1 parent 95ff3c5 commit 3b6fd55

File tree

5 files changed

+118
-58
lines changed

5 files changed

+118
-58
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# Plugin Changelog
44

55
## [Unreleased]
6+
- add mapper (dart_mappble)
67
- support 232.*
8+
- remove untilBuild
79

810
## [2.231.1]
911
- support 231.*

build.gradle.kts

Lines changed: 81 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,123 @@
1+
import org.jetbrains.changelog.Changelog
12
import org.jetbrains.changelog.markdownToHTML
2-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33

4-
fun properties(key: String) = project.findProperty(key).toString()
4+
fun properties(key: String) = providers.gradleProperty(key)
5+
fun environment(key: String) = providers.environmentVariable(key)
56

67
plugins {
7-
// Java support
8-
id("java")
9-
// Kotlin support
10-
id("org.jetbrains.kotlin.jvm") version "1.6.0"
11-
// Gradle IntelliJ Plugin
12-
id("org.jetbrains.intellij") version "1.11.0"
13-
// Gradle Changelog Plugin
14-
id("org.jetbrains.changelog") version "1.3.1"
15-
// Gradle Qodana Plugin
16-
id("org.jetbrains.qodana") version "0.1.13"
8+
id("java") // Java support
9+
alias(libs.plugins.kotlin) // Kotlin support
10+
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
11+
alias(libs.plugins.changelog) // Gradle Changelog Plugin
12+
alias(libs.plugins.qodana) // Gradle Qodana Plugin
13+
alias(libs.plugins.kover) // Gradle Kover Plugin
1714
}
1815

19-
group = properties("pluginGroup")
20-
version = properties("pluginVersion")
16+
group = properties("pluginGroup").get()
17+
version = properties("pluginVersion").get()
2118

2219
// Configure project's dependencies
2320
repositories {
2421
mavenCentral()
2522
}
2623

27-
// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
24+
25+
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
26+
dependencies {
27+
// implementation(libs.annotations)
28+
}
29+
30+
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
31+
kotlin {
32+
jvmToolchain(17)
33+
}
34+
35+
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
2836
intellij {
29-
pluginName.set(properties("pluginName"))
30-
version.set(properties("platformVersion"))
31-
type.set(properties("platformType"))
37+
pluginName = properties("pluginName")
38+
version = properties("platformVersion")
39+
type = properties("platformType")
3240

3341
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
34-
plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
42+
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
3543
}
3644

45+
3746
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
3847
changelog {
39-
version.set(properties("pluginVersion"))
40-
groups.set(emptyList())
48+
groups.empty()
49+
repositoryUrl = properties("pluginRepositoryUrl")
50+
}
51+
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
52+
qodana {
53+
cachePath = provider { file(".qodana").canonicalPath }
54+
reportPath = provider { file("build/reports/inspections").canonicalPath }
55+
saveReport = true
56+
showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false)
4157
}
4258

43-
tasks {
44-
// Set the JVM compatibility versions
45-
properties("javaVersion").let {
46-
withType<JavaCompile> {
47-
sourceCompatibility = it
48-
targetCompatibility = it
49-
}
50-
withType<KotlinCompile> {
51-
kotlinOptions.jvmTarget = it
59+
60+
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
61+
koverReport {
62+
defaults {
63+
xml {
64+
onCheck = true
5265
}
5366
}
67+
}
5468

69+
tasks {
5570
wrapper {
56-
gradleVersion = properties("gradleVersion")
71+
gradleVersion = properties("gradleVersion").get()
5772
}
5873

5974
patchPluginXml {
60-
version.set(properties("pluginVersion"))
61-
sinceBuild.set(properties("pluginSinceBuild"))
62-
untilBuild.set(properties("pluginUntilBuild"))
75+
version = properties("pluginVersion")
76+
sinceBuild = properties("pluginSinceBuild")
77+
untilBuild = properties("pluginUntilBuild")
6378

6479
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
80+
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
81+
with (it.lines()) {
82+
joinToString("\n").let(::markdownToHTML)
83+
}
84+
}
6585

66-
pluginDescription.set(
67-
File("./DESCRIPTION.md")
68-
.readText().lines()
69-
.joinToString("\n")
70-
.run { markdownToHTML(this) }
71-
)
72-
86+
val changelog = project.changelog // local variable for configuration cache compatibility
7387
// Get the latest available change notes from the changelog file
74-
changeNotes.set(provider {
75-
changelog.run {
76-
getOrNull(properties("pluginVersion")) ?: getLatest()
77-
}.toHTML()
78-
})
88+
changeNotes = properties("pluginVersion").map { pluginVersion ->
89+
with(changelog) {
90+
renderItem(
91+
(getOrNull(pluginVersion) ?: getUnreleased())
92+
.withHeader(false)
93+
.withEmptySections(false),
94+
Changelog.OutputType.HTML,
95+
)
96+
}
97+
}
98+
}
99+
100+
// Configure UI tests plugin
101+
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
102+
runIdeForUiTests {
103+
systemProperty("robot-server.port", "8082")
104+
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
105+
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
106+
systemProperty("jb.consents.confirmation.enabled", "false")
79107
}
80108

81109
signPlugin {
82-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
83-
privateKey.set(System.getenv("PRIVATE_KEY"))
84-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
110+
certificateChain = environment("CERTIFICATE_CHAIN")
111+
privateKey = environment("PRIVATE_KEY")
112+
password = environment("PRIVATE_KEY_PASSWORD")
85113
}
86114

87115
publishPlugin {
88116
dependsOn("patchChangelog")
89-
token.set(System.getenv("PUBLISH_TOKEN"))
90-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
117+
token = environment("PUBLISH_TOKEN")
118+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
91119
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
92120
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
93-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
121+
channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
94122
}
95-
}
123+
}

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
33
pluginGroup=com.github.tbm98.fluttergeneratorsnippets
44
pluginName=flutter_generator_snippets
5-
pluginVersion=2.232.0
5+
pluginVersion=2.232.1
66

77

88
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
99
# for insight into build numbers and IntelliJ Platform versions.
1010
pluginSinceBuild = 203
11-
pluginUntilBuild = 232.*
11+
#pluginUntilBuild = 232.*
1212

1313
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1414
platformType = IC
15-
platformVersion = 2022.1.4
15+
platformVersion = 2022.3
1616

1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1818
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1919
platformPlugins =
2020

2121
# Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3
22-
javaVersion = 11
22+
#javaVersion = 11
2323

2424
# Gradle Releases -> https://github.com/gradle/gradle/releases
25-
gradleVersion = 8.1
25+
gradleVersion = 8.1.1
2626

2727
# Opt-out flag for bundling Kotlin standard library.
2828
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.

gradle/libs.versions.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[versions]
2+
# libraries
3+
annotations = "24.0.1"
4+
5+
# plugins
6+
dokka = "1.8.10"
7+
kotlin = "1.8.21"
8+
changelog = "2.1.0"
9+
gradleIntelliJPlugin = "1.14.1"
10+
qodana = "0.1.13"
11+
kover = "0.7.1"
12+
13+
[libraries]
14+
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
15+
16+
[plugins]
17+
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
18+
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
19+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
20+
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
21+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
22+
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }

src/main/resources/liveTemplates/Flutter_generator_snippets.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,12 @@
6262
<option name="DART_TOPLEVEL" value="true" />
6363
</context>
6464
</template>
65+
<template name="mapper" value="import 'package:dart_mappable/dart_mappable.dart';&#10;&#10;part '$fileName$.mapper.dart';&#10;&#10;@MappableClass(caseStyle: CaseStyle.snakeCase)&#10;class $ClassName$ with $ClassName$Mappable {&#10; &#10; const $ClassName$();&#10; &#10; $Code$&#10;&#10; static const fromMap = $ClassName$Mapper.fromMap;&#10; static const fromJson = $ClassName$Mapper.fromJson;&#10;}" description="Create a dart_mappable." toReformat="false" toShortenFQNames="true">
66+
<variable name="fileName" expression="fileNameWithoutExtension()" defaultValue="" alwaysStopAt="true" />
67+
<variable name="ClassName" expression="" defaultValue="" alwaysStopAt="true" />
68+
<variable name="Code" expression="" defaultValue="" alwaysStopAt="true" />
69+
<context>
70+
<option name="DART_TOPLEVEL" value="true" />
71+
</context>
72+
</template>
6573
</templateSet>

0 commit comments

Comments
 (0)