Skip to content

Commit 8f15490

Browse files
authored
[CI] Add Github publishing (#49)
This adds release support to Github. When we create a release `tag` this will publish a new version of the plugin. For now, this does not publish `SNAPSHOT` builds as there's currently lots of work happening here. This does require us to add the correct environment variables to this repo.
1 parent 300fc74 commit 8f15490

File tree

6 files changed

+68
-203
lines changed

6 files changed

+68
-203
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [ published ]
5+
6+
jobs:
7+
JVM-Run-Gradle-Release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/setup-java@v3
11+
with:
12+
java-version: 17
13+
distribution: 'temurin'
14+
15+
- uses: actions/checkout@v3
16+
17+
# Given we are doing a release, lets make sure we have a safe gradle install
18+
- uses: gradle/wrapper-validation-action@v1
19+
20+
- uses: gradle/gradle-build-action@v2
21+
22+
- name: Verify all checks pass
23+
run: ./gradlew check
24+
25+
- name: Publish plugin
26+
run: ./gradlew publishPlugins
27+
env:
28+
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
29+
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

README.md

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# AssertJ Generator Gradle Plugin
22

3-
[![Linux Build Status](https://travis-ci.org/assertj/assertj-generator-gradle-plugin.svg?branch=master)](https://travis-ci.org/assertj/assertj-generator-gradle-plugin)
4-
[![Windows status](https://ci.appveyor.com/api/projects/status/ia2ki6wprow9ysnl/branch/master?svg=true)](https://ci.appveyor.com/project/Nava2/assertj-generator-gradle-plugin/branch/master)
5-
6-
[Gradle Plugin Portal](https://plugins.gradle.org/plugin/org.assertj.generator.gradle.plugin)
3+
![Build Status](https://img.shields.io/github/actions/workflow/status/assertj/assertj-generator-gradle-plugin/ci.yml)
4+
[![Gradle Plugin Portal](https://img.shields.io/gradle-plugin-portal/v/org.assertj.generator)](https://plugins.gradle.org/plugin/org.assertj.generator.gradle.plugin)
75

86
This is the source for the Gradle plugin for the
97
[AssertJ Generator](http://joel-costigliola.github.io/assertj/assertj-assertions-generator.html). This plugin leverages
@@ -17,16 +15,16 @@ the [AssertJ Generator Maven Plugin](http://joel-costigliola.github.io/assertj/a
1715
Below is a minimal configuration that will cause _all_ classes defined in the `main` source set to have an `AssertJ`
1816
assertion generated for it. All of these will be placed into the highest package in use.
1917

20-
This plugin requires Gradle 4.0.
18+
This plugin is built with Gradle 7.6.
2119

22-
```gradle
20+
```groovy
2321
plugins {
2422
id 'org.assertj.generator' version '0.0.6b'
2523
}
2624
2725
sourceSets {
2826
main {
29-
// must specify assertJ block to have it applied
27+
// Configurations are per source-set
3028
assertJ { }
3129
}
3230
}
@@ -60,19 +58,6 @@ The plugin version is tied to the version of
6058
the [AssertJ Generator](http://joel-costigliola.github.io/assertj/assertj-assertions-generator.html).
6159
The version of the generator used will always match the plugin's version.
6260

63-
### Scope: Local vs. Global
64-
65-
This plugin allows the generation configuration to appear in two places:
66-
67-
* "global" `assertJ {}` block -- outside `sourceSets`
68-
* Locally within a `sourceSet` in an `assertJ {}` block (e.g. within `main{}`)
69-
70-
All "locally" defined parameters override those set in the "global" scope.
71-
72-
Each of these provide the same configuration parameters except:
73-
74-
* Globally, files and patterns can not be manipulated -- this must be done at the local scope
75-
7661
### Parameters
7762

7863
The following sections outline the available parameters, linking to the appropriate generator docs when available.
@@ -81,23 +66,22 @@ For any unlisted parameters, please see the
8166
[javadoc for `AssertJGeneratorOptions`](./src/main/groovy/org/assertj/generator/gradle/tasks/AssertJGeneratorOptions.groovy)
8267
and open issues for unclear/missing documentation.
8368

84-
#### P: skip - `boolean`
69+
#### skip - `boolean`
8570

86-
Default: `true`
71+
Default: `false`
8772

8873
The `skip` parameter provides a mechanism for quickly turning on/off `assertJ` generation. Unless overridden in the
8974
global scope, no code will be generated by default. When an `assertJ` block is defined in a local scope, this parameter
9075
is set to `false` for the source set.
9176

9277
##### Example
9378

94-
The following example turns on generation for _only_ `main` All classes found within `main` and `test` will have an
95-
Assertion generated. This is the recommended way to turn on generation for source sets.
79+
The following example turns _off_ generation for `main`. All classes found within `main` will be ignored.
9680

97-
```gradle
81+
```groovy
9882
sourceSets {
9983
main {
100-
assertJ { } // sets skip = false for the "main" sourceSet
84+
assertJ { skip = true } // sets skip = true
10185
}
10286
test { }
10387
}
@@ -106,12 +90,8 @@ sourceSets {
10690
If debugging a build, it may be useful to turn off generation for a `sourceSet`. To do this, inside the configuration
10791
block, set `skip = true`.
10892

109-
```gradle
93+
```groovy
11094
sourceSets {
111-
main {
112-
assertJ { } // sets skip = false for the "main" sourceSet
113-
}
114-
11595
brokenGeneration {
11696
assertJ {
11797
skip = true // no assertions will be generated for
@@ -124,7 +104,7 @@ sourceSets {
124104
}
125105
```
126106

127-
#### P: outputDir - `File`
107+
#### outputDir - `File`
128108

129109
Default: `${buildDir}/generated-srcs/${sourceSet.name}-test/java`
130110

@@ -138,19 +118,19 @@ The following example changes the output directory for _all_ source sets to be
138118
`${buildDir}/src-gen/${sourceSet.testName}/java/`. The same change could be applied to a local
139119
scope.
140120

141-
```gradle
121+
```groovy
142122
sourceSets {
143123
main {
144124
// turn on assertJ generation
145125
assertJ {
146-
// default: generated-srcs/${SOURCE_SET_NAME_TAG}/java
126+
// default: ${buildDir}/generated-srcs/${sourceSet.name}-test/java
147127
outputDir = file("src-gen/main-test/java")
148128
}
149129
}
150130
}
151131
```
152132

153-
#### P: templates - `Templates`
133+
#### templates - `Templates`
154134

155135
Default: Built-in templates
156136

@@ -164,12 +144,12 @@ For more information on template syntax, please see the
164144
[AssertJ Generator Templates Section](http://joel-costigliola.github.io/assertj/assertj-assertions-generator.html#generated-assertions-templates).
165145

166146
The names of templates mirror those from the AssertJ Documentation, but the actual names and nesting are listed
167-
[here](src/main/groovy/org/assertj/generator/gradle/tasks/config/Templates.groovy).
147+
[here](src/main/kotlin/org/assertj/generator/gradle/tasks/config/Templates.kt).
168148

169149
The following example replaces the whole number field with a custom template for only the `main` sourceSet, any others
170150
remain unaffected.
171151

172-
```gradle
152+
```groovy
173153
sourceSets {
174154
main {
175155
assertJ {
@@ -183,9 +163,11 @@ sourceSets {
183163
}
184164
```
185165

186-
The following example changes the template to a `file()` template for the `main` source sets.
166+
The following example changes the template to a `file()` template for the `main` source sets. The `file()` method
167+
accepts any parameter allowed by
168+
[`Project#file(...)`](https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:file(java.lang.Object)).
187169

188-
```gradle
170+
```groovy
189171
sourceSets {
190172
main {
191173
assertJ {
@@ -202,7 +184,7 @@ sourceSets {
202184

203185
We can root all files under a directory by using a file from the scoped `project`:
204186

205-
```gradle
187+
```groovy
206188
sourceSets {
207189
main {
208190
assertJ {
@@ -219,9 +201,9 @@ sourceSets {
219201
}
220202
```
221203

222-
#### P: entryPoints - `EntryPointsGeneratorOptions`
204+
#### entryPoints - `EntryPointsGeneratorOptions`
223205

224-
Default: Only generate "standard" assertions
206+
Default: Only generate "standard" assertion entrypoint
225207

226208
Entry points are classes that provide mechanisms to get access to all of the generated AssertJ types.
227209
The [AssertJ Generator - Entry Points](http://joel-costigliola.github.io/assertj/assertj-assertions-generator.html#generated-entry-points)
@@ -238,7 +220,7 @@ value to entry point:
238220
By default, only the `standard` style is turned on. To adjust this, simply set the values to `true` within the
239221
`entryPoints` closure.
240222

241-
```gradle
223+
```groovy
242224
sourceSets {
243225
main {
244226
assertJ {
@@ -254,7 +236,7 @@ sourceSets {
254236

255237
A useful trick to turn on _only_ a set of values is to just set the `entryPoints` to a collection of types:
256238

257-
```gradle
239+
```groovy
258240
sourceSets {
259241
main {
260242
assertJ {
@@ -266,7 +248,7 @@ sourceSets {
266248

267249
Or within the `entryPoints` closure:
268250

269-
```gradle
251+
```groovy
270252
sourceSets {
271253
main {
272254
assertJ {

Vagrantfile

Lines changed: 0 additions & 95 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)