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

#41 fix the DefaultTemplate problem to meet IDEA 2024 #48

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

huangliang992
Copy link
Contributor

meet_2024

1、fix the DefaultTemplate instance creation to meet IDEA 2024
2、the migration from org.jetbrains.intellij to org.jetbrains.intellij.platform not finished

@huangliang992
Copy link
Contributor Author

huangliang992 commented Aug 29, 2024

changes:
1、move the src and integrationTest packages to a submodule testme-intellij-core
2、add test framework in intellijPlatform dependency,move integrationTest to test directory because intellijPlatform test framework dependencies can't be imported in integrationTest directory

issues of checks:
1、I have no idea to deal with the jacoco tasks to support gradle version of 8.9 and higher
2、i can run the intergration test, but have puzzle to make a integrationTest task with the unbroken-dome plugin
i built the plugin and tested it
ittest

new build plugin for IDEA 2024,i tested it and can successfully run in IDEA 2024
TestMe.zip

@yaronyam
Copy link
Member

Thank you @huangliang992 this issue has highest priority right now. can't stress enough how important this contribution is. Sorry for the late reply. I'm on vacation will review as soon as I can. Hopefully in 1-2 weeks.
I'll try to handle coverage tasks/integration later 👍

gradle.properties Show resolved Hide resolved
testme-intellij-common/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
testme-intellij-scala/build.gradle Outdated Show resolved Hide resolved
testme-intellij-core/build.gradle Outdated Show resolved Hide resolved
@huangliang992
Copy link
Contributor Author

The constructor of DefaultTemplate changed, incompatible with IDEA 2023.2 any more

new DefaultTemplate(
                templateName,
                extension,
                it -> loadFileContent(classLoader, templateUrl, it),
                it -> loadFileContent(classLoader, descriptionUrl, it),
                descriptionPath,
                Path.of(DEFAULT_TEMPLATES_ROOT).resolve(path),
                module));

@yaronyam
Copy link
Member

yaronyam commented Sep 5, 2024

@huangliang992 correct version of DefaultTemplate constructor can be called with reflection. see historic usage of MethodReflectionUtils. if it's too complicated to use reflection we can reconsider

@huangliang992
Copy link
Contributor Author

@huangliang992 correct version of DefaultTemplate constructor can be called with reflection. see historic usage of MethodReflectionUtils. if it's too complicated to use reflection we can reconsider

ok, i fixed it with reflection

1.CommonShortcuts.INSERT replaced with CommonShortcuts.getInsert()
2.DefaultTemplate instance creation updated to meet multi constructors, it's the reason cause TestMeGeneratorTestNgTest > testMockReturned UT failing
@yaronyam
Copy link
Member

yaronyam commented Sep 9, 2024

Thanks @huangliang992 , nevermind the integationTest for now 👍
CI build is failing on compilation:

/home/runner/work/testme-idea/testme-idea/src/main/java/com/weirddev/testme/intellij/ui/template/TestTemplatesConfigurable.java:285: error: cannot find symbol

    addAction.registerCustomShortcutSet(CommonShortcuts.getInsert(), myCurrentTab.getComponent());

for cross version compatibility, perhaps call the underlaying method directly and store is statically:

new CustomShortcutSet(getInsertKeystroke());

1.CommonShortcuts.INSERT replaced with new CustomShortcutSet(getInsertKeystroke());
@yaronyam yaronyam merged commit 21f92d0 into wrdv:master Sep 10, 2024
3 of 7 checks passed
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