Skip to content

Commit

Permalink
Merge pull request #1 from zeekbyte/zeekbyte/feat/upgrade-compatibili…
Browse files Browse the repository at this point in the history
…ty-idea-2024.2.1

feat(0.1.6): upgrade compatibility with IntelliJ IDEA 2024.2.1
  • Loading branch information
zeekbyte authored Sep 13, 2024
2 parents 951987d + 06ed029 commit 56b1443
Show file tree
Hide file tree
Showing 8 changed files with 153 additions and 86 deletions.
1 change: 1 addition & 0 deletions .intellijPlatform/self-update.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2024-09-14
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

### Added

## [0.1.6] 13-09.2024
- Fixed for compatibility with IntelliJ IDEA 2024.2.1

## [0.1.5] - 15.11.2022
- Added line coverage colors

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 🏙 Tokyo Night
> I forked from the repository [tokyonight-jetbrains](https://github.com/alexadhy/tokyonight-jetbrains) and continued to maintain it.
<!-- Plugin description -->

Expand Down
182 changes: 108 additions & 74 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,92 +1,76 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML

fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
import org.jetbrains.intellij.platform.gradle.TestFrameworkType

plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.8.10"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.13.2"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "2.0.0"
// Gradle Qodana Plugin
id("org.jetbrains.qodana") version "0.1.13"
// Gradle Kover Plugin
id("org.jetbrains.kotlinx.kover") version "0.6.1"
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
}

group = properties("pluginGroup").get()
version = properties("pluginVersion").get()
group = providers.gradleProperty("pluginGroup").get()
version = providers.gradleProperty("pluginVersion").get()

// Set the JVM language level used to build the project.
kotlin {
jvmToolchain(17)
}

// Configure project's dependencies
repositories {
mavenCentral()
}

// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
jvmToolchain(11)
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
intellijPlatform {
defaultRepositories()
}
}

// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
pluginName.set(properties("pluginName"))
version.set(properties("platformVersion"))
type.set(properties("platformType"))

// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins.set(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) })
}
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies {
testImplementation(libs.junit)

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl.set(properties("pluginRepositoryUrl"))
}
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
intellijPlatform {
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))

// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
qodana {
cachePath.set(provider { file(".qodana").canonicalPath })
reportPath.set(provider { file("build/reports/inspections").canonicalPath })
saveReport.set(true)
showReport.set(environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false))
}
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover.xmlReport {
onCheck.set(true)
}
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })

tasks {
wrapper {
gradleVersion = properties("gradleVersion").get()
instrumentationTools()
pluginVerifier()
zipSigner()
testFramework(TestFrameworkType.Platform)
}
}

patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
untilBuild.set(properties("pluginUntilBuild"))
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
intellijPlatform {
pluginConfiguration {
version = providers.gradleProperty("pluginVersion")

// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
val start = "<!-- Plugin description -->"
val end = "<!-- Plugin description end -->"

with (it.lines()) {
with(it.lines()) {
if (!containsAll(listOf(start, end))) {
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
}
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
}
})
}

val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
changeNotes.set(properties("pluginVersion").map { pluginVersion ->
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
Expand All @@ -95,30 +79,80 @@ tasks {
Changelog.OutputType.HTML,
)
}
})
}
}

// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
systemProperty("robot-server.port", "8082")
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
systemProperty("jb.consents.confirmation.enabled", "false")
ideaVersion {
sinceBuild = providers.gradleProperty("pluginSinceBuild")
untilBuild = providers.gradleProperty("pluginUntilBuild")
}
}

signPlugin {
certificateChain.set(environment("CERTIFICATE_CHAIN"))
privateKey.set(environment("PRIVATE_KEY"))
password.set(environment("PRIVATE_KEY_PASSWORD"))
signing {
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
privateKey = providers.environmentVariable("PRIVATE_KEY")
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}

publishPlugin {
dependsOn("patchChangelog")
token.set(environment("PUBLISH_TOKEN"))
publishing {
token = providers.environmentVariable("PUBLISH_TOKEN")
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
channels.set(properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) })
channels = providers.gradleProperty("pluginVersion")
.map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
}

pluginVerification {
ides {
recommended()
}
}
}

// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
changelog {
groups.empty()
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
}

// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
kover {
reports {
total {
xml {
onCheck = true
}
}
}
}

tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
}

publishPlugin {
dependsOn(patchChangelog)
}
}

intellijPlatformTesting {
runIde {
register("runIdeForUiTests") {
task {
jvmArgumentProviders += CommandLineArgumentProvider {
listOf(
"-Drobot-server.port=8082",
"-Dide.mac.message.dialogs.as.sheets=false",
"-Djb.privacy.policy.text=<!--999.999-->",
"-Djb.consents.confirmation.enabled=false",
)
}
}

plugins {
robotServerPlugin()
}
}
}
}
17 changes: 11 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html

pluginGroup = com.alex.tokyonight
pluginGroup = com.zeekbyte.tokyonight
pluginName = TokyoNight Theme
pluginRepositoryUrl = https://github.com/Inf166/theme-jetbrains-tokyonight
# SemVer format -> https://semver.org
pluginVersion = 0.1.5
pluginVersion = 0.1.6

# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
pluginSinceBuild = 203
pluginUntilBuild = 235.*
pluginSinceBuild = 233
pluginUntilBuild = 242.*

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IC
platformVersion = 2023.1
platformVersion = 2023.3.7

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

# Example: platformBundledPlugins = com.intellij.java
platformBundledPlugins =

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.0.2
gradleVersion = 8.9

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
# suppress inspection "UnusedProperty"
Expand All @@ -29,3 +32,5 @@ kotlin.stdlib.default.dependency = false
# suppress inspection "UnusedProperty"
org.gradle.unsafe.configuration-cache = true

# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true
20 changes: 20 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[versions]
# libraries
junit = "4.13.2"

# plugins
changelog = "2.2.1"
intelliJPlatform = "2.0.1"
kotlin = "1.9.25"
kover = "0.8.3"
qodana = "2024.1.9"

[libraries]
junit = { group = "junit", name = "junit", version.ref = "junit" }

[plugins]
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 7 additions & 5 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<idea-plugin>

<id>com.alex.tokyonight</id>
<id>com.zeekbtye.tokyonight</id>
<name>Tokyo Night Theme</name>
<vendor email="joel@maispace.de" url="https://github.com/Inf166">Joel Maximilian Mai</vendor>
<vendor email="contact@zeekbyte.com" url="https://github.com/zeekbyte">zeekbyte</vendor>

<description>
<![CDATA[
Tokyo Night is a theme ported from wildly popular (https://github.com/enkia/tokyo-night-vscode-theme).
Currently only Tokyo Night Storm is available, but that could change later.
I forked from the repository [tokyonight-jetbrains](https://github.com/alexadhy/tokyonight-jetbrains) and continued to maintain it.
]]>
</description>

<depends>com.intellij.modules.platform</depends>

<extensions defaultExtensionNs="com.intellij">
<themeProvider id="com.alex.tokyonight-storm" path="/themes/TokyoNightStorm.theme.json"/>
<themeProvider id="com.alex.tokyonight-dark" path="/themes/TokyoNightDark.theme.json"/>
<!--<themeProvider id="com.alex.tokyonight-day" path="/themes/TokyoNightDay.theme.json"/>-->
<themeProvider id="com.zeekbyte.tokyonight-storm" path="/themes/TokyoNightStorm.theme.json"/>
<themeProvider id="com.zeekbyte.tokyonight-dark" path="/themes/TokyoNightDark.theme.json"/>
<themeProvider id="com.zeekbyte.tokyonight-day" path="/themes/TokyoNightDay.theme.json"/>
</extensions>

</idea-plugin>

0 comments on commit 56b1443

Please sign in to comment.