Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to intellij-platform gradle plugin 2.1 #26

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

Undin
Copy link
Contributor

@Undin Undin commented Dec 3, 2024

2.x version is supposed to solve a lot of long-standing problems that 1.x plugin has.
Moreover, it's the only way to properly build IntelliJ plugin the platform starting from 2024.3

The most interesting thing except migration itself is using java-test-fixtures plugin to share common test code from common module. Starting with 2.0 version of intellij-platform gradle plugin, it's not possible to use test dependencies in main source root as it was before, only in test ones. But test source root is not supposed to be shared. So I use a separate Gradle plugin created exactly to solve the issue with sharing test code between different modules

What I intentionally didn't do in this PR:

  • migration to a newer platform version
  • updating Gradle
  • updating Kotlin plugin

Comment on lines +12 to +29
intellijPlatform {
instrumentCode = false
}

repositories {
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
}

dependencies {
intellijPlatform {
intellijIdeaCommunity(ideaVersion, useInstaller = false)
jetbrainsRuntime()
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin")
testFramework(TestFrameworkType.Bundled)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, I don't know a proper way how not to duplicate these lines if do everything as expected, i.e., not apply org.jetbrains.intellij.platform at the top-level where it's unnecessary, and use org.jetbrains.intellij.platform.module plugin for common module since common is not a plugin itself but just a part of it

- add explicit dependency on junit lib
- add explicit dependency on platform test framework
- use `java-test-fixtures` plugin to share common test code from `common` module across other modules
@Undin Undin force-pushed the arseniy/migrate-to-ijpgp-2.0 branch from bb9363c to 632fc7a Compare December 3, 2024 18:06
@Undin Undin changed the title Migrate to intellij-platform gradle plugin 2.0 Migrate to intellij-platform gradle plugin 2.1 Dec 3, 2024
@Geravant Geravant requested a review from kochaika December 3, 2024 18:30
Copy link

@kochaika kochaika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately(?), I'm not an experienced Kotlin programmer, but I confirm that this patch fixes the course.

@Undin Undin merged commit 114b19a into main Dec 5, 2024
4 checks passed
@Undin Undin deleted the arseniy/migrate-to-ijpgp-2.0 branch December 5, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants