-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #570 from bdemers/bd-add-mutators
Add delete-file and copy-file mutators
- Loading branch information
Showing
31 changed files
with
416 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/main/java/org/gradle/profiler/mutations/AbstractBuildMutator.java
This file was deleted.
Oops, something went wrong.
5 changes: 2 additions & 3 deletions
5
...in/java/org/gradle/profiler/mutations/AbstractBuildMutatorWithoutOptionsConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
package org.gradle.profiler.mutations; | ||
|
||
import org.gradle.profiler.BuildMutator; | ||
import org.gradle.profiler.InvocationSettings; | ||
|
||
public abstract class AbstractBuildMutatorWithoutOptionsConfigurator implements BuildMutatorConfigurator { | ||
|
||
abstract BuildMutator createBuildMutator(InvocationSettings settings); | ||
abstract BuildMutator createBuildMutator(BuildMutatorConfiguratorSpec spec); | ||
|
||
@Override | ||
public BuildMutator configure(String key, BuildMutatorConfiguratorSpec spec) { | ||
boolean enabled = spec.getScenario().getBoolean(key); | ||
return enabled ? createBuildMutator(spec.getInvocationSettings()) : BuildMutator.NOOP; | ||
return enabled ? createBuildMutator(spec) : BuildMutator.NOOP; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/org/gradle/profiler/mutations/AbstractFileSystemMutator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.gradle.profiler.mutations; | ||
|
||
import org.gradle.profiler.BuildMutator; | ||
|
||
import java.io.File; | ||
|
||
public class AbstractFileSystemMutator implements BuildMutator { | ||
protected static File resolveProjectFile(File projectDir, String path) { | ||
File file = new File(path); | ||
if (file.isAbsolute()) { | ||
return file; | ||
} | ||
return new File(projectDir, path); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return getClass().getSimpleName(); | ||
} | ||
} |
Oops, something went wrong.