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
Note that since 3.0.0, this plugin is now published in maven central.
16
+
15
17
3 - Plugins
16
18
===========
19
+
20
+
3.0 - Release type concept
21
+
--------------------------
22
+
Most plugins exposes the `releaseType` property (of type `org.pongasoft.gradle.core.ReleaseType`) which is an
23
+
enumeration describing for what type of release the current build is being done.
24
+
25
+
- whether the build is producing snapshots or not (determined by whether the version ends with `-SNAPSHOT`). If you use
26
+
the `org.pongasoft.spec` as described below then it will be in snapshot mode unless you provide `-Prelease=true`
27
+
when building.
28
+
- whether the release is being done in a local repository or remote repository (determined by the `remote` property
29
+
which can be set by `-Premote=true` when building)
30
+
31
+
Note that this concept is exported by most plugins, but is actually not being used by them. It is a convenience that allows
32
+
you to conditionally setup publications and repositories or create/disable tasks based on this value. See `publishing.gradle`
33
+
for a good example on how this property is being used to dynamically define the kind of publication and repository to use.
34
+
17
35
18
36
3.1 - `org.pongasoft.userConfig`
19
37
-------------------------------
20
-
`org.pongasoft.userConfig` is a plugin which attempts to load user configuration (for the gradle
38
+
This plugin plugin attempts to load user configuration (for the gradle
21
39
build) in the following files (values read last overrides previous values) and make it available
22
40
to all gradle build files as a `userConfig` object (instance of `groovy.util.ConfigObject`).
23
41
Check [groovy.util.ConfigSlurper](http://groovy-lang.org/gapi/groovy/util/ConfigSlurper.html) for details on the syntax.
@@ -41,20 +59,33 @@ This plugin should be used only in the root project when doing a multi project b
41
59
42
60
3.2 - `org.pongasoft.spec`
43
61
-------------------------
44
-
`org.pongasoft.spec` is a plugin which reads a file called `project-spec.groovy` (or
62
+
This plugin reads a file called `project-spec.groovy` (or
45
63
`project-spec.json`) and makes it available in all build files as a `spec` object (instance of
46
-
`java.util.Map`). This plugin automatically handles `spec.version` in this fashion: always force
64
+
`java.util.Map`).
65
+
66
+
This plugin automatically handles `spec.version` in this fashion: always force
47
67
snapshot mode (meaning version ends with `-SNAPSHOT`) unless `-Prelease=true` is provided when
48
68
running the build. See an [example](https://github.com/pongasoft/gradle-plugins/blob/master/project-spec.groovy) of
49
69
this file and how it is being used in this project itself!
50
70
51
-
3.3. - `org.pongasoft.repository`
52
-
--------------------------------
53
-
`org.pongasoft.repository` is a plugin which allows you to externalize repository configuration
54
-
and override it with your own defaults (for example if you do not want to use maven central). In a
55
-
similar fashion to the `org.pongasoft.userConfig` plugin, it reads an optional set of files (values
71
+
The recommended approach is to define it this way (at the root level)
72
+
73
+
apply plugin: 'org.pongasoft.spec'
74
+
75
+
allprojects {
76
+
group = spec.group
77
+
version = spec.version
78
+
}
79
+
80
+
81
+
82
+
3.3. - `org.pongasoft.externalRepositories`
83
+
-------------------------------------------
84
+
This plugin allows you to externalize repository configuration
85
+
and override it with your own defaults (for example if you do not want to use maven central). Similarly to the
86
+
`org.pongasoft.userConfig` plugin, it reads an optional set of files (values
56
87
read last overrides previous values) and makes it available to all build files as a
57
-
`allRepositories` object (instance of [org.pongasoft.gradle.core.RepositoryPluginExtension](https://github.com/pongasoft/gradle-plugins/blob/master/buildSrc/src/main/groovy/org/linkedin/gradle/core/RepositoryPluginExtension.groovy)).
88
+
`externalRepositories` object (instance of [org.pongasoft.gradle.core.RepositoryPluginExtension](https://github.com/pongasoft/gradle-plugins/blob/master/buildSrc/src/main/groovy/org/linkedin/gradle/core/RepositoryPluginExtension.groovy)).
58
89
59
90
repositories.gradle
60
91
repositories-${project.group}.gradle
@@ -76,59 +107,42 @@ Those files are looked into the following folders:
76
107
You can provide your own location by using `-Prepositories.gradle=...` (this will override the
77
108
entire list).
78
109
79
-
This plugin can be used only in the root project when doing a multi project build. But if you want
80
-
to access `project` specific values, then you need to apply it in each sub projects
81
-
82
-
You can define any repository name and they are made available into any build script:
110
+
You can define any repository names, and they are made available into any build script:
83
111
84
112
buildscript {
85
-
allRepositories.buildscript.configure()
113
+
externalRepositories.buildscript.configure()
86
114
}
87
115
88
-
allRepositories.build.configure()
116
+
externalRepositories.build.configure()
89
117
90
118
91
-
This plugin no longer supports bintray following the [JFrog sunsetting bintray](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)
119
+
This plugin no longer supports bintray following [JFrog sunsetting bintray](https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/)
92
120
93
121
Check the `repositories.gradle` file that comes with this project for examples.
94
122
95
123
3.4 - `org.pongasoft.release`
96
124
----------------------------
97
-
`org.pongasoft.release` is a plugin which adds `release` and `publish` tasks. `release` is supposed
98
-
to build and release in a local repository. `publish` is supposed to publish in a remote
99
-
repository. By default, `publish` will publish (without rebuilding!) what has been released when
100
-
invoking the `release` task on a previous build. This allows the following use case: build and
101
-
release (locally), do some sanity check and if everything is ok, then do a `publish` which will
102
-
simply publish what has already been built. If you want to rebuild on `publish` then simply add
103
-
the property `-Prebuild=true`. If it is a java or groovy project, it also releases/publishes
104
-
sources, javadoc and groovydoc. The plugin also knows about snapshots (where the version ends
105
-
with `-SNAPSHOT`). The repositories are configured using the `org.pongasoft.repository` plugin
106
-
with the following values:
107
-
108
-
allRepositories.release -> for release
109
-
allRepositories.snapshotRelease -> for release of snapshots
110
-
allRepositories.publish -> for publish
111
-
allRepositories.snapshotPublish -> for publish of snapshots
112
-
113
-
See [repositories.gradle](https://github.com/pongasoft/gradle-plugins/blob/master/repositories.gradle)
114
-
for an example of configuration.
115
-
116
-
Note that local vs remote is not enforced and totally depends on how you set up the repositories.
117
-
By default `release` does a build and release, and `publish` does a publish of what has already
118
-
been built and released in a previous build.
119
-
120
-
The plugin adds a `release` extension which allows you to change which repository gets used on a
121
-
per project basis:
122
-
123
-
release {
124
-
publish = allRepositories.distributions
125
-
}
125
+
This plugin does the following (by default):
126
+
127
+
- creates a `releaseMaster` configuration which extends `archives`
128
+
- creates `javadocJar`, `groovydocJar` and `sourcesJar` tasks (depending on the kind of artifacts built)
129
+
- creates a `release` task which automatically publishes all the artifacts that are part of the `releaseMaster` configuration using a publication named `release` in a repository named `release`
130
+
131
+
This plugin is highly configurable:
126
132
127
-
This plugin is used in every project that needs to be released.
133
+
- you can change the configurations (`release.releaseConfigurations`, `release.sourcesConfigurations`, `release.javadocConfigurations`, `release.groovydocConfigurations`)
134
+
- you can change the name of the task, repository or publication (all defaulting to `release`)
135
+
- you can disable the creation of the task entirely by setting `release.repositoryName` (or `release.publicationName`) to `null`
136
+
- you can invoke `release.createConfigurationPublicationTask(...)` to create your own task(s) to publish a particular configuration in a particular combination of publication/repository (useful after disabling the main task generation)
137
+
138
+
This plugin exports the `releaseType` concept.
139
+
140
+
Note that since 3.0.0, this plugin is no longer aware of snapshots or remote as this is directly handled in the
141
+
publication itself by using the `releaseType` concept.
128
142
129
143
3.5 - `org.pongasoft.cmdline`
130
144
----------------------------
131
-
`org.pongasoft.cmdline` is a plugin which adds the following tasks:
145
+
This plugin adds the following tasks:
132
146
133
147
*`package-assemble`: Assembles the package (exploded)
134
148
*`package`: Create the package
@@ -149,7 +163,7 @@ as executables.
149
163
All files under `src/cmdline/resources` are also processed through a replacement token plugin if
150
164
you provide replacement tokens.
151
165
152
-
This plugin is highly configurable through the [CmdLinePluginConvention](https://github.com/pongasoft/gradle-plugins/blob/master/buildSrc/src/main/groovy/org/linkedin/gradle/plugins/CmdLinePlugin.groovy)
166
+
This plugin is highly configurable through the [CmdlinePluginConvention](https://github.com/pongasoft/gradle-plugins/blob/master/buildSrc/src/main/groovy/org/linkedin/gradle/plugins/CmdlinePlugin.groovy)
153
167
available in the build file
154
168
as `cmdline`:
155
169
@@ -172,7 +186,7 @@ the root of the package. To disable this feature use:
172
186
173
187
3.6 - `org.pongasoft.buildInfo`
174
188
-------------------------------
175
-
`org.pongasoft.buildInfo` is a plugin which adds the property `buildInfo` to the root project and
189
+
This plugin adds the property `buildInfo` to the root project and
176
190
generates a file (at the root of the build) when the build completes. The content of this file is
177
191
a json representation of the `buildInfo`. Example of content:
178
192
@@ -189,15 +203,69 @@ a json representation of the `buildInfo`. Example of content:
189
203
"buildDuration": 13996,
190
204
"buildDurationString": "13.996 secs",
191
205
"buildTasks": [
192
-
"publish"
206
+
"release"
193
207
]
194
208
}
195
209
210
+
3.7 - `org.pongasoft.signing`
211
+
-----------------------------
212
+
This plugin does the following:
213
+
214
+
- automatically populates `signing.keyId`, `signing.password` and `signing.secretKeyRingFile` properties
215
+
from values defined either in `userConfig` file (see `org.pongasoft.userConfig` plugin), `project-spec.groovy`
216
+
(see `org.pongasoft.spec` plugin), command line (ex: `-Psigning.keyId=xxx`) or an environment variable
217
+
(ex: `SIGNING_KEY`)
218
+
- apply the `signing` plugin to the publications (`sign project.publishing.publications`)
219
+
220
+
3.8 - `org.pongasoft.externalPublishing`
221
+
----------------------------------------
222
+
This plugin allows you to externalize publishing configuration and override it with your own defaults. Similarly to the
223
+
`org.pongasoft.userConfig` plugin, it reads an optional set of files (values read last overrides previous values). See
224
+
`publishing.gradle` in this project for an example.
0 commit comments