Skip to content

Commit

Permalink
[#62] No need to create pitest configuration manually
Browse files Browse the repository at this point in the history
  • Loading branch information
szpak committed Apr 27, 2020
1 parent 4e9c111 commit 3ad30e3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ repositories {
mavenCentral()
}
configurations.create('pitest')
dependencies {
pitest 'org.pitest:pitest-junit5-plugin:0.12'
}
Expand Down
1 change: 1 addition & 0 deletions config/codenarc/codenarc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<ruleset-ref path='rulesets/logging.xml' />
<ruleset-ref path='rulesets/naming.xml'>
<exclude name="MethodName" />
<exclude name="FactoryMethodName" />
</ruleset-ref>
<ruleset-ref path='rulesets/serialization.xml' />
<ruleset-ref path='rulesets/unnecessary.xml'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class PitestPluginGeneralFunctionalSpec extends AbstractPitestFunctionalSpec {
repositories {
maven { url "https://dl.bintray.com/szpak/pitest-plugins/" }
}
configurations.create("pitest")
dependencies {
pitest 'org.pitest.plugins:pitest-plugin-configuration-reporter-plugin:0.0.2'
}
Expand Down
2 changes: 0 additions & 2 deletions src/funcTest/resources/testProjects/junit5kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ repositories {
mavenCentral()
}

configurations.create("pitest")

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit5Version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class PitestPlugin implements Plugin<Project> {
void apply(Project project) {
this.project = project
gradleVersionEnforcer.failBuildWithMeaningfulErrorIfAppliedOnTooOldGradleVersion(project)
Configuration pitestConfiguration = createConfiguration()

project.plugins.withType(JavaPlugin).configureEach {
setupExtensionWithDefaults()
project.tasks.register(PITEST_TASK_NAME, PitestTask) { t ->
Expand All @@ -83,12 +85,12 @@ class PitestPlugin implements Plugin<Project> {
configureTaskDefault(t)
t.dependsOn(calculateTasksToDependOn())
t.shouldRunAfter(project.tasks.named(TEST_TASK_NAME))
addPitDependencies(configuration())
addPitDependencies(pitestConfiguration)
}
}
}

private Configuration configuration() {
private Configuration createConfiguration() {
return project.configurations.maybeCreate(PITEST_CONFIGURATION_NAME).with { configuration ->
visible = false
description = "The PIT libraries to be used for this project."
Expand Down

0 comments on commit 3ad30e3

Please sign in to comment.