Skip to content

Commit 38eb0a1

Browse files
committed
Merge branch 'release/v0.0.2-beta' into main
2 parents e780cdf + 080c129 commit 38eb0a1

File tree

13 files changed

+245
-154
lines changed

13 files changed

+245
-154
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
# jetbrains Changelog
44

55
## [Unreleased]
6+
67
### Added
7-
- Initial scaffold created from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)
8+
9+
- Initial scaffold created
10+
from [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- Plugin description -->
12
<h1 align="center">
23
<br>
34
<img src="https://storage.googleapis.com/golden-wind/github/omni/omni.png" alt="Omni Logo" width="100">
@@ -15,6 +16,7 @@
1516

1617
<img alt="License" src="https://img.shields.io/badge/license-MIT-%235FCC6F">
1718
</p>
19+
<!-- Plugin description end -->
1820

1921
<p align="center">
2022
<a href="#install">Install</a> •

build.gradle.kts

Lines changed: 89 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,125 @@
11
import io.gitlab.arturbosch.detekt.Detekt
22
import org.jetbrains.changelog.closure
3+
import org.jetbrains.changelog.date
34
import org.jetbrains.changelog.markdownToHTML
45
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
56

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

89
plugins {
9-
// Java support
10-
id("java")
11-
// Kotlin support
12-
id("org.jetbrains.kotlin.jvm") version "1.4.31"
13-
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
14-
id("org.jetbrains.intellij") version "0.7.2"
15-
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
16-
id("org.jetbrains.changelog") version "1.1.2"
17-
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
18-
id("io.gitlab.arturbosch.detekt") version "1.16.0"
19-
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
20-
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
10+
// Java support
11+
id("java")
12+
// Kotlin support
13+
id("org.jetbrains.kotlin.jvm") version "1.4.31"
14+
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
15+
id("org.jetbrains.intellij") version "0.7.2"
16+
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
17+
id("org.jetbrains.changelog") version "1.1.2"
18+
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
19+
id("io.gitlab.arturbosch.detekt") version "1.15.0"
20+
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
21+
id("org.jlleitschuh.gradle.ktlint") version "10.0.0"
2122
}
2223

2324
group = properties("pluginGroup")
2425
version = properties("pluginVersion")
2526

2627
// Configure project's dependencies
2728
repositories {
28-
mavenCentral()
29-
jcenter()
29+
mavenCentral()
30+
jcenter()
3031
}
3132
dependencies {
32-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0")
33+
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0")
3334
}
3435

3536
// Configure gradle-intellij-plugin plugin.
3637
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
3738
intellij {
38-
pluginName = properties("pluginName")
39-
version = properties("platformVersion")
40-
type = properties("platformType")
41-
downloadSources = properties("platformDownloadSources").toBoolean()
42-
updateSinceUntilBuild = true
43-
44-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
45-
setPlugins(*properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
39+
pluginName = properties("pluginName")
40+
version = properties("platformVersion")
41+
type = properties("platformType")
42+
downloadSources = properties("platformDownloadSources").toBoolean()
43+
updateSinceUntilBuild = true
44+
45+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
46+
setPlugins(*properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray())
4647
}
4748

4849
// Configure gradle-changelog-plugin plugin.
4950
// Read more: https://github.com/JetBrains/gradle-changelog-plugin
5051
changelog {
51-
version = properties("pluginVersion")
52-
groups = emptyList()
52+
version = properties("pluginVersion")
53+
path = "${project.projectDir}/CHANGELOG.md"
54+
header = closure { "[$version] - ${date()}" }
55+
itemPrefix = "-"
56+
keepUnreleasedSection = true
57+
unreleasedTerm = "[Unreleased]"
58+
groups = listOf("Added", "Changed", "Deprecated", "Removed", "Fixed", "Security")
5359
}
5460

5561
// Configure detekt plugin.
5662
// Read more: https://detekt.github.io/detekt/kotlindsl.html
5763
detekt {
58-
config = files("./detekt-config.yml")
59-
buildUponDefaultConfig = true
60-
61-
reports {
62-
html.enabled = false
63-
xml.enabled = false
64-
txt.enabled = false
65-
}
64+
config = files("./detekt-config.yml")
65+
buildUponDefaultConfig = true
66+
67+
reports {
68+
html.enabled = false
69+
xml.enabled = false
70+
txt.enabled = false
71+
}
6672
}
6773

6874
tasks {
69-
// Set the compatibility versions to 1.8
70-
withType<JavaCompile> {
71-
sourceCompatibility = "1.8"
72-
targetCompatibility = "1.8"
73-
}
74-
withType<KotlinCompile> {
75-
kotlinOptions.jvmTarget = "1.8"
76-
}
77-
78-
withType<Detekt> {
79-
jvmTarget = "1.8"
80-
}
81-
82-
patchPluginXml {
83-
version(properties("pluginVersion"))
84-
sinceBuild(properties("pluginSinceBuild"))
85-
untilBuild(properties("pluginUntilBuild"))
86-
87-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
88-
pluginDescription(
89-
closure {
90-
File("./README.md").readText().lines().run {
91-
val start = "<!-- Plugin description -->"
92-
val end = "<!-- Plugin description end -->"
93-
94-
if (!containsAll(listOf(start, end))) {
95-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
96-
}
97-
subList(indexOf(start) + 1, indexOf(end))
98-
}.joinToString("\n").run { markdownToHTML(this) }
99-
}
100-
)
101-
102-
// Get the latest available change notes from the changelog file
103-
changeNotes(
104-
closure {
105-
changelog.getLatest().toHTML()
106-
}
107-
)
108-
}
109-
110-
runPluginVerifier {
111-
ideVersions(properties("pluginVerifierIdeVersions"))
112-
}
113-
114-
publishPlugin {
115-
dependsOn("patchChangelog")
116-
token(System.getenv("PUBLISH_TOKEN"))
117-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
118-
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
119-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
120-
channels(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())
121-
}
75+
// Set the compatibility versions to 1.8
76+
withType<JavaCompile> {
77+
sourceCompatibility = "1.8"
78+
targetCompatibility = "1.8"
79+
}
80+
withType<KotlinCompile> {
81+
kotlinOptions.jvmTarget = "1.8"
82+
}
83+
84+
withType<Detekt> {
85+
jvmTarget = "1.8"
86+
}
87+
88+
patchPluginXml {
89+
version(properties("pluginVersion"))
90+
sinceBuild(properties("pluginSinceBuild"))
91+
untilBuild(properties("pluginUntilBuild"))
92+
pluginDescription(
93+
closure {
94+
File("./README.md").readText().lines().run {
95+
val start = "<!-- Plugin description -->"
96+
val end = "<!-- Plugin description end -->"
97+
98+
if (!containsAll(listOf(start, end))) {
99+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
100+
}
101+
subList(indexOf(start) + 1, indexOf(end))
102+
}.joinToString("\n").run { markdownToHTML(this) }
103+
}
104+
)
105+
106+
changeNotes(
107+
closure {
108+
changelog.getUnreleased().toHTML()
109+
}
110+
)
111+
}
112+
113+
runPluginVerifier {
114+
ideVersions(properties("pluginVerifierIdeVersions"))
115+
}
116+
117+
publishPlugin {
118+
dependsOn("patchChangelog")
119+
token(System.getenv("PUBLISH_TOKEN"))
120+
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
121+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
122+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
123+
channels(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first())
124+
}
122125
}

gradle.properties

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
# IntelliJ Platform Artifacts Repositories
22
# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
3-
4-
pluginGroup = com.github.mayconsgs.jetbrains
5-
pluginName = Omni Theme
6-
pluginVersion = 0.0.1
7-
pluginSinceBuild = 202
8-
pluginUntilBuild = 203.*
9-
pluginVerifierIdeVersions = 2020.2.4, 2020.3.2, 2021.1
10-
11-
platformType = IC
12-
platformVersion = 2020.2.4
13-
platformDownloadSources = true
14-
platformPlugins =
15-
3+
pluginGroup=com.github.mayconsgs.jetbrains
4+
pluginName=Omni Theme
5+
pluginVersion=0.0.2
6+
pluginSinceBuild=202
7+
pluginUntilBuild=203.*
8+
pluginVerifierIdeVersions=2020.2.4, 2020.3.2, 2021.1
9+
platformType=IC
10+
platformVersion=2020.2.4
11+
platformDownloadSources=true
12+
platformPlugins=
1613
# Opt-out flag for bundling Kotlin standard library.
1714
# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.
18-
kotlin.stdlib.default.dependency = false
15+
kotlin.stdlib.default.dependency=false

src/main/kotlin/com/github/mayconsgs/jetbrains/MyBundle.kt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import org.jetbrains.annotations.PropertyKey
88
private const val BUNDLE = "messages.MyBundle"
99

1010
object MyBundle : AbstractBundle(BUNDLE) {
11-
12-
@Suppress("SpreadOperator")
13-
@JvmStatic
14-
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
15-
getMessage(key, *params)
16-
17-
@Suppress("SpreadOperator")
18-
@JvmStatic
19-
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
20-
getLazyMessage(key, *params)
11+
@Suppress("SpreadOperator")
12+
@JvmStatic
13+
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
14+
getMessage(key, *params)
15+
@Suppress("SpreadOperator")
16+
@JvmStatic
17+
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
18+
getLazyMessage(key, *params)
2119
}

src/main/kotlin/com/github/mayconsgs/jetbrains/listeners/MyProjectManagerListener.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import com.intellij.openapi.project.Project
66
import com.intellij.openapi.project.ProjectManagerListener
77

88
internal class MyProjectManagerListener : ProjectManagerListener {
9-
10-
override fun projectOpened(project: Project) {
11-
project.service<MyProjectService>()
12-
}
9+
override fun projectOpened(project: Project) {
10+
project.service<MyProjectService>()
11+
}
1312
}

src/main/kotlin/com/github/mayconsgs/jetbrains/services/MyApplicationService.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ package com.github.mayconsgs.jetbrains.services
33
import com.github.mayconsgs.jetbrains.MyBundle
44

55
class MyApplicationService {
6-
7-
init {
8-
println(MyBundle.message("applicationService"))
9-
}
6+
init {
7+
println(MyBundle.message("applicationService"))
8+
}
109
}

src/main/kotlin/com/github/mayconsgs/jetbrains/services/MyProjectService.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import com.github.mayconsgs.jetbrains.MyBundle
44
import com.intellij.openapi.project.Project
55

66
class MyProjectService(project: Project) {
7-
8-
init {
9-
println(MyBundle.message("projectService", project.name))
10-
}
7+
init {
8+
println(MyBundle.message("projectService", project.name))
9+
}
1110
}
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
<idea-plugin>
2-
<id>com.github.mayconsgs.jetbrains</id>
3-
<name>Omni Theme</name>
4-
<vendor>Maycon Santos</vendor>
5-
<depends>com.intellij.modules.platform</depends>
6-
7-
<extensions defaultExtensionNs="com.intellij">
8-
<applicationService serviceImplementation="com.github.mayconsgs.jetbrains.services.MyApplicationService"/>
9-
<projectService serviceImplementation="com.github.mayconsgs.jetbrains.services.MyProjectService"/>
10-
<themeProvider id="4cdf8912-6063-4823-b4aa-54024f8c94a4" path="/Omni.theme.json"/>
11-
</extensions>
12-
13-
<applicationListeners>
14-
<listener class="com.github.mayconsgs.jetbrains.listeners.MyProjectManagerListener"
15-
topic="com.intellij.openapi.project.ProjectManagerListener"/>
16-
</applicationListeners>
1+
<idea-plugin url="https://github.com/Mayconsgs/jetbrains">
2+
<id>com.github.mayconsgs.jetbrains</id>
3+
<name>Omni Theme</name>
4+
<vendor url="https://github.com/Mayconsgs" email="[email protected]">Maycon Santos</vendor>
5+
<depends>com.intellij.modules.platform</depends>
6+
<extensions defaultExtensionNs="com.intellij">
7+
<applicationService serviceImplementation="com.github.mayconsgs.jetbrains.services.MyApplicationService"/>
8+
<projectService serviceImplementation="com.github.mayconsgs.jetbrains.services.MyProjectService"/>
9+
<themeProvider id="4cdf8912-6063-4823-b4aa-54024f8c94a4" path="/Omni.theme.json"/>
10+
</extensions>
11+
<applicationListeners>
12+
<listener class="com.github.mayconsgs.jetbrains.listeners.MyProjectManagerListener"
13+
topic="com.intellij.openapi.project.ProjectManagerListener"/>
14+
</applicationListeners>
1715
</idea-plugin>

src/main/resources/META-INF/pluginIcon.svg

Lines changed: 10 additions & 5 deletions
Loading

0 commit comments

Comments
 (0)