Skip to content

Commit

Permalink
Update dependencies and raise minimum IntelliJ version (#25)
Browse files Browse the repository at this point in the history
* Bump dependencies, openrndr to latest versions

* Raise minimum IntelliJ version to fix https://youtrack.jetbrains.com/issue/KT-58021

* Update changelog

* Remove unneeded gradle property
  • Loading branch information
Vechro authored Jan 6, 2024
1 parent 77dc244 commit 4b5a4fa
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/actions/checkout-intellij-community/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
id: intellij-tag
with:
repository: JetBrains/intellij-community
regex: ^idea\/222\.4554(?:\.\d+)?$
regex: ^idea\/232\.10227(?:\.\d+)?$

- name: Checkout intellij-community repository
uses: actions/checkout@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
uses: ./.github/actions/checkout-intellij-community

- name: Setup Java environment for the next steps
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand All @@ -127,7 +127,7 @@ jobs:
path: ${{ github.workspace }}/build/reports/tests

- name: Add coverage report to PR
uses: mi-kas/kover-report@v1.7
uses: mi-kas/kover-report@v1.8
if: github.event_name == 'pull_request'
with:
path: ${{ github.workspace }}/build/reports/kover/report.xml
Expand All @@ -144,7 +144,7 @@ jobs:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false
Expand All @@ -158,7 +158,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
### Added

### Changed
- Update Kotlin to 1.9.10
- Update gradle-intellij-plugin to 1.15.0
- Update Kotlin to 1.9.22
- Update gradle-intellij-plugin to 1.16.1
- Update OPENRNDR/ORX to 0.4.4
- Raise minimum supported IntelliJ version to 2023.2 due to https://youtrack.jetbrains.com/issue/KT-58021

### Removed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The plugin tests have a dependency on openrndr-color which unfortunately means i
to run the tests.

Make sure you check out intellij-community repository to the same tag you're trying to build the plugin against.
So for example, if this plugin is targeting `222.4554.10`, you will need to run `git switch --detach idea/222.4554.10`.
So for example, if this plugin is targeting `232.10227.8`, you will need to run `git switch --detach idea/232.10227.8`.

Clone https://github.com/JetBrains/intellij-community ([consult their README](https://github.com/JetBrains/intellij-community#getting-intellij-idea-community-edition-source-code=))
in a directory adjacent to where you cloned this project so the resulting directory layout looks like the following.
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ intellij {
pluginName = properties("pluginName")
// https://www.jetbrains.com/intellij-repository/releases/
// https://www.jetbrains.com/intellij-repository/snapshots/
version = "222.4554.10"
version = "232.10227.8"
type = "IC" // Target IDE Platform

plugins = listOf("com.intellij.java", "org.jetbrains.kotlin")
Expand All @@ -64,7 +64,7 @@ val defaultIntellijSourcesPath: String = File("$projectDir/../intellij-community

tasks {
wrapper {
gradleVersion = "8.3"
gradleVersion = "8.5"
}

val test by getting(Test::class) {
Expand All @@ -83,7 +83,7 @@ tasks {

patchPluginXml {
version = properties("pluginVersion")
sinceBuild = "222"
sinceBuild = "232"
// No restrictions on compatible IDE versions
untilBuild = ""

Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

pluginName = OPENRNDR

pluginVersion = 1.1.3
pluginVersion = 1.1.4

# Opt-out flag for bundling Kotlin standard library -> https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library
kotlin.stdlib.default.dependency = false
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
org.gradle.configuration-cache = true
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
org.gradle.caching = true
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
systemProp.org.gradle.unsafe.kotlin.assignment = true
# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom
kotlin.incremental.useClasspathSnapshot = false
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "1.9.10"
openrndr = "0.4.3"
orx = "0.4.3"
kotlin = "1.9.22"
openrndr = "0.4.4"
orx = "0.4.4"

[libraries]
openrndr-color = { group = "org.openrndr", name = "openrndr-color", version.ref = "openrndr" }
Expand All @@ -10,6 +10,6 @@ orx-color = { group = "org.openrndr.extra", name = "orx-color", version.ref = "o

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
intellij = { id = "org.jetbrains.intellij", version = "1.15.0" }
intellij = { id = "org.jetbrains.intellij", version = "1.16.1" }
changelog = { id = "org.jetbrains.changelog", version = "2.2.0" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.intellij.codeInsight.lookup.LookupElementRenderer
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.ui.scale.JBUIScale
import org.jetbrains.kotlin.descriptors.ValueDescriptor
import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject
import org.jetbrains.kotlin.idea.core.completion.DescriptorBasedDeclarationLookupObject
import org.jetbrains.kotlin.psi.KtCallExpression
import org.jetbrains.kotlin.psi.KtDeclarationWithInitializer
import org.openrndr.plugin.intellij.ui.RoundColorIcon
Expand All @@ -22,7 +22,7 @@ class ColorRGBaCompletionContributor : CompletionContributor() {
override fun fillCompletionVariants(parameters: CompletionParameters, result: CompletionResultSet) {
result.runRemainingContributors(parameters) { completionResult ->
val element = completionResult.lookupElement
val lookupObject = element.`object` as? DeclarationLookupObject
val lookupObject = element.`object` as? DescriptorBasedDeclarationLookupObject
val descriptor = (lookupObject?.descriptor as? ValueDescriptor)?.takeIf { it.isColorModelPackage() }
?: return@runRemainingContributors result.passResult(completionResult)
val decoratedLookupElement = element.decorateWithIcon(descriptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class ColorRGBaColorProvider : ElementColorProvider {
val ref =
argumentMap?.firstNotNullOfOrNull { it.takeIf { (p, _) -> p.isRef() }?.value } as? ConstantValueContainer.WhitePoint
val colorArguments = colorRGBaDescriptor.argumentsFromColor(color, ref?.value)
@Suppress("SimpleRedundantLet")
outerExpression.getChildOfType<KtValueArgumentList>()?.let {
it.replace(it.constructReplacement(resolvedCall.valueArguments, colorArguments))
} ?: outerExpression.getChildOfType<KtCallExpression>()?.let {
Expand All @@ -107,7 +108,7 @@ class ColorRGBaColorProvider : ElementColorProvider {
private fun KtValueArgumentList.constructReplacement(
resolvedArgumentMap: Map<ValueParameterDescriptor, ResolvedValueArgument>, replacementArguments: Array<String>
): KtValueArgumentList {
val psiFactory = KtPsiFactory(this)
val psiFactory = KtPsiFactory.contextual(this, true)

// It handles overloads where the resolved function call is not the one we want anymore
// because it is incapable of expressing the desired color accurately, such as `rgb` with 2 arguments.
Expand Down

0 comments on commit 4b5a4fa

Please sign in to comment.