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