Skip to content

Commit

Permalink
Merge pull request #33 from lipiridi/feature/2024.3-compatibility
Browse files Browse the repository at this point in the history
Feature/2024.3 compatibility
  • Loading branch information
lipiridi authored Nov 14, 2024
2 parents 20976fc + 03ff4ea commit 899fab9
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 28 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
uses: gradle/actions/setup-gradle@v4

# Set environment variables
- name: Export Properties
Expand Down Expand Up @@ -115,9 +113,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
uses: gradle/actions/setup-gradle@v4

# Run tests
- name: Run Tests
Expand Down Expand Up @@ -164,9 +160,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
uses: gradle/actions/setup-gradle@v4

# Cache Plugin Verifier IDEs
- name: Setup Plugin Verifier IDEs Cache
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
uses: gradle/actions/setup-gradle@v4

# Set environment variables
- name: Export Properties
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/run-ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ jobs:

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
uses: gradle/actions/setup-gradle@v4

# Run IDEA prepared for UI testing
- name: Run IDE
Expand Down
5 changes: 3 additions & 2 deletions .run/Run Plugin.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Plugin" type="GradleRunConfiguration" factoryName="Gradle">
<log_file alias="idea.log" path="$PROJECT_DIR$/build/idea-sandbox/system/log/idea.log" />
<log_file alias="IDE logs" path="$PROJECT_DIR$/build/idea-sandbox/*/log/idea.log" show_all="true" />
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
Expand All @@ -19,6 +19,7 @@
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
</component>
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]

### Changed

- [#32](https://github.com/lipiridi/spotless-applier/issues/32) Update version compatibility
- [#32](https://github.com/lipiridi/spotless-applier/issues/32) Store pre-commit state in workspace

## [1.1.3] - 2024-10-10

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Downloads](https://img.shields.io/jetbrains/plugin/d/22455.svg)](https://plugins.jetbrains.com/plugin/22455)

<!-- Plugin description -->
> ⚠️ Version 1.1.2 is built for Intellij IDEA 2024.2 and doesn't support the pre-commit feature for Gradle projects due to this bug https://youtrack.jetbrains.com/issue/IDEA-327879
> ⚠️ Versions >= 1.1.2 are built for Intellij IDEA >= 2024.2 and doesn't support the pre-commit feature for Gradle projects due to this bug https://youtrack.jetbrains.com/issue/IDEA-327879
>
> Version 1.1.1 supports the pre-commit check properly but is only compatible with Intellij IDEA 2024.1.* versions.
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import org.jetbrains.intellij.platform.gradle.TestFrameworkType

plugins {
id("java")
id("org.jetbrains.kotlin.jvm") version "2.0.10"
id("org.jetbrains.intellij.platform") version "2.0.1"
id("org.jetbrains.kotlin.jvm") version "2.0.21"
id("org.jetbrains.intellij.platform") version "2.1.0"
id("org.jetbrains.changelog") version "2.2.1"
id("org.jetbrains.kotlinx.kover") version "0.8.3"
id("com.diffplug.spotless") version "6.25.0"
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ pluginName=Spotless Applier
pluginRepositoryUrl=https://github.com/lipiridi/spotless-applier

# SemVer format -> https://semver.org
pluginVersion=1.1.3
pluginVersion=1.1.4

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

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

# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
Expand All @@ -21,7 +21,7 @@ platformPlugins=
platformBundledPlugins=com.intellij.java,com.intellij.gradle,org.jetbrains.idea.maven

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

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency=false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.github.lipiridi.spotless.applier.trigger;

import com.intellij.openapi.components.*;
import com.intellij.openapi.project.Project;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jetbrains.annotations.NotNull;

@Service(Service.Level.PROJECT)
@State(name = "SpotlessApplierCheckinHandler", storages = @Storage(StoragePathMacros.WORKSPACE_FILE))
public final class SpotlessApplierCheckinHandlerState
implements PersistentStateComponent<SpotlessApplierCheckinHandlerState> {

public boolean preCommitSpotlessFormating;

public static SpotlessApplierCheckinHandlerState getInstance(Project project) {
return project.getService(SpotlessApplierCheckinHandlerState.class);
}

@Override
public SpotlessApplierCheckinHandlerState getState() {
return this;
}

@Override
public void loadState(@NotNull SpotlessApplierCheckinHandlerState state) {
XmlSerializerUtil.copyBean(state, this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.github.lipiridi.spotless.applier.ModuleInfo;
import com.github.lipiridi.spotless.applier.ReformatProcessor;
import com.github.lipiridi.spotless.applier.enums.BuildTool;
import com.github.lipiridi.spotless.applier.ui.settings.SpotlessApplierSettingsState;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
Expand All @@ -25,11 +24,12 @@

public class SpotlessCheckinHandler extends CheckinHandler {
private static final Logger LOGGER = Logger.getInstance(SpotlessCheckinHandler.class);
private final SpotlessApplierSettingsState spotlessSettings = SpotlessApplierSettingsState.getInstance();
private final SpotlessApplierCheckinHandlerState spotlessSettings;
private final Project project;

public SpotlessCheckinHandler(Project project) {
this.project = project;
this.spotlessSettings = SpotlessApplierCheckinHandlerState.getInstance(project);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public final class SpotlessApplierSettingsState implements PersistentStateCompon
public boolean prohibitGradleCache;
public boolean optimizeImportsBeforeApplying;
public boolean prohibitImportsWithAsterisk;
public boolean preCommitSpotlessFormating;

public static SpotlessApplierSettingsState getInstance() {
return ApplicationManager.getApplication().getService(SpotlessApplierSettingsState.class);
Expand Down

0 comments on commit 899fab9

Please sign in to comment.