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

Task 'pitest' not found in root project (Running pitest with Gradle 8.7) #361

Closed
Bhumika2005 opened this issue May 17, 2024 · 4 comments
Closed

Comments

@Bhumika2005
Copy link

Bhumika2005 commented May 17, 2024

#In demo project, I have added pitest plugin in libs.versions.toml as below:

[versions]
....
kotlin = "1.9.0"
pitest = "1.15.0"

[libraries]
....

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
pitest = {id = "info.solidsoft.pitest", version.ref = "pitest"}

#Then added plugin in app build.gradle => build.gradle.kts(:app)

plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.pitest)
}

build successful but ./gradlew pitest didn't work and getting error as below ::

FAILURE: Build failed with an exception.

* What went wrong:
Task 'pitest' not found in root project 'TestPitest' and its subprojects. Some candidates are: 'test'.

Then I found this issue link and tried the same way

#Added dependency in app build.gradle.kts along with above change

dependencies {
    ....
 testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
pitest("org.pitest:pitest-testng-plugin:1.0.0")
}

still same error message - "Task 'pitest' not found in root project 'TestPitest' and its subprojects. Some candidates are: 'test' "

Also added plugin / buildscript dependencies in root project build.gradle but nothing works.

Getting same error message everytime.

@szpak
Copy link
Owner

szpak commented May 17, 2024

@Bhumika2005
Copy link
Author

#361 (comment)

Updated

@szpak
Copy link
Owner

szpak commented May 18, 2024

Thanks.

Now, I've realized it's an Android app. There's a dedicated plugin variant made especially for the Android projects: https://github.com/koral--/gradle-pitest-plugin/ . You could give it a try.

@Bhumika2005
Copy link
Author

Thank you!

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

No branches or pull requests

2 participants