Interface StonecutterConfiguration

    • Constructor Detail

    • Method Detail

      • swap

         abstract Unit swap(String identifier, String replacement)

        Creates a swap id.

        Parameters:
        identifier - Swap name
        replacement - Replacement string
      • swap

         Unit swap(String identifier, Function0<String> replacement)

        Creates a swap id.

        Parameters:
        identifier - Swap name
        replacement - 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
      • const

         abstract Unit const(String identifier, Boolean value)

        Creates a constant accessible in stonecutter conditions.

        Parameters:
        identifier - Constant name
        value - Boolean value
      • const

         Unit const(String identifier, Function0<Boolean> value)

        Creates a constant accessible in stonecutter conditions.

        Parameters:
        identifier - Constant name
        value - 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
      • dependency

         abstract Unit dependency(String identifier, String version)

        Adds a dependency to the semver checks.

        Parameters:
        identifier - Dependency name
        version - 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 name
        version - 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
      • 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 (where stonecutter.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 comparison
        right - 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 stonecutter block 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 against
        predicate - One or multiple version predicates separated with spaces.
        Returns:

        true if 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.

      • setDebug

         abstract Unit setDebug(Boolean debug)

        Enables Stonecutter debugging utilities.

        Currently, it creates human-readable ASTs in the cache folder and adds stack traces to reported exceptions.