Skip to content

Commit 939939a

Browse files
committed
updated readme and release notes
1 parent f81abc0 commit 939939a

File tree

2 files changed

+132
-56
lines changed

2 files changed

+132
-56
lines changed

README.md

Lines changed: 122 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,34 @@ In order to use the plugins you need to add this to your build script:
88

99
buildscript {
1010
dependencies {
11-
classpath 'org.pongasoft:org.pongasoft.gradle-plugins:2.2.10'
11+
classpath 'org.pongasoft:org.pongasoft.gradle-plugins:3.0.0'
1212
}
1313
}
1414

15+
Note that since 3.0.0, this plugin is now published in maven central.
16+
1517
3 - Plugins
1618
===========
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+
1735

1836
3.1 - `org.pongasoft.userConfig`
1937
-------------------------------
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
2139
build) in the following files (values read last overrides previous values) and make it available
2240
to all gradle build files as a `userConfig` object (instance of `groovy.util.ConfigObject`).
2341
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
4159

4260
3.2 - `org.pongasoft.spec`
4361
-------------------------
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
4563
`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
4767
snapshot mode (meaning version ends with `-SNAPSHOT`) unless `-Prelease=true` is provided when
4868
running the build. See an [example](https://github.com/pongasoft/gradle-plugins/blob/master/project-spec.groovy) of
4969
this file and how it is being used in this project itself!
5070

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
5687
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)).
5889

5990
repositories.gradle
6091
repositories-${project.group}.gradle
@@ -76,59 +107,42 @@ Those files are looked into the following folders:
76107
You can provide your own location by using `-Prepositories.gradle=...` (this will override the
77108
entire list).
78109

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:
83111

84112
buildscript {
85-
allRepositories.buildscript.configure()
113+
externalRepositories.buildscript.configure()
86114
}
87115

88-
allRepositories.build.configure()
116+
externalRepositories.build.configure()
89117

90118

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/)
92120

93121
Check the `repositories.gradle` file that comes with this project for examples.
94122

95123
3.4 - `org.pongasoft.release`
96124
----------------------------
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:
126132

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.
128142

129143
3.5 - `org.pongasoft.cmdline`
130144
----------------------------
131-
`org.pongasoft.cmdline` is a plugin which adds the following tasks:
145+
This plugin adds the following tasks:
132146

133147
* `package-assemble`: Assembles the package (exploded)
134148
* `package`: Create the package
@@ -149,7 +163,7 @@ as executables.
149163
All files under `src/cmdline/resources` are also processed through a replacement token plugin if
150164
you provide replacement tokens.
151165

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)
153167
available in the build file
154168
as `cmdline`:
155169

@@ -172,7 +186,7 @@ the root of the package. To disable this feature use:
172186

173187
3.6 - `org.pongasoft.buildInfo`
174188
-------------------------------
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
176190
generates a file (at the root of the build) when the build completes. The content of this file is
177191
a json representation of the `buildInfo`. Example of content:
178192

@@ -189,15 +203,69 @@ a json representation of the `buildInfo`. Example of content:
189203
"buildDuration": 13996,
190204
"buildDurationString": "13.996 secs",
191205
"buildTasks": [
192-
"publish"
206+
"release"
193207
]
194208
}
195209

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.
225+
226+
publishing.gradle
227+
publishing-${project.group}.gradle
228+
publishing-${project.rootProject.name}.gradle
229+
publishing-${project.name}.gradle
230+
publishing-${project.group}-${project.name}.gradle
231+
publishing-${project.rootProject.name}-${project.group}.gradle
232+
publishing-${project.rootProject.name}-${project.name}.gradle
233+
publishing-${project.rootProject.name}-${project.group}-${project.name}.gradle
234+
235+
Those files are looked into the following folders:
236+
237+
${project.rootProject.projectDir}/${filename} // if different from .
238+
./${filename}
239+
${user.home}/.${project.group}/${filename}
240+
${user.home}/.gradle/${filename}
241+
${user.home}/.${filename}
242+
243+
You can provide your own location by using `-Ppublishing.gradle=...` (this will override the entire list).
244+
245+
3.9 - `org.pongasoft.sonatypePublishing`
246+
----------------------------------------
247+
This plugin adds the `sonatype` extension property (of type `org.pongasoft.gradle.plugins.SonatypePublishingExtension`) to allow
248+
easy configuration when publishing to maven central. For example:
249+
250+
repositories {
251+
maven {
252+
name = "release"
253+
url = sonatype.s01.conditionedOn(releaseType)
254+
credentials {
255+
username = sonatype.username
256+
password = sonatype.password
257+
}
258+
}
259+
}
260+
261+
`sonatype.username` and `sonatype.password` behaves like the `org.pongasoft.signing` plugin in how to populate this
262+
values (user config, project spec, command line or environment variable).
263+
196264
4 - Compilation
197265
===============
198266
In order to compile the code you need
199267

200-
* java 1.7+
268+
* java 1.8+
201269

202270
At the top simply run
203271

@@ -211,8 +279,8 @@ which should compile and run all the tests.
211279
* Contains the code of the plugins
212280

213281
* `org.pongasoft.gradle-plugins`
214-
* Simple wrapper which uses the plugin themselves to recompile them and make them available for
215-
release/publish
282+
* Project that creates the jar file for the plugins (using the `java-gradle-plugin` plugin) so that it can be
283+
released
216284

217285
6 - Build configuration
218286
=======================
@@ -222,6 +290,4 @@ described in the plugin
222290
Example:
223291
~/.userConfig.properties
224292
top.build.dir="/Volumes/Disk2/deployment/${userConfig.project.name}"
225-
top.install.dir="/export/content/${userConfig.project.name}"
226293
top.release.dir="/export/content/repositories/release"
227-
top.publish.dir="/export/content/repositories/publish"

RELEASE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
3.0.0 (2021/04/27)
2+
------------------
3+
* Removed jcenter
4+
* use of `gradle 6.8`
5+
* Major refactoring of the release and repository plugins to use the `publishing` concepts
6+
(old concepts removed in gradle 7.0)
7+
* Renamed all plugins to `org.pongasoft`
8+
* Changed `allRepositories` to `externalRepositories`
9+
* Added plugins `org.pongasoft.externalPublishing`, `org.pongasoft.signing`, `org.pongasoft.sonatypePublishing`
10+
111
2.2.9 (2017/10/08)
212
------------------
313
* use of `Java 8`

0 commit comments

Comments
 (0)