Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 45 additions & 51 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# GitHub Actions Workflow is created for testing and preparing the plugin release in the following steps:
# - Validate Gradle Wrapper.
# - Run 'test' and 'verifyPlugin' tasks.
# - Run the 'buildPlugin' task and prepare artifact for further tests.
# - Run the 'runPluginVerifier' task.
Expand Down Expand Up @@ -33,48 +32,29 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
pluginVerifierHomeDir: ${{ steps.properties.outputs.pluginVerifierHomeDir }}
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4

# Validate wrapper
- name: Gradle Wrapper Validation
uses: gradle/actions/wrapper-validation@v4
uses: actions/checkout@v5

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
gradle-home-cache-cleanup: true

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
uses: gradle/actions/setup-gradle@v5

# Build plugin
- name: Build plugin
Expand All @@ -93,7 +73,7 @@ jobs:

# Store already-built plugin as an artifact for downloading
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
Expand All @@ -105,20 +85,29 @@ jobs:
runs-on: ubuntu-latest
steps:

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: true

# Run tests
- name: Run Tests
Expand All @@ -127,7 +116,7 @@ jobs:
# Collect Tests Result of failed tests
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests
Expand All @@ -141,29 +130,27 @@ 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

- name: Clean Gradle IDEA Cache
run: |
rm -rf ~/.gradle/caches/modules-2/files-2.1/idea/ideaIU

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: true

# Run Verify Plugin task and IntelliJ Plugin Verifier tool
- name: Run Plugin Verification tasks
Expand All @@ -172,7 +159,7 @@ jobs:
# Collect Plugin Verifier Result
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier
Expand All @@ -190,7 +177,13 @@ jobs:

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: true

# Remove old release drafts by using the curl request for the available releases with a draft flag
- name: Remove Old Release Drafts
Expand All @@ -206,10 +199,11 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "v${{ needs.build.outputs.version }}" \
VERSION=$(./gradlew properties --property version --quiet --console=plain | tail -n 1 | cut -f2- -d ' ')
RELEASE_NOTE="./build/tmp/release_note.txt"
mkdir -p "$(dirname "$RELEASE_NOTE")"
./gradlew getChangelog --unreleased --no-header --quiet --console=plain --output-file=$RELEASE_NOTE
gh release create "v$VERSION" \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "$(cat << 'EOM'
${{ needs.build.outputs.changelog }}
EOM
)"
--title "v$VERSION" \
--notes-file $RELEASE_NOTE
49 changes: 22 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,56 +17,51 @@ jobs:
contents: write
pull-requests: write
steps:
- name: Free up disk space
run: |
echo "Freeing disk space before Gradle setup..."
sudo rm -rf /usr/share/dotnet /opt/ghc /opt/hostedtoolcache /usr/local/lib/android
df -h

# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: false
large-packages: false

# Check out the current repository
- name: Fetch Sources
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.release.tag_name }}

# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: zulu
java-version: 21

# Setup Gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v5
with:
cache-disabled: true

# Set environment variables
- name: Export Properties
id: properties
shell: bash
run: |
CHANGELOG="$(cat << 'EOM' | sed -e 's/^[[:space:]]*$//g' -e '/./,$!d'
${{ github.event.release.body }}
EOM
)"
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
cache-read-only: true

# Update the Unreleased section with the current release note
- name: Patch Changelog
if: ${{ steps.properties.outputs.changelog != '' }}
if: ${{ github.event.release.body != '' }}
env:
CHANGELOG: ${{ steps.properties.outputs.changelog }}
CHANGELOG: ${{ github.event.release.body }}
run: |
./gradlew patchChangelog --release-note="$CHANGELOG"
RELEASE_NOTE="./build/tmp/release_note.txt"
mkdir -p "$(dirname "$RELEASE_NOTE")"
echo "$CHANGELOG" > $RELEASE_NOTE
./gradlew patchChangelog --release-note-file=$RELEASE_NOTE

# Publish the plugin to JetBrains Marketplace
- name: Publish Plugin
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
run: ./gradlew publishPlugin

# Upload artifact as a release asset
Expand All @@ -77,7 +72,7 @@ jobs:

# Create a pull request
- name: Create Pull Request
if: ${{ steps.properties.outputs.changelog != '' }}
if: ${{ github.event.release.body != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -100,4 +95,4 @@ jobs:
--title "Changelog update - \`$VERSION\`" \
--body "Current pull request contains patched \`CHANGELOG.md\` file for the \`$VERSION\` version." \
--label "$LABEL" \
--head $BRANCH
--head $BRANCH
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
## [Unreleased]

- Rearchitected to use coroutines for asynchronous operations, hopefully improving CPU utilisation. Please report any issues to the github, as there should be no changes to the experience.
- Updated build system to Gradle 9.2.1 and IntelliJ Platform Gradle Plugin 2.10.5
- Fixed test configuration to properly support Kotest with JUnit 5 while maintaining compatibility with Gradle test infrastructure

## 0.8.4 - 2025-06-25

Expand Down
9 changes: 6 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ IntelliJ IDEs. The plugin allows users to format their code using dprint directl

## Development Notes

1. The plugin is developed using Kotlin and targets IntelliJ 2024.3+
2. JDK 17 is required for development
1. The plugin is developed using Kotlin and targets IntelliJ 2025.1+
2. JDK 21 is required for development
3. To test the plugin locally:
- Install dprint CLI (`brew install dprint` on macOS)
- Run `dprint init` to create a default config
Expand Down Expand Up @@ -110,9 +110,12 @@ IntelliJ IDEs. The plugin allows users to format their code using dprint directl
- **Progress integration** - Better integration with IntelliJ's progress system for background operations

### Technical Updates
- **Build system modernization** - Updated to Gradle 9.2.1 and IntelliJ Platform Gradle Plugin 2.10.5
- **Java toolchain update** - Upgraded from Java 17 to Java 21 for better performance and modern language features
- **Dependency updates** - Updated all dependencies for 2025, including Gradle foojay-resolver-convention plugin (0.7.0 → 1.0.0)
- **IntelliJ platform updates** - Updated to target IntelliJ 2024.3+ with latest platform APIs
- **IntelliJ platform updates** - Updated to target IntelliJ 2025.1+ with latest platform APIs
- **Deprecated code removal** - Cleaned up deprecated class usage and modernized codebase
- **Test configuration improvements** - Fixed Kotest integration with JUnit 5 to work seamlessly with Gradle test infrastructure
- **Test improvements** - Added comprehensive test suite for new architecture including `DprintServiceUnitTest`, `EditorServiceCacheTest`, and improved V5 service tests

### Configuration & UI Improvements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Please report any issues with this Intellij plugin to the

## Development

This project is currently built using JDK 21 and targets IntelliJ 2024.3+. To install on a mac with homebrew run `brew install openjdk@21` and set that
This project is currently built using JDK 21 and targets IntelliJ 2025.1+. To install on a mac with homebrew run `brew install openjdk@21` and set that
as your project SDK.

### Dprint setup
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ dependencies {
testImplementation(libs.kotestAssertions)
testImplementation(libs.kotestRunner)
testImplementation(libs.mockk)
// Needed because the IJ platform uses version 4 for tests but kotest uses 5
testRuntimeOnly("junit:junit:4.13.2")

intellijPlatform {
val version = providers.gradleProperty("platformVersion")
Expand Down
9 changes: 3 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@ pluginName=dprint
pluginVersion=0.9.0.beta
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
pluginSinceBuild=243
pluginSinceBuild=251
platformType=IU
platformVersion=2024.3
platformVersion=2025.1
platformDownloadSources=true
# Opt-out flag for bundling Kotlin standard library.
# See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.
kotlin.stdlib.default.dependency=false
org.gradle.jvmargs=-XX\:MaxHeapSize\=4096m -Xmx4096m
# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.5
gradleVersion=9.2.1
# https://github.com/gradle/gradle/issues/20416
systemProp.org.gradle.kotlin.dsl.precompiled.accessors.strict=tru

# Parallel execution
org.gradle.parallel=true
org.gradle.workers.max=4

# Build cache
org.gradle.caching=true

# Configuration cache (if compatible)
org.gradle.configuration-cache=true
18 changes: 9 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
changelog = "2.2.1"
changelog = "2.5.0"
commonsCollection4 = "4.5.0"
gradleIntelliJPlugin = "2.6.0"
kotestAssertions = "5.9.1"
kotestRunner = "5.9.1"
kotlin = "2.1.21"
ktlint = "12.3.0"
mockk = "1.14.2"
versionCatalogUpdate = "1.0.0"
versions = "0.52.0"
gradleIntelliJPlugin = "2.10.5"
kotestAssertions = "6.0.7"
kotestRunner = "6.0.7"
kotlin = "2.3.0"
ktlint = "14.0.1"
mockk = "1.14.7"
versionCatalogUpdate = "1.0.1"
versions = "0.53.0"

[libraries]
commonsCollection4 = { module = "org.apache.commons:commons-collections4", version.ref = "commonsCollection4" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading