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

Upgrade to Intellij platform gradle plugin 2.0 #70

Merged
merged 14 commits into from
Sep 20, 2024

Conversation

peddiashrith
Copy link
Contributor

@peddiashrith peddiashrith commented Sep 13, 2024

Upgrade to Intellij platform gradle plugin 2.0

  1. This upgrade is required in order to support Intellij 2024.2+ (242+) in future - ref comment
  2. Upgrade gradle to 8.10 version
  3. Bump version to 2.7.1
  4. Remove support for 2022.2 in favour of 2024.2 as the minimal supported version by new intellij platform plugin is 2022.3

References

Testing

  • ./gradlew buildPlugin
  • ./gradlew verifyPlugin
  • Tested that generated zip file is working with IntelliJ 2024.1 version

Ashrith Kumar Peddi and others added 8 commits December 15, 2023 18:17
1. adds GitHub actions changes
2. add plugin info in the build.gradle.kts
3. adds IC-233 source folder
…ion#63)

* Support IntelliJ 2024.1, and update release to v2.6.0

* Add IC-2024.1 to release.yml product list
* Changes SExpression children to use `SEXPRESSION_ATOM` instead of `VALUE`
* Adds changes in `IonSExpressionBlock` to consider `SEXPRESSION_ATOM`
as children as per BNF grammar
* Adds changes in `IonCodeBlockSpacing` to correctly consider
`SEXPRESSION_ATOM` as children as per BNF grammar
* Adds changes in tests for usign correct node names
* Adds changes for PR workflow to run Gradle Build task
1. Adds IC-242 source folder
2. Upgrade gradle. Intellij 2024+ (242+) needs gradle 8.2+
3. Add plugin info in the build.gradle.kts
4. Adds GitHub actions changes
@popematt
Copy link
Contributor

popematt commented Sep 13, 2024

Thanks for your contribution!
It looks like the workflows are failing because we're using an outdated version of the upload-artifact action. I don't want to clob too many changes together in one PR, so I'll see about updating the GitHub action. Then, I think it would be a good idea to update to the IntelliJ platform Gradle plugin 2.0 in one PR (this one?), and then add support for 2024.2 in a separate PR.

@peddiashrith
Copy link
Contributor Author

peddiashrith commented Sep 16, 2024

Sure, will do.

Also let me know once you update Github action

@popematt
Copy link
Contributor

I've fixed the GitHub Action and merged the fix into your PR. Now the workflow is failing because of this error, which looks related to the Intellij platform gradle plugin update.

FAILURE: Build failed with an exception.

  • Where:
    Build file '/home/runner/work/ion-intellij-plugin/ion-intellij-plugin/build.gradle.kts' line: 247

  • What went wrong:
    Collection contains no element matching the predicate.

@peddiashrith
Copy link
Contributor Author

peddiashrith commented Sep 17, 2024

I have updated the PR to include only changes related to Intellij platform gradle plugin 2.0 upgrade

@peddiashrith
Copy link
Contributor Author

peddiashrith commented Sep 17, 2024

The workflows are failing becuase PRODUCT_NAME environment variable is being passed as IC-2024.1 whereas the code is expecting just 2024.1 after my changes and hence no plugin descriptor item is filtered

Do you suggest to change the code to hard code the prefix = IC- OR update envirnonment variable value to 2024.1 ?

@popematt
Copy link
Contributor

Do you suggest to change the code to hard code the prefix = IC- OR update envirnonment variable value to 2024.1 ?

I don't have a preference either way, as long as it works. If/when we support other IntelliJ IDEs, we can revisit if we need to.

@peddiashrith
Copy link
Contributor Author

Pushed a commit to fix the workflow failure, please trigger it as I am unable to trigger

@peddiashrith
Copy link
Contributor Author

peddiashrith commented Sep 18, 2024

Now it is failing due to a compilation error which I guess is because the minimal supported intellij platform is 2022.3 by new intellij platform plugin.

[org.jetbrains.intellij.platform] The following plugin configuration issues were found:
- The minimal supported IntelliJ Platform version is `2022.3` (branch `223`), current: '2022.2' ('222.3345.118')

Question: Can we remove build for 2022.2 version in order to support 2024.2?

@popematt
Copy link
Contributor

Yes. In fact, if it makes things easier, we can drop support for all of the 2023 versions as well. People who are still using older versions of IntelliJ can continue to use older versions of the plugin.

…d version is 2022.3 by new intellij platform plugin
@peddiashrith peddiashrith changed the title Support IntelliJ 2024.2 Upgrade to Intellij platform gradle plugin 2.0 Sep 19, 2024
@peddiashrith
Copy link
Contributor Author

Removed support for 2022.2

@popematt
Copy link
Contributor

Task :compileTestKotlin FAILED
e: file:///home/runner/work/ion-intellij-plugin/ion-intellij-plugin/src/test/kotlin/com/amazon/ion/plugin/intellij/formatting/IonBasicFormattingTest.kt:8:5 'getBasePath' overrides nothing
e: file:///home/runner/work/ion-intellij-plugin/ion-intellij-plugin/src/test/kotlin/com/amazon/ion/plugin/intellij/formatting/IonBasicFormattingTest.kt:14:43 Unresolved reference: doTest
e: file:///home/runner/work/ion-intellij-plugin/ion-intellij-plugin/src/test/kotlin/com/amazon/ion/plugin/intellij/formatting/IonFormatterTestBase.kt:4:35 Unresolved reference: FormatterTestCase
e: file:///home/runner/work/ion-intellij-plugin/ion-intellij-plugin/src/test/kotlin/com/amazon/ion/plugin/intellij/formatting/IonFormatterTestBase.kt:7:39 Unresolved reference: FormatterTestCase
...

I'm not sure of the root cause for this failure. If I had to guess, I'd say there's a misconfiguration of the classpath or there was some breaking API change from IntelliJ. Were you able to successfully run ./gradlew build locally with these changes? If so, then the problem could be some configuration in the build-pr workflow.

If you're able to figure it out, that's great, but if not, I'll also try to look into this more sometime in the next few days.

It seems like every fix is uncovering another issue, and I know that can be pretty discouraging sometimes. Thanks for being persistent and sticking with it this far!

@popematt popematt merged commit 3dab4e1 into amazon-ion:master Sep 20, 2024
5 checks passed
@popematt
Copy link
Contributor

As you may have noticed, I figured out the dependency issue, and I've merged the PR. Thanks for all your work on this!

@peddiashrith
Copy link
Contributor Author

Thanks for fixing it!

Answering to your question: Both ./gradlew buildPlugin and ./gradlew verifyPlugin ran successfully locally in my machine. I wonder why

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.

4 participants