AndroidGitSemVerExtension

open class AndroidGitSemVerExtension @JvmOverloads constructor(project: Project, providerFactory: ProviderFactory, objectFactory: ObjectFactory, projectDir: File, version: String, logger: Logger, minimumVersion: Property<String> = objectFactory.propertyWithDefault("0.1.0"), developmentIdentifier: Property<String> = objectFactory.propertyWithDefault("dev"), noTagIdentifier: Property<String> = objectFactory.propertyWithDefault("archeo"), fullHash: Property<Boolean> = objectFactory.propertyWithDefault(false), maxVersionLength: Property<Int> = objectFactory.propertyWithDefault(Int.MAX_VALUE), developmentCounterLength: Property<Int> = objectFactory.propertyWithDefault(2), enforceSemanticVersioning: Property<Boolean> = objectFactory.propertyWithDefault(true), computeReleaseVersion: Property<Boolean> = objectFactory.propertyWithDefault(false), preReleaseSeparator: Property<String> = objectFactory.propertyWithDefault("-"), buildMetadataSeparator: Property<String> = objectFactory.propertyWithDefault("+"), distanceCounterRadix: Property<Int> = objectFactory.propertyWithDefault(DEFAULT_RADIX), versionPrefix: Property<String> = objectFactory.propertyWithDefault(""), includeLightweightTags: Property<Boolean> = objectFactory.propertyWithDefault(true), forceVersionPropertyName: Property<String> = objectFactory.propertyWithDefault("forceVersion"), val incrementalCode: Property<Boolean> = objectFactory.propertyWithDefault(true), val versionCodeMajorDigits: Property<Int> = objectFactory.propertyWithDefault(3), val versionCodeMinorDigits: Property<Int> = objectFactory.propertyWithDefault(3), val versionCodePatchDigits: Property<Int> = objectFactory.propertyWithDefault(3)) : GitSemVerExtension

The plugin extension with the DSL.

Supports the following properties:

  • minimumVersion, defaulting to 0.1.0

  • developmentIdentifier, the identifier for the in-development versions

  • noTagIdentifier, the identifier for early versions of the project, when no tags are available yet

  • fullHash, whether to use the full commit hash as build metadata

  • maxVersionLength, cuts the version to the specified length. Useful for some destinations, e.g., the Gradle Plugin Portal, which limits version numbers to 20 chars.

  • developmentCounterLength, how many digits to use for the counter

  • enforceSemanticVersioning, whether the system should fail or just warn in case a non-SemVer compatible version gets produced

  • preReleaseSeparator, how to separate the pre-release information. Changing this value may generate non-SemVer-compatible versions.

  • buildMetadataSeparator, how to separate the pre-release information. Some destinations (e.g., the Gradle Plugin Portal) do not support the default value '+'. A reasonable alternative is using '-', lifting the build metadata to a pre-release segment.

  • distanceCounterRadix, the radix for the commit counter. Defaults to base 36. Bases from 2 to 36 allowed.

  • versionPrefix, to be used in case tags are prefixed with some symbols before the semantic version (e.g., v1.0.0 is prefixed with "v").

  • includeLightweightTags, to be used in case lightweight tags should be considered.

  • forceVersionPropertyName, the name of the property that, if set, will force the plugin to use the specified version. By default, the property name is "forceVersion".

  • incrementalCode, whether to use the incremental version code or not (default: true)

  • versionCodeMajorDigits, the number of digits to use for the major version (default: 3)

  • versionCodeMinorDigits, the number of digits to use for the minor version (default: 3)

  • versionCodePatchDigits, the number of digits to use for the patch version (default: 3)

Constructors

Link copied to clipboard
constructor(project: Project, providerFactory: ProviderFactory, objectFactory: ObjectFactory, projectDir: File, version: String, logger: Logger, minimumVersion: Property<String> = objectFactory.propertyWithDefault("0.1.0"), developmentIdentifier: Property<String> = objectFactory.propertyWithDefault("dev"), noTagIdentifier: Property<String> = objectFactory.propertyWithDefault("archeo"), fullHash: Property<Boolean> = objectFactory.propertyWithDefault(false), maxVersionLength: Property<Int> = objectFactory.propertyWithDefault(Int.MAX_VALUE), developmentCounterLength: Property<Int> = objectFactory.propertyWithDefault(2), enforceSemanticVersioning: Property<Boolean> = objectFactory.propertyWithDefault(true), computeReleaseVersion: Property<Boolean> = objectFactory.propertyWithDefault(false), preReleaseSeparator: Property<String> = objectFactory.propertyWithDefault("-"), buildMetadataSeparator: Property<String> = objectFactory.propertyWithDefault("+"), distanceCounterRadix: Property<Int> = objectFactory.propertyWithDefault(DEFAULT_RADIX), versionPrefix: Property<String> = objectFactory.propertyWithDefault(""), includeLightweightTags: Property<Boolean> = objectFactory.propertyWithDefault(true), forceVersionPropertyName: Property<String> = objectFactory.propertyWithDefault("forceVersion"), incrementalCode: Property<Boolean> = objectFactory.propertyWithDefault(true), versionCodeMajorDigits: Property<Int> = objectFactory.propertyWithDefault(3), versionCodeMinorDigits: Property<Int> = objectFactory.propertyWithDefault(3), versionCodePatchDigits: Property<Int> = objectFactory.propertyWithDefault(3))

Types

Link copied to clipboard
object Companion

Contains the DSL entry-point for the Android Git-Sensitive Semantic Versioning plugin.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val distanceCounterRadix: Property<Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val fullHash: Property<Boolean>
Link copied to clipboard
Link copied to clipboard
val incrementalCode: Property<Boolean>
Link copied to clipboard
val maxVersionLength: Property<Int>
Link copied to clipboard
val minimumVersion: Property<String>
Link copied to clipboard
val noTagIdentifier: Property<String>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val versionPrefix: Property<String>

Functions

Link copied to clipboard
Link copied to clipboard
fun commitNameBasedUpdateStrategy(strategy: (List<String>) -> UpdateType)
Link copied to clipboard
Link copied to clipboard

Computes the version code.

Link copied to clipboard
Link copied to clipboard
fun findClosestTag(): SemanticVersion?