-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Simon Priadka
committed
Nov 16, 2017
1 parent
1c38509
commit d9f5dc7
Showing
33 changed files
with
266 additions
and
183 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
...tional-tests/src/test/groovy/info/solidsoft/gradle/pitest/functional/ScmPitestSpec.groovy
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
plugin/src/main/groovy/info/solidsoft/gradle/pitest/ConnectionTypeValidator.groovy
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
plugin/src/main/groovy/info/solidsoft/gradle/pitest/GoalValidator.groovy
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...adle/pitest/scm/ChangeLogException.groovy → ...itest/exception/ChangeLogException.groovy
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
2 changes: 1 addition & 1 deletion
2
.../InvalidChangeLogStrategyException.groovy → .../InvalidChangeLogStrategyException.groovy
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
8 changes: 8 additions & 0 deletions
8
...c/main/groovy/info/solidsoft/gradle/pitest/exception/PitestTaskValidationException.groovy
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,8 @@ | ||
package info.solidsoft.gradle.pitest.exception | ||
|
||
class PitestTaskValidationException extends Exception { | ||
|
||
PitestTaskValidationException(String var1) { | ||
super(var1) | ||
} | ||
} |
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
1 change: 0 additions & 1 deletion
1
...in/src/main/groovy/info/solidsoft/gradle/pitest/extension/ScmPitestPluginExtension.groovy
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
5 changes: 0 additions & 5 deletions
5
.../src/main/groovy/info/solidsoft/gradle/pitest/scm/AbstractChangeLogStrategyFactory.groovy
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
plugin/src/main/groovy/info/solidsoft/gradle/pitest/scm/ChangeLogStrategyFactory.groovy
This file was deleted.
Oops, something went wrong.
13 changes: 5 additions & 8 deletions
13
plugin/src/main/groovy/info/solidsoft/gradle/pitest/scm/PathToClassNameConverter.groovy
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: 0 additions & 20 deletions
20
plugin/src/main/groovy/info/solidsoft/gradle/pitest/scm/Sample.groovy
This file was deleted.
Oops, something went wrong.
60 changes: 60 additions & 0 deletions
60
plugin/src/main/groovy/info/solidsoft/gradle/pitest/scm/ScmContext.groovy
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,60 @@ | ||
package info.solidsoft.gradle.pitest.scm | ||
|
||
class ScmContext { | ||
|
||
File scmRoot | ||
String startVersion | ||
String startVersionType | ||
String endVersion | ||
String endVersionType | ||
|
||
private ScmContext(Builder builder) { | ||
this.scmRoot = builder.scmRoot | ||
this.startVersionType = builder.startVersionType | ||
this.startVersion = builder.startVersion | ||
this.endVersionType = builder.endVersionType | ||
this.endVersion = builder.endVersion | ||
} | ||
|
||
static class Builder { | ||
File scmRoot | ||
String startVersion | ||
String startVersionType | ||
String endVersion | ||
String endVersionType | ||
|
||
Builder scmRoot(String scmRootPath) { | ||
this.scmRoot = new File(scmRootPath) | ||
return this | ||
} | ||
|
||
Builder scmRoot(File scmRoot) { | ||
this.scmRoot = scmRoot | ||
return this | ||
} | ||
|
||
Builder startVersion(String startVersion) { | ||
this.startVersion = startVersion | ||
return this | ||
} | ||
|
||
Builder startVersionType(String startVersionType) { | ||
this.startVersionType = startVersionType | ||
return this | ||
} | ||
|
||
Builder endVersion(String endVersion) { | ||
this.endVersion = endVersion | ||
return this | ||
} | ||
|
||
Builder endVersionType(String endVersionType) { | ||
this.endVersionType = endVersionType | ||
return this | ||
} | ||
|
||
ScmContext build() { | ||
return new ScmContext(this) | ||
} | ||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
...test/scm/AbstractChangeLogStrategy.groovy → ...strategy/AbstractChangeLogStrategy.groovy
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
2 changes: 1 addition & 1 deletion
2
...radle/pitest/scm/ChangeLogStrategy.groovy → ...est/scm/strategy/ChangeLogStrategy.groovy
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
3 changes: 2 additions & 1 deletion
3
...adle/pitest/scm/LastCommitStrategy.groovy → ...st/scm/strategy/LastCommitStrategy.groovy
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
3 changes: 2 additions & 1 deletion
3
...le/pitest/scm/LocalChangesStrategy.groovy → .../scm/strategy/LocalChangesStrategy.groovy
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
7 changes: 7 additions & 0 deletions
7
...info/solidsoft/gradle/pitest/scm/strategy/factory/AbstractChangeLogStrategyFactory.groovy
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,7 @@ | ||
package info.solidsoft.gradle.pitest.scm.strategy.factory | ||
|
||
import info.solidsoft.gradle.pitest.scm.strategy.ChangeLogStrategy | ||
|
||
interface AbstractChangeLogStrategyFactory { | ||
ChangeLogStrategy fromType(String type) | ||
} |
37 changes: 37 additions & 0 deletions
37
.../groovy/info/solidsoft/gradle/pitest/scm/strategy/factory/ChangeLogStrategyFactory.groovy
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,37 @@ | ||
package info.solidsoft.gradle.pitest.scm.strategy.factory | ||
|
||
import info.solidsoft.gradle.pitest.exception.InvalidChangeLogStrategyException | ||
import info.solidsoft.gradle.pitest.scm.ScmContext | ||
import info.solidsoft.gradle.pitest.scm.strategy.ChangeLogStrategy | ||
import info.solidsoft.gradle.pitest.scm.strategy.CustomChangeLogStrategy | ||
import info.solidsoft.gradle.pitest.scm.strategy.LastCommitStrategy | ||
import info.solidsoft.gradle.pitest.scm.strategy.LocalChangesStrategy | ||
|
||
class ChangeLogStrategyFactory implements AbstractChangeLogStrategyFactory{ | ||
|
||
private ScmContext scmContext | ||
|
||
ChangeLogStrategyFactory (ScmContext scmContext) { | ||
this.scmContext = scmContext | ||
} | ||
|
||
@Override | ||
ChangeLogStrategy fromType(String goal) { | ||
switch (goal) { | ||
case 'lastCommit': | ||
return new LastCommitStrategy(scmContext.getScmRoot()) | ||
case 'localChanges': | ||
return new LocalChangesStrategy(scmContext.getScmRoot()) | ||
case 'custom': | ||
return new CustomChangeLogStrategy.Builder() | ||
.fileSet(scmContext.getScmRoot()) | ||
.startVersion(scmContext.getStartVersion()) | ||
.startVersionType(scmContext.getStartVersionType()) | ||
.endVersion(scmContext.getEndVersion()) | ||
.endVersionType(scmContext.getEndVersionType()) | ||
.build() | ||
default: | ||
throw new InvalidChangeLogStrategyException("Invalid goal, received: $goal, possible goals are [lastCommit, localChanges, custom]") | ||
} | ||
} | ||
} |
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
Oops, something went wrong.