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

Set main for JavaExec using mainClass property #289

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Set main for JavaExec using mainClass property #289

merged 1 commit into from
Sep 20, 2021

Conversation

bondolo
Copy link
Contributor

@bondolo bondolo commented Aug 19, 2021

Setting main is deprecated in Gradle 7.X and will be removed in Gradle 8.0. This sets the main class using the mainClass property.

Setting `main` is deprecated in Gradle 7.X and will be removed in Gradle 8.0. This sets the main class using the `mainClass` property.
@szpak
Copy link
Owner

szpak commented Aug 19, 2021

Thanks @bondolo! It looks good, but I'm thinking about backward compatibility. Our main CI is currently broken (#290) and I wonder, if all the tests (except "PitestPluginGeneralFunctionalSpec > enable PIT plugin when on classpath and pass plugin configuration to PIT" which is broken due to the Bintray shutdown - see hcoles/pitest-plugins#4) work on your machine (including those testing compatibility with older Gradle versions)?

./gradlew check funcTest

@bondolo
Copy link
Contributor Author

bondolo commented Aug 20, 2021

I had run the default tests with ./gradlew clean build which seemed to pass.

Running the suggested ./gradlew check funcTest produces some test failures:

  java.lang.NoSuchMethodError: info.solidsoft.gradle.pitest.PitestTask.getMainClass()Lorg/gradle/api/provider/Property;
                            at info.solidsoft.gradle.pitest.PitestTask.<init>(PitestTask.groovy:245)
                            at org.gradle.internal.instantiation.AsmBackedClassGenerator.newInstance(AsmBackedClassGenerator.java:179)
                            at org.gradle.internal.instantiation.AbstractClassGenerator$GeneratedClassImpl$GeneratedConstructorImpl.newInstance(AbstractClassGenerator.java:395)
                            at org.gradle.internal.instantiation.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:49)
                            at org.gradle.api.internal.project.taskfactory.TaskFactory$1.call(TaskFactory.java:72)
                            ... 140 more

At least one of the failures is caused by the disappearance of Bintray:

org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.bintray.com/szpak/pitest-plugins/org/pitest/plugins/pitest-plugin-configuration-reporter-plugin/0.0.2/pitest-plugin-configuration-reporter-plugin-0.0.2.pom'

So it looks like more work will be needed to complete this fix.

@szpak
Copy link
Owner

szpak commented Aug 21, 2021

I needed to lower Java version to 8 to reproduce the problem with Gradle 5.6. In the end, the new minimal supported Gradle version is 6.4 That's probably fine as it was released May 05, 2020 and people should be able to migrate to some later 6.x.

Nevertheless, having some time, I will take a look if - using some Groovy hacks - wouldn't be easy to support both the cases.

@szpak szpak merged commit 6c133ca into szpak:master Sep 20, 2021
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