Skip to content

Commit

Permalink
Merge pull request #112 from doki-theme/2023.3
Browse files Browse the repository at this point in the history
Added 2023.3 Build Support.
  • Loading branch information
Unthrottled authored Dec 29, 2023
2 parents 5e66f93 + bb2b6b1 commit 0ee85ed
Show file tree
Hide file tree
Showing 16 changed files with 149 additions and 127 deletions.
11 changes: 11 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## [Unreleased]

## 88.5-1.1.0 [2023.3 Build Support]

### Added
- Initial 2023.3 build support.

## 88.5-1.0.13 [2023.2 Build Support]

### Added
Expand Down
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
### Added
- Initial 2023.2 build support.
- Initial 2023.3 build support.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
// Kotlin support
kotlin("jvm") version "1.8.10"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.13.2"
id("org.jetbrains.intellij") version "1.16.1"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "2.0.0"
// Gradle Qodana Plugin
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

pluginGroup = io.unthrottled.doki.icons
pluginName = Doki Theme Icons
pluginVersion = 88.5-1.0.13
pluginVersion = 88.5-1.1.0

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

# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#intellij-extension
platformType = IU
platformVersion = 2022.3.2
platformVersion = 2023.3.2

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformPlugins = io.acari.DDLCTheme:88.3-1.8.0,Pythonid:223.8617.56
platformPlugins = Pythonid:233.13135.103

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 7.5.1
gradleVersion = 8.5

# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
# suppress inspection "UnusedProperty"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.unthrottled.doki.icons.jetbrains.integrations
import com.google.gson.GsonBuilder
import com.intellij.ide.IdeBundle
import com.intellij.ide.nls.NlsMessages
import com.intellij.ide.plugins.PluginManagerCore
import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.application.ApplicationNamesInfo
Expand All @@ -25,7 +24,6 @@ import io.unthrottled.doki.icons.jetbrains.tools.runSafely
import java.awt.Component
import java.lang.management.ManagementFactory
import java.text.SimpleDateFormat
import java.util.Arrays
import java.util.Properties
import java.util.stream.Collectors

Expand Down Expand Up @@ -100,7 +98,6 @@ class ErrorReporter : ErrorReportSubmitter() {
setExtra("GC", getGC())
setExtra("Memory", Runtime.getRuntime().maxMemory() / FileUtilRt.MEGABYTE)
setExtra("Cores", Runtime.getRuntime().availableProcessors())
setExtra("Non-Bundled Plugins", getNonBundledPlugins())
setExtra("Plugin Config", gson.toJson(Config.instance))
}
}
Expand All @@ -120,12 +117,6 @@ class ErrorReporter : ErrorReportSubmitter() {
return IdeBundle.message("about.box.vm", vmVersion, vmVendor)
}

private fun getNonBundledPlugins(): String {
return Arrays.stream(PluginManagerCore.getPlugins())
.filter { p -> !p.isBundled && p.isEnabled }
.map { p -> p.pluginId.idString }.collect(Collectors.joining(","))
}

private fun getGC() = ManagementFactory.getGarbageCollectorMXBeans().stream()
.map { it.name }.collect(Collectors.joining(","))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.unthrottled.doki.icons.jetbrains.listeners

import com.intellij.openapi.project.Project
import com.intellij.openapi.project.ProjectManagerListener
import com.intellij.openapi.startup.StartupActivity
import com.intellij.openapi.startup.ProjectActivity
import io.unthrottled.doki.icons.jetbrains.PluginMaster
import io.unthrottled.doki.icons.jetbrains.tools.Logging

Expand All @@ -14,8 +14,9 @@ internal class ProjectListener :
}
}

internal class PluginPostStartUpActivity : StartupActivity {
override fun runActivity(project: Project) {
internal class PluginPostStartUpActivity : ProjectActivity {

override suspend fun execute(project: Project) {
PluginMaster.instance.handleProjectOpened(project)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private fun buildUpdateMessage(): String =
"""
What's New?<br>
<ul>
<li>Added initial 2023.2 build support.</li>
<li>Added initial 2023.3 build support.</li>
</ul>
<br>See the <a href="https://github.com/doki-theme/doki-theme-icons-jetbrains#documentation">documentation</a> for features, usages, and configurations.
<br>The <a href="https://github.com/doki-theme/doki-theme-icons-jetbrains/blob/master/CHANGELOG.md">changelog</a> is available for more details.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.unthrottled.doki.icons.jetbrains.shared

fun toLongArray(bytArray: ByteArray): LongArray {
val digest = LongArray(bytArray.size)
bytArray.forEachIndexed { index, byte -> digest[index] = byte.toLong() }
return digest
}
fun toByteArray(longArray: LongArray): ByteArray {
val digest = ByteArray(longArray.size)
longArray.forEachIndexed { index, byte -> digest[index] = byte.toByte() }
return digest
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
package io.unthrottled.doki.icons.jetbrains.svg

import com.intellij.util.SVGLoader
import com.intellij.util.io.DigestUtil
import io.unthrottled.doki.icons.jetbrains.shared.toByteArray
import io.unthrottled.doki.icons.jetbrains.shared.toLongArray
import io.unthrottled.doki.icons.jetbrains.themes.DokiThemePayload
import io.unthrottled.doki.icons.jetbrains.tools.runSafelyWithResult
import org.w3c.dom.Element

class ComposedSVGColorizer(
private val patchers: List<Patcher>
) : Patcher {
override fun patchColors(svg: Element) {
patchers.forEach {
it.patchColors(svg)
}
}

override fun digest(): ByteArray? {
val shaDigest = DigestUtil.sha512()
patchers.forEach { patchers ->
shaDigest.update(patchers.digest() ?: emptyByteArray)
override fun patchColors(attributes: MutableMap<String, String>) {
patchers.forEach {
it.patchColors(attributes)
}
return shaDigest.digest()
}
}

Expand All @@ -39,12 +32,24 @@ class ComposedSVGColorizerProvider(
)
.distinct()

override fun forPath(path: String?): SVGLoader.SvgElementColorPatcher? =
private val digest: LongArray

init {
val shaDigest = DigestUtil.sha512()
patcherProviders.forEach { patchers ->
shaDigest.update(toByteArray(patchers.digest()))
}
digest = toLongArray(shaDigest.digest())
}

override fun digest(): LongArray = digest

override fun attributeForPath(path: String): Patcher =
ComposedSVGColorizer(
patcherProviders
.mapNotNull { patcherProvider ->
runSafelyWithResult({
patcherProvider.forPath(path)
patcherProvider.attributeForPath(path)
}) {
null
}
Expand Down
Loading

0 comments on commit 0ee85ed

Please sign in to comment.