| @@ -0,0 +1,5 | |||||
|
|
1 | subprojects { p -> | |||
|
|
2 | plugins.withId('java') { | |||
|
|
3 | p.archivesBaseName = "$rootProject.name-$p.name"; | |||
|
|
4 | } | |||
|
|
5 | } No newline at end of file | |||
| @@ -1,26 +1,38 | |||||
| 1 | plugins { |
|
1 | plugins { | |
| 2 | id "java-gradle-plugin" |
|
2 | id "java-gradle-plugin" | |
| 3 |
id "com.gradle.plugin-publish" version "0. |
|
3 | id "com.gradle.plugin-publish" version "0.20.0" | |
|
|
4 | // Apply the Maven Publish Plugin to have it generate the publication metadata | |||
|
|
5 | id 'maven-publish' | |||
| 4 | } |
|
6 | } | |
| 5 |
|
7 | |||
| 6 | repositories { |
|
8 | repositories { | |
| 7 | mavenCentral() |
|
9 | mavenCentral() | |
| 8 | } |
|
10 | } | |
| 9 |
|
11 | |||
| 10 | gradlePlugin { |
|
12 | gradlePlugin { | |
| 11 | plugins { |
|
13 | plugins { | |
| 12 | mercurialPlugin { |
|
14 | mercurialPlugin { | |
| 13 | id = 'org.implab.gradle-mercurial' |
|
15 | id = 'org.implab.gradle-mercurial' | |
| 14 | implementationClass = 'org.implab.gradle.mercurial.MercurialPlugin' |
|
16 | implementationClass = 'org.implab.gradle.mercurial.MercurialPlugin' | |
| 15 | displayName = "Integrates mercurial into the build script" |
|
|||
| 16 | description = 'Automatically calculates version using tags. Simple wrapper around cli.' |
|
|||
| 17 | } |
|
17 | } | |
| 18 | } |
|
18 | } | |
| 19 | } |
|
19 | } | |
| 20 |
|
20 | |||
| 21 | pluginBundle { |
|
21 | pluginBundle { | |
| 22 | website = 'https://code.implab.org/implab/gradle-mercurial-plugin' |
|
22 | website = 'https://code.implab.org/implab/gradle-mercurial-plugin' | |
| 23 | vcsUrl = 'https://code.implab.org/implab/gradle-mercurial-plugin' |
|
23 | vcsUrl = 'https://code.implab.org/implab/gradle-mercurial-plugin' | |
| 24 |
|
24 | |||
| 25 | tags = ['hg', 'mercurial'] |
|
25 | plugins { | |
|
|
26 | mercurialPlugin { | |||
|
|
27 | displayName = "Integrates mercurial into the build script" | |||
|
|
28 | description = 'Automatically calculates version using tags. Simple wrapper around cli.' | |||
|
|
29 | tags = ['hg', 'mercurial', 'versioning'] | |||
|
|
30 | } | |||
|
|
31 | } | |||
| 26 | } |
|
32 | } | |
|
|
33 | ||||
|
|
34 | task printVersion { | |||
|
|
35 | doLast { | |||
|
|
36 | println "${->jar.archiveFileName.get()}" | |||
|
|
37 | } | |||
|
|
38 | } No newline at end of file | |||
| @@ -1,120 +1,120 | |||||
| 1 | # Mercurial build integration |
|
1 | # Mercurial build integration | |
| 2 |
|
2 | |||
| 3 | ## SYNOPSIS |
|
3 | ## SYNOPSIS | |
| 4 |
|
4 | |||
| 5 | ```groovy |
|
5 | ```groovy | |
| 6 |
|
6 | |||
| 7 | plugins { |
|
7 | plugins { | |
| 8 | id 'org.implab.gradle-mercurial' version '1.0' |
|
8 | id 'org.implab.gradle-mercurial' version '1.0.0' // or specify latest version | |
| 9 | } |
|
9 | } | |
| 10 |
|
10 | |||
| 11 | mercurial { |
|
11 | mercurial { | |
| 12 | releaseBookmark = 'prod' |
|
12 | releaseBookmark = 'prod' | |
| 13 |
|
13 | |||
| 14 | preReleasePolicy { it |
|
14 | preReleasePolicy { it | |
| 15 | // this is the default behaviour |
|
15 | // this is the default behaviour | |
| 16 | .addPatch(1) |
|
16 | .addPatch(1) | |
| 17 | .withPreRelease('snapshot') |
|
17 | .withPreRelease('snapshot') | |
| 18 | .withMeta('changeset') |
|
18 | .withMeta('changeset') | |
| 19 | } |
|
19 | } | |
| 20 |
|
20 | |||
| 21 | // get version from repository and apply it to the project |
|
21 | // get version from repository and apply it to the project | |
| 22 | applyVersioningPolicy() |
|
22 | applyVersioningPolicy() | |
| 23 | } |
|
23 | } | |
| 24 |
|
24 | |||
| 25 | ``` |
|
25 | ``` | |
| 26 |
|
26 | |||
| 27 | ## DESCRIPTION |
|
27 | ## DESCRIPTION | |
| 28 |
|
28 | |||
| 29 | ### `semver(versionString)` |
|
29 | ### `semver(versionString)` | |
| 30 |
|
30 | |||
| 31 | Parses the specified version string and returns the semantic version object |
|
31 | Parses the specified version string and returns the semantic version object | |
| 32 |
|
32 | |||
| 33 | ### `mercurial(Closure configure)` |
|
33 | ### `mercurial(Closure configure)` | |
| 34 |
|
34 | |||
| 35 | The extension added by the plugin to the project. Apply this plugin to the |
|
35 | The extension added by the plugin to the project. Apply this plugin to the | |
| 36 | root project and use the `mercurial { ... }` section to configure the |
|
36 | root project and use the `mercurial { ... }` section to configure the | |
| 37 | versioning. |
|
37 | versioning. | |
| 38 |
|
38 | |||
| 39 | See the description below for more details about settings. |
|
39 | See the description below for more details about settings. | |
| 40 |
|
40 | |||
| 41 | #### `hgCmd` |
|
41 | #### `hgCmd` | |
| 42 |
|
42 | |||
| 43 | The command which will be executed to perform the mercurial commands. |
|
43 | The command which will be executed to perform the mercurial commands. | |
| 44 | The default value is `hg`. |
|
44 | The default value is `hg`. | |
| 45 |
|
45 | |||
| 46 | #### `outputCharset` |
|
46 | #### `outputCharset` | |
| 47 |
|
47 | |||
| 48 | The charset for the `hgCmd` output, this property defaults |
|
48 | The charset for the `hgCmd` output, this property defaults | |
| 49 | to the default charset of the operating system. |
|
49 | to the default charset of the operating system. | |
| 50 |
|
50 | |||
| 51 | #### `hg(...args)` |
|
51 | #### `hg(...args)` | |
| 52 |
|
52 | |||
| 53 | Executes the mercurial command, returns the command output as text. |
|
53 | Executes the mercurial command, returns the command output as text. | |
| 54 |
|
54 | |||
| 55 | #### `workspaceInfo` (read-only) |
|
55 | #### `workspaceInfo` (read-only) | |
| 56 |
|
56 | |||
| 57 | Returns the information about current workspace, see description |
|
57 | Returns the information about current workspace, see description | |
| 58 | below for details. |
|
58 | below for details. | |
| 59 |
|
59 | |||
| 60 | #### `workspaceVersion` |
|
60 | #### `workspaceVersion` | |
| 61 |
|
61 | |||
| 62 | Returns the semantic version obtained from the repository. Querying |
|
62 | Returns the semantic version obtained from the repository. Querying | |
| 63 | this property will lead querying the workspace info. |
|
63 | this property will lead querying the workspace info. | |
| 64 |
|
64 | |||
| 65 | #### `applyVersioningPolicy()` |
|
65 | #### `applyVersioningPolicy()` | |
| 66 |
|
66 | |||
| 67 | Reads the workspace information and sets the version of the project |
|
67 | Reads the workspace information and sets the version of the project | |
| 68 | according to settings. |
|
68 | according to settings. | |
| 69 |
|
69 | |||
| 70 | If the version was specified using properties, then the specified |
|
70 | If the version was specified using properties, then the specified | |
| 71 | version will take preceding over the calculated one. |
|
71 | version will take preceding over the calculated one. | |
| 72 |
|
72 | |||
| 73 | #### `preReleasePolicy(Closure<SemVersion> config)` |
|
73 | #### `preReleasePolicy(Closure<SemVersion> config)` | |
| 74 |
|
74 | |||
| 75 | The closure which is used to calculate the version of the project |
|
75 | The closure which is used to calculate the version of the project | |
| 76 | when the current commit isn't marked with a version tag. |
|
76 | when the current commit isn't marked with a version tag. | |
| 77 |
|
77 | |||
| 78 | The default behaviour is to increment the patch version and |
|
78 | The default behaviour is to increment the patch version and | |
| 79 | to set the pre-release suffix to `'snapshot'`. |
|
79 | to set the pre-release suffix to `'snapshot'`. | |
| 80 |
|
80 | |||
| 81 | ### `WorkspaceInfo` |
|
81 | ### `WorkspaceInfo` | |
| 82 |
|
82 | |||
| 83 | This class encapsulates information about the current workspace. |
|
83 | This class encapsulates information about the current workspace. | |
| 84 | All properties are read-only. |
|
84 | All properties are read-only. | |
| 85 |
|
85 | |||
| 86 | #### `versionTag` |
|
86 | #### `versionTag` | |
| 87 |
|
87 | |||
| 88 | The original version tag from the repository before parsing. |
|
88 | The original version tag from the repository before parsing. | |
| 89 |
|
89 | |||
| 90 | #### `changeSet` |
|
90 | #### `changeSet` | |
| 91 |
|
91 | |||
| 92 | The changeset id of the current workspace. |
|
92 | The changeset id of the current workspace. | |
| 93 |
|
93 | |||
| 94 | #### `versionDistance` |
|
94 | #### `versionDistance` | |
| 95 |
|
95 | |||
| 96 | The distance in commits to the versionTag |
|
96 | The distance in commits to the versionTag | |
| 97 |
|
97 | |||
| 98 | #### `branch` |
|
98 | #### `branch` | |
| 99 |
|
99 | |||
| 100 | The name of the current sources branch. |
|
100 | The name of the current sources branch. | |
| 101 |
|
101 | |||
| 102 | #### `isDirty` |
|
102 | #### `isDirty` | |
| 103 |
|
103 | |||
| 104 | This flag indicates uncommited changes to the workspace. This flag is useful |
|
104 | This flag indicates uncommited changes to the workspace. This flag is useful | |
| 105 | to control some pipelines which run locally on developer machines. |
|
105 | to control some pipelines which run locally on developer machines. | |
| 106 |
|
106 | |||
| 107 | ## TASKS |
|
107 | ## TASKS | |
| 108 |
|
108 | |||
| 109 | ### `release` |
|
109 | ### `release` | |
| 110 |
|
110 | |||
| 111 | Marks this commit with current version and pre-release suffix removed and |
|
111 | Marks this commit with current version and pre-release suffix removed and | |
| 112 | moves the `release` bookmark to it. |
|
112 | moves the `release` bookmark to it. | |
| 113 |
|
113 | |||
| 114 | ### `staging` |
|
114 | ### `staging` | |
| 115 |
|
115 | |||
| 116 | Marks this commit with current version and moves the `staging` bookmark to it. |
|
116 | Marks this commit with current version and moves the `staging` bookmark to it. | |
| 117 |
|
117 | |||
| 118 | ### `printVersion` |
|
118 | ### `printVersion` | |
| 119 |
|
119 | |||
| 120 | Prints the current version. |
|
120 | Prints the current version. | |
| @@ -1,13 +1,13 | |||||
| 1 | /* |
|
1 | /* | |
| 2 | * This settings file was generated by the Gradle 'init' task. |
|
2 | * This settings file was generated by the Gradle 'init' task. | |
| 3 | * |
|
3 | * | |
| 4 | * The settings file is used to specify which projects to include in your build. |
|
4 | * The settings file is used to specify which projects to include in your build. | |
| 5 | * In a single project build this file can be empty or even removed. |
|
5 | * In a single project build this file can be empty or even removed. | |
| 6 | * |
|
6 | * | |
| 7 | * Detailed information about configuring a multi-project build in Gradle can be found |
|
7 | * Detailed information about configuring a multi-project build in Gradle can be found | |
| 8 | * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html |
|
8 | * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html | |
| 9 | */ |
|
9 | */ | |
| 10 |
|
10 | |||
| 11 |
rootProject.name = ' |
|
11 | rootProject.name = 'implab-gradle' | |
| 12 |
|
12 | |||
| 13 | include 'mercurial' |
|
13 | include 'mercurial' | |
General Comments 0
You need to be logged in to leave comments.
Login now
