Skip to content

Commit b1c25f2

Browse files
committed
feat: major refactoring
1 parent 13a5882 commit b1c25f2

File tree

17 files changed

+779
-543
lines changed

17 files changed

+779
-543
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ jobs:
1616
./gradlew assemble
1717
- name: Test with Gradle
1818
run: |
19+
unset GITHUB_ACTIONS
1920
./gradlew test

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,71 @@
11
# Changelog
22

3+
## 5.0.0
4+
5+
##### Features
6+
* Add GitHub Actions, GitLab CI and Jenkins environment variable support
7+
* GitHub Actions: if `$GITHUB_ACTIONS == true`, `GITHUB_REF` is considered
8+
* GitLab CI: if `$GITLAB_CI == true`, `CI_COMMIT_BRANCH` and `CI_COMMIT_TAG` are considered
9+
* Circle CI: if `$CIRCLECI == true`, `CIRCLE_BRANCH` and `CIRCLE_TAG` are considered
10+
* Jenkins: if `JENKINS_HOME` is set, `BRANCH_NAME` and `TAG_NAME` are considered
11+
* Simplify configuration (also see BREAKING CHANGES)
12+
13+
**Groovy DSL Example:** `build.gradle`
14+
```groovy
15+
version = '0.0.0-SNAPSHOT'
16+
gitVersioning.apply {
17+
refs {
18+
branch('.+') {
19+
version = '${ref}-SNAPSHOT'
20+
}
21+
tag('v(?<version>.*)') {
22+
version = '${ref.version}'
23+
}
24+
}
25+
26+
// optional fallback configuration in case of no matching ref configuration
27+
rev {
28+
version = '${commit}'
29+
}
30+
}
31+
```
32+
33+
**Kotlin DSL Example:** `build.gradle.kts`
34+
```kotlin
35+
version = "0.0.0-SNAPSHOT"
36+
gitVersioning.apply {
37+
refs {
38+
branch(".+") {
39+
version = "\${ref}-SNAPSHOT"
40+
}
41+
tag('v(?<version>.*)') {
42+
version = "\${ref.version}"
43+
}
44+
}
45+
46+
// optional fallback configuration in case of no matching ref configuration
47+
rev {
48+
version = "\${commit}"
49+
}
50+
}
51+
```
52+
* New option to consider tag configs on branches (attached HEAD), enabled by `refs { considerTagsOnBranches = true }`
53+
* If enabled, first matching branch or tag config will be used for versioning
54+
55+
##### BREAKING CHANGES
56+
* There is no default config anymore, if no `ref` configuration is matching current git situation and no `rev` configuration has been
57+
defined a warning message will be logged and plugin execution will be skipped.
58+
* Placeholder Changes (old -> new)
59+
* `${branch}` -> `${ref}`
60+
* `${tag}` -> `${ref}`
61+
* `${REF_PATTERN_GROUP}` -> `${ref.REF_PATTERN_GROUP}`
62+
* `${describe.TAG_PATTERN_GROUP}` -> `${describe.tag.TAG_PATTERN_GROUP}`
63+
* `preferTags` option was removed
64+
* use `refs { considerTagsOnBranches = true }` instead
65+
66+
367
## 4.3.0
68+
469
* **Features**
570
* add git describe version placeholders
671
* new placeholders
@@ -13,13 +78,17 @@
1378
* no longer provide project property `git.dirty` due to performance issues on larger projects,
1479
version format placeholder `${dirty}` is still available
1580
81+
1682
## 4.1.0
83+
1784
* **Features**
1885
* add ability to define default or overwrite values for version and property format.
1986
* default value if parameter value is not set `${paramter:-<DEFAULT_VALUE>}` e.g. `${buildNumber:-0}`
2087
* overwrite value if parameter has a value `${paramter:+<OVERWRITE_VALUE>}` e.g. `${dirty:+-SNAPSHOT}`
2188
89+
2290
## 4.0.0 - **Major refactoring**
91+
2392
* **Features**
2493
* Add option to disable plugin by default and enable on demand.
2594
* Add option to modify project `gradle.properties` file accordingly to plugin related changes.
@@ -49,6 +118,7 @@
49118
50119
51120
## 3.0.0
121+
52122
#### Features
53123
* simplify `property` replacement configuration
54124
@@ -84,10 +154,13 @@
84154
}
85155
```
86156
157+
87158
### 2.1.0
159+
88160
* add `${dirty}` flag version format placeholder
89161
* add `git.dirty` property
90162
163+
91164
### 2.0.0
92165
93166
#### Breaking Changes

0 commit comments

Comments
 (0)