Interface StonecutterConfiguration
-
- All Implemented Interfaces:
public interface StonecutterConfiguration
-
-
Method Summary
Modifier and Type Method Description abstract Unitswap(String identifier, String replacement)Creates a swap id. Unitswap(String identifier, Function0<String> replacement)Creates a swap id. Unitswaps(Pair<String, String> values)Adds provided id to value pairs to the swap map. Unitswaps(Iterable<Pair<String, String>> values)Adds provided id to value pairs to the swap map. abstract Unitconst(String identifier, Boolean value)Creates a constant accessible in stonecutter conditions. Unitconst(String identifier, Function0<Boolean> value)Creates a constant accessible in stonecutter conditions. Unitconsts(Pair<String, Boolean> values)Adds provided id to value pairs to the constant map. Unitconsts(Iterable<Pair<String, Boolean>> values)Adds provided id to value pairs to the constant map. abstract Unitdependency(String identifier, String version)Adds a dependency to the semver checks. Unitdependency(String identifier, Function0<String> version)Adds a dependency to the semver checks. Unitdependencies(Pair<String, String> values)Adds provided id to value pairs to the semver checks. Unitdependencies(Iterable<Pair<String, String>> values)Adds provided id to value pairs to the semver checks. Unitexclude(File path)Excludes a file or directory from being processed. abstract Unitexclude(Path path)Excludes a file or directory from being processed. abstract Unitexclude(String path)Excludes a file or directory from being processed. Unitdebug(Boolean state)Enables Stonecutter debugging utilities. Integercompare(String left, String right)Parses both parameters as semantic versions and compares them. Integercomp(String $self, String other)Parses both parameters as semantic versions and compares them. Booleaneval(String version, String predicate)Evaluates the passed version as SemanticVersion and compares to the given predicate(s). abstract BooleangetDebug()Enables Stonecutter debugging utilities. abstract UnitsetDebug(Boolean debug)Enables Stonecutter debugging utilities. -
-
Method Detail
-
swap
abstract Unit swap(String identifier, String replacement)
Creates a swap id.
- Parameters:
identifier- Swap namereplacement- Replacement string
-
swap
Unit swap(String identifier, Function0<String> replacement)
Creates a swap id.
- Parameters:
identifier- Swap namereplacement- Replacement string
-
swaps
Unit swaps(Pair<String, String> values)
Adds provided id to value pairs to the swap map.
- Parameters:
values- Entries of ids to replacements
-
swaps
Unit swaps(Iterable<Pair<String, String>> values)
Adds provided id to value pairs to the swap map.
- Parameters:
values- Entries of ids to replacements
-
const
abstract Unit const(String identifier, Boolean value)
Creates a constant accessible in stonecutter conditions.
- Parameters:
identifier- Constant namevalue- Boolean value
-
const
Unit const(String identifier, Function0<Boolean> value)
Creates a constant accessible in stonecutter conditions.
- Parameters:
identifier- Constant namevalue- Boolean value
-
consts
Unit consts(Pair<String, Boolean> values)
Adds provided id to value pairs to the constant map.
- Parameters:
values- Entries of ids to boolean values
-
consts
Unit consts(Iterable<Pair<String, Boolean>> values)
Adds provided id to value pairs to the constant map.
- Parameters:
values- Entries of ids to boolean values
-
dependency
abstract Unit dependency(String identifier, String version)
Adds a dependency to the semver checks.
- Parameters:
identifier- Dependency nameversion- Dependency version to check against in semantic version format
-
dependency
Unit dependency(String identifier, Function0<String> version)
Adds a dependency to the semver checks.
- Parameters:
identifier- Dependency nameversion- Dependency version to check against in semantic version format
-
dependencies
Unit dependencies(Pair<String, String> values)
Adds provided id to value pairs to the semver checks.
- Parameters:
values- Entries of ids to versions
-
dependencies
Unit dependencies(Iterable<Pair<String, String>> values)
Adds provided id to value pairs to the semver checks.
- Parameters:
values- Entries of ids to versions
-
exclude
Unit exclude(File path)
Excludes a file or directory from being processed.
- Parameters:
path- Absolute path to the file.
-
exclude
abstract Unit exclude(Path path)
Excludes a file or directory from being processed.
- Parameters:
path- Absolute path to the file.
-
exclude
abstract Unit exclude(String path)
Excludes a file or directory from being processed.
- Parameters:
path- Path to the file relative to the parent project directory (wherestonecutter.gradle[.kts]is located) or a file extension qualifier (i.e.
-
debug
Unit debug(Boolean state)
Enables Stonecutter debugging utilities.
Currently, it creates human-readable ASTs in the cache folder and adds stack traces to reported exceptions.
- Parameters:
state- Whenever the debug mode is enabled.
-
compare
Integer compare(String left, String right)
Parses both parameters as semantic versions and compares them.
- Parameters:
left- Version on the left side of the comparisonright- Version on the right side of the comparison- Returns:
1 if the first version is greater, -1 if the second is greater, 0 if they are equal
-
comp
Integer comp(String $self, String other)
Parses both parameters as semantic versions and compares them.
This function is available inside a
stonecutterblock when using Kotlin DSL.- Parameters:
other- Version on the right side of the comparison- Returns:
1 if the first version is greater, -1 if the second is greater, 0 if they are equal
-
eval
Boolean eval(String version, String predicate)
Evaluates the passed version as SemanticVersion and compares to the given predicate(s).
- Parameters:
version- Version to test againstpredicate- One or multiple version predicates separated with spaces.- Returns:
trueif all predicates succeed
-
getDebug
abstract Boolean getDebug()
Enables Stonecutter debugging utilities.
Currently, it creates human-readable ASTs in the cache folder and adds stack traces to reported exceptions.
-
-
-
-