@@ -29,7 +29,7 @@ This extension can virtually set project version and properties, based on curren
29
29
30
30
``` groovy
31
31
plugins {
32
- id 'me.qoomon.git-versioning' version '5.0 .0'
32
+ id 'me.qoomon.git-versioning' version '5.1 .0'
33
33
}
34
34
35
35
version = '0.0.0-SNAPSHOT'
@@ -42,7 +42,7 @@ gitVersioning.apply {
42
42
43
43
``` kotlin
44
44
plugins {
45
- id(" me.qoomon.git-versioning" ) version " 5.0 .0"
45
+ id(" me.qoomon.git-versioning" ) version " 5.1 .0"
46
46
}
47
47
48
48
@@ -153,23 +153,16 @@ e.g `${dirty:-SNAPSHOT}` resolves to `-SNAPSHOT` instead of `-DIRTY`
153
153
154
154
###### Placeholders
155
155
156
- - ` ${env.VARIABLE} `
157
- - Value of environment variable ` VARIABLE `
158
- - ` ${property.name} `
159
- - Value of commandline property ` -Pname=value `
160
- <br ><br >
161
-
162
- - ` ${version} `
163
- - project ` version ` (probably set in ` build.gradle ` )
164
- - e.g. '1.0.0-SNAPSHOT'
165
- - ` ${version.release} `
166
- - like ` ${version} ` without ` -SNAPSHOT ` postfix
167
- - e.g. '1.0.0'
168
- <br ><br >
169
-
170
- - ` ${ref} ` ` ${ref.slug} `
171
- - HEAD ref name (branch or tag name or commit hash)
172
- - ` Ref Pattern Groups `
156
+ - ` ${env.VARIABLE} ` Value of environment variable ` VARIABLE `
157
+ - ` ${property.name} ` Value of commandline property ` -Pname=value `
158
+ <br ><br >
159
+
160
+ - ` ${version} ` ` <version> ` set in ` pom.xml ` e.g. '1.0.0-SNAPSHOT'
161
+ - ` ${version.release} ` like ` ${version} ` without ` -SNAPSHOT ` postfix e.g. '1.0.0'
162
+ <br ><br >
163
+
164
+ - ` ${ref} ` ` ${ref.slug} ` ref name (branch or tag name or commit hash)
165
+ - Ref Pattern Groups
173
166
- Content of regex groups in branch/tag ` pattern ` can be addressed like this:
174
167
- ` ${ref.GROUP_NAME} ` ` ${ref.GROUP_NAME.slug} `
175
168
- ` ${ref.GROUP_INDEX} ` ` ${ref.GROUP_INDEX.slug} `
@@ -189,76 +182,52 @@ e.g `${dirty:-SNAPSHOT}` resolves to `-SNAPSHOT` instead of `-DIRTY`
189
182
```
190
183
<br>
191
184
192
- - `${commit}`
193
- - The `HEAD` commit hash
194
- - e.g. '0fc20459a8eceb2c4abb9bf0af45a6e8af17b94b'
195
- - `${commit.short}`
196
- - The short `HEAD` commit hash (7 characters)
197
- - e.g. '0fc2045'
198
- - `${commit.timestamp}`
199
- - The `HEAD` commit timestamp (epoch seconds)
200
- - e.g. '1560694278'
201
- - `${commit.timestamp.year}`
202
- - The `HEAD` commit year
203
- - e.g. '2021'
204
- - `${commit.timestamp.month}`
205
- - The `HEAD` commit month of year
206
- - e.g. '01'
207
- - `${commit.timestamp.day}`
208
- - The `HEAD` commit day of month
209
- - e.g. '01'
210
- - `${commit.timestamp.hour}`
211
- - The `HEAD` commit hour of day (24h)
212
- - e.g. '01'
213
- - `${commit.timestamp.minute}`
214
- - The `HEAD` commit minute of hour
215
- - e.g. '01'
216
- - `${commit.timestamp.second}`
217
- - The `HEAD` commit second of minute
218
- - e.g. '01'
219
- - `${commit.timestamp.datetime}`
220
- - The `HEAD` commit timestamp formatted as `yyyyMMdd.HHmmss`
221
- - e.g. '20190616.161442'
222
- <br><br>
223
-
224
- - `${describe}`
225
- - Will resolve to `git describe` output
226
- - ⚠️ Can lead to performance issue on projects with a lot of tags
227
- - `${describe.distance}`
228
- - The distance count to last matching tag
229
- - `${describe.tag}`
230
- - The matching tag of `git describe`
231
- - Describe Tag Pattern Groups
232
- - Content of regex groups in `describeTagPattern` can be addressed like this:
233
- - `${describe.tag.GROUP_NAME}` `${describe.tag.GROUP_NAME.slug}`
234
- - `${describe.tag.GROUP_INDEX}` `${describe.tag.GROUP_INDEX.slug}`
235
- - Named Group Example
236
-
237
- **groovy**
238
- ```groovy
239
- branch('main') {
240
- describeTagPattern = 'v(?<version>.*)'
241
- version = '${ref.feature}-SNAPSHOT'
242
- }
243
- ```
244
- **kotlin**
245
- ```kotlin
246
- branch("main") {
247
- describeTagPattern = "v(?<version>.*)"
248
- version = "\${describe.tag.version}-SNAPSHOT"
249
- }
250
- ```
251
- <br>
252
-
253
- - `${dirty}`
254
- - If repository has untracked files or uncommitted changes this placeholder will resolve to `-DIRTY`, otherwise it will resolve to an empty string.
185
+ - `${commit}` commit hash '0fc20459a8eceb2c4abb9bf0af45a6e8af17b94b'
186
+ - `${commit.short}` commit hash (7 characters) e.g. '0fc2045'
187
+ - `${commit.timestamp}` commit timestamp (epoch seconds) e.g. '1560694278'
188
+ - `${commit.timestamp.year}` commit year e.g. '2021'
189
+ - `${commit.timestamp.year.2digit}` 2-digit commit year.g. '21'
190
+ - `${commit.timestamp.month}` commit month of year e.g. '12'
191
+ - `${commit.timestamp.day}` commit day of month e.g. '23'
192
+ - `${commit.timestamp.hour}` commit hour of day (24h)e.g. '13'
193
+ - `${commit.timestamp.minute}` commit minute of hour e.g. '59'
194
+ - `${commit.timestamp.second}` commit second of minute e.g. '30'
195
+ - `${commit.timestamp.datetime}` commit timestamp formatted as `yyyyMMdd.HHmmss`e.g. '20190616.161442'
196
+ <br><br>
197
+
198
+ - `${describe}` Will resolve to `git describe` output
199
+ - ⚠️ `${describe....}` placeholders can lead to performance issue on projects with a lot of tags
200
+ - `${describe.distance}` The distance count to last matching tag
201
+ - `${describe.tag}` The matching tag of `git describe`
202
+ - Describe Tag Pattern Groups
203
+ - Content of regex groups in `describeTagPattern` can be addressed like this:
204
+ - `${describe.tag.GROUP_NAME}` `${describe.tag.GROUP_NAME.slug}`
205
+ - `${describe.tag.GROUP_INDEX}` `${describe.tag.GROUP_INDEX.slug}`
206
+ - Named Group Example
207
+
208
+ **groovy**
209
+ ```groovy
210
+ branch('main') {
211
+ describeTagPattern = 'v(?<version>.*)'
212
+ version = '${ref.feature}-SNAPSHOT'
213
+ }
214
+ ```
215
+ **kotlin**
216
+ ```kotlin
217
+ branch("main") {
218
+ describeTagPattern = "v(?<version>.*)"
219
+ version = "\${describe.tag.version}-SNAPSHOT"
220
+ }
221
+ ```
222
+ <br>
223
+
224
+ - `${dirty}` If repository has untracked files or uncommitted changes this placeholder will resolve to `-DIRTY`, otherwise it will resolve to an empty string.
255
225
- ⚠️ Can lead to performance issue on very large projects
256
- - `${dirty.snapshot}`
257
- - Like `${dirty}`, but will resolve to `-SNAPSHOT`
258
- <br><br>
226
+ - `${dirty.snapshot}` Like `${dirty}`, but will resolve to `-SNAPSHOT`
227
+ <br><br>
228
+
229
+ - `${value}` Original value of matching property (Only available within property format)
259
230
260
- - `${value}` - Only available within property format
261
- - Original value of matching property
262
231
263
232
### Parameters & Environment Variables
264
233
0 commit comments