You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,13 +68,13 @@ subprojects {
68
68
}
69
69
```
70
70
71
-
This is usually enough to start using the plugin. Assuming that you already have tags that are (or contain) semantic versions, the plugin will search for all nearest-ancestor tags, select the latest<sup>1</sup> of them as the base version, and increment the component with the least precedence. The nearest-ancestor tags are those tags with a path between them and the `HEAD` commit, without any intervening tags. This is the default behavior of the plugin.
71
+
This is usually enough to start using the plugin. Assuming that you already have tags that are (or contain) semantic versions, the plugin will search for all nearest ancestor-tags, select the latest<sup>1</sup> of them as the base version, and increment the component with the least precedence. The nearest ancestor-tags are those tags with a path between them and the `HEAD` commit, without any intervening tags. This is the default behavior of the plugin.
72
72
73
-
<sup>1</sup> Latest based on ordering-rules defined in the semantic-version specification, **not latest by date**
73
+
<sup>1</sup> Latest based on ordering-rules defined in the semantic-version specification, **not latest by date**.
74
74
75
75
# Project properties
76
76
77
-
The plugin uses project properties to control how the version should be calculated. Some of these properties require values, whereas others don't. The ones that don't essentially behave like switches and their presence is enough to "turn on" specific behavior. Aside from providing these properties via the commandline using `-P`, the properties can also be specified in any other valid way, similar to how one would provide properties to `settings.gradle`. For example, you can set them through system properties or environment properties, depending on the situation. You can define them in `gradle.properties` as well if you wish, although that is usually not useful unless you want some sort of global versioning-configuration.
77
+
The plugin uses project properties to control how the version should be calculated. Some of these properties require values, whereas others don't. The ones that don't, essentially behave like switches and their presence is enough to "turn on" specific behavior. Aside from providing these properties via the commandline using `-P`, the properties can also be specified in any other valid way, similar to how one would provide properties to `settings.gradle`. For example, you can set them through system properties or environment properties, depending on the situation. You can define them in `gradle.properties` as well if you wish, although that is usually not useful unless you want some sort of global versioning-configuration.
78
78
79
79
## `bumpComponent`
80
80
@@ -140,15 +140,15 @@ This property specifies that the build is a release build, which means that a sn
140
140
141
141
## `tag`
142
142
143
-
This task will create an annotated-tag or lightweight-tag (see [`message`](#message))) corresponding to the new version (with an optional prefix; see [`tagPrefix`](#tagprefix)). It is recommended to use this task along with the `release` task when creating a release. **You cannot tag a snapshot release; use pre-release identifiers instead**.
143
+
This task will create an annotated or lightweighttag (see [`message`](#message)) corresponding to the new version (with an optional prefix; see [`tagPrefix`](#tagprefix)). It is recommended to use this task with a message (to force the creation of an annotated tag) along with the `release` task when creating a release. **You cannot tag a snapshot release; use pre-release identifiers if you want to deploy bleeding-edge versions**.
144
144
145
-
If you specify the option `--push` to the task, the create tag will also get pushed automatically.
145
+
If you specify the option `--push` to the task, the created tag will also get pushed automatically.
146
146
147
147
### `message`
148
148
149
-
The `message` property lets you control the annotated tag's message and whether the tag will be annotated or lightweight. The value of this property is expected to be a `Callable`, which will typically be a closure that returns a string. Any return value is acceptable and will be transformed to a `String`. If the return value is `null`, or the whole property is `null`, the tag will be lightweight. By default, the property is set to a closure that returns an empty string. This means an annotated tag without message will be created.
149
+
The `message` property lets you control the annotated tag's message and whether the tag will be an annotated or lightweight one. The value of this property is expected to be a `Callable`, which typically is a closure that returns a string (technically, any type is acceptable and its string representation is what is used). If the return value is `null`, or if the whole property itself is `null`, the created tag will be a lightweight one. By default, the property is set to a closure that returns an empty string, which creates an annotated tag without a message.
150
150
151
-
If you want to change this, you can define your own closure as follows:
151
+
If you want to change this behavior, you can define your own closure as follows:
152
152
153
153
**Example:** Defining a custom `message` closure:
154
154
```gradle
@@ -159,7 +159,7 @@ tag {
159
159
}
160
160
```
161
161
162
-
The `tag` task exposes six predefined-closures that allow you to provide the tag message via environment variables, system or project properties, each mandatory or optional; you are also able to specify the name of the variable or property. If the respective variable or property is set but has no value, an empty annotatedtag is created, if the variable or property is not set at all, a lightweight tag is created. If the mandatory variants are used, the absence of the variable or property is considered an error, an empty value still works for a no-message annotated tag. This way you can make sure the user does not forget to set the message when you want to force only annotated tags being created.
162
+
The `tag` task exposes six predefined-closures that allow you to provide the tag message via environment or system variables, or project properties (each of which can be made optional or mandatory); you are also able to specify the name of the variable or property. In the optional variants, if the respective variable or property is set but has no value, an empty annotated-tag is created. If the variable or property is not set at all, a lightweight tag is created. If the mandatory variants are used, the absence of the variable or property is considered an error, but an empty value can still be used for an annotated tag without a message. This way you can not only make sure that the user does not forget to set a message, but can also mandate the creation of annotated tags.
163
163
164
164
**Example:** Retrieving the tag message from an environment variable:
165
165
```gradle
@@ -304,7 +304,7 @@ These options let you restrict the set of tags considered when determining the b
304
304
305
305
### `tagPattern`
306
306
307
-
This pattern tells the plugin to only consider those tags matching `tagPattern` when trying to determine the base version from the tags in your repository. The value for this option has to be a regular expression. Its default value is `~/\d++\.\d++\.\d++/`, which means that all tags that contain a semanticversion part are considered and all others are ignored. This property can be, for example, to tag and version different sub-projects under a root-project individually, while using the same repository.
307
+
This pattern tells the plugin to only consider those tags matching `tagPattern` when trying to determine the base version from the tags in your repository. The value for this option has to be a regular expression. Its default value is `~/\d++\.\d++\.\d++/`, which means that all tags that contain a semantic-version portion are considered, while all others are ignored. This property can be used, for example, to tag and version different sub-projects under a root-project individually, while using the same repository.
308
308
309
309
**Example:** Only tags that start with `foo` should be considered
310
310
```gradle
@@ -357,9 +357,9 @@ This option allows you to specify how pre-release versions should be generated a
357
357
startingVersion = 'alpha.0'
358
358
}
359
359
```
360
-
- <aid="prerelease.pattern" />`pattern`: This option has a function similar to [`tagPattern`](#tagpattern), except that it allows you to restrict the set of tags considered to those tags with pre-release versions matching `pattern`. The value for this has to be a regular expression as a `String`. Its default value is `/.*+$/`. One thing to remember is that starting anchors (`^`) cannot be used, because the actual regular-expression that is used is `~/\d++\.\d++\.\d++-$pattern/`. Hence, if you are trying to filter based on pre-release versions starting with some string, it is simply enough to provide that string in the regular expression without prefixing it with `^`.
360
+
- <aid="prerelease.pattern" />`pattern`: This option has a function similar to [`tagPattern`](#tagpattern), except that it allows you to restrict the set of tags considered to those tags with pre-release versions matching `pattern`. The value for this has to be a regular expression as a `String`. Its default value is `/.*+$/`. One thing to remember is that starting anchors (`^`) cannot be used, because the actual regular-expression that is used is `~/\d++\.\d++\.\d++-$pattern/`. Hence, if you are trying to filter tags based on pre-release versions starting with some string, it is enough to provide that string in the regular expression without prefixing it with `^`.
361
361
362
-
**Example:** Only tags whose pre-release version starts with `alpha` should be considered
362
+
**Example:** Only tags whose pre-release versions start with `alpha` should be considered
363
363
```gradle
364
364
preRelease {
365
365
pattern = /alpha/
@@ -368,7 +368,7 @@ This option allows you to specify how pre-release versions should be generated a
368
368
369
369
**Note:** Filtering based on `pattern` is performed **after** tags have been filtered based on [`tagPattern`](#tagpattern) and [`matching`](#matching).
370
370
371
-
- <aid="prerelease.bump" />`bump`: This allows you to specify how pre-release versions should be incremented or bumped. It has to be a closure that accepts a single argument which will be the base pre-release version, and it is expected to return an object, whose `toString()` value is used as incremented version.
371
+
- <aid="prerelease.bump" />`bump`: This property allows you to specify how pre-release versions should be incremented or bumped. This is expected to be a closure that accepts a single argument (the base pre-release version), and is expected to return an object, whose `toString()` value is used as the incremented version.
372
372
373
373
**Example:** Defining how the pre-release version should be bumped
374
374
```gradle
@@ -382,11 +382,11 @@ This option allows you to specify how pre-release versions should be generated a
382
382
383
383
## Automatic bumping based on commit messages
384
384
385
-
Sometimes you might want to automatically bump your version as part of your continuous-integration process. Without this option, you would have to explicitly configure your CI process to use the corresponding `bumpComponent` property value, depending on the version component you want to bump. This is because the default behavior of the plugin is to bump the component with least precedence. Instead, you can configure the plugin to automatically bump the desired version-component based on the contents of all your commit messages since the nearest-ancestor tags; this essentially means messages from all unreleased ancestor-commits. If multiple commit-messages apply, then the component with the highest precedence wins. This way you can note in each commit message whether the change is major or minor directly, and this plugin uses that information to calculate the next versionnumber to be used.
385
+
Sometimes you might want to automatically bump your version as part of your continuous-integration process. Without this option, you would have to explicitly configure your CI process to use the corresponding `bumpComponent` property value, depending on the version component you want to bump. This is because the default behavior of the plugin is to bump the component with least precedence. Instead, you can configure the plugin to automatically bump the desired version-component based on the contents of all your commit messages since the nearest ancestor-tags; this essentially means messages from all unreleased ancestor-commits. If multiple commit-messages apply, then the component with the highest precedence wins. This way you can note in each commit message whether the change is major or minor directly, and this plugin uses that information to calculate the next version-number to be used.
386
386
387
387
### `autobump`
388
388
389
-
This option allows you to specify how the build version should be automatically bumped based on the contents of commit messages. The full message of each applicable commit-message is checked to see if a match of the specified pattern can be found. Note that in the case of multiple matches, the component with the highest precedence wins. This option has the following sub-options:
389
+
This option allows you to specify how the build version should be automatically bumped based on the contents of commit messages. The full message of each applicable commit-message is checked to see if a match for any of specified pattern can be found. Note that in the case of multiple matches, the component with the highest precedence wins. This option has the following sub-options:
390
390
391
391
-`majorPattern`: If any relevant commit message contains a match for `majorPattern`, the major version will be bumped. This has to be a regular expression, and its default value is `~/\[major\]/`, which means `[major]` anywhere in the commit message.
392
392
-`minorPattern`: If any relevant commit message contains a match for `minorPattern`, the minor version will be bumped. This has to be a regular expression, and its default value is `~/\[minor\]/`, which means `[minor]` anywhere in the commit message.
@@ -405,7 +405,7 @@ autobump {
405
405
}
406
406
```
407
407
408
-
**Example:** Defining multi-line pattern to be used by `autobump`
408
+
**Example:** Defining a multi-line pattern to be used by `autobump`
409
409
```gradle
410
410
autobump {
411
411
minorPattern = ~/(?mx) # enable multi-line and comment mode
0 commit comments