Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit f5d6365

Browse files
committed
[Gradle Release Plugin] - pre tag commit: '1.0.10'.
1 parent 0833e7d commit f5d6365

File tree

54 files changed

+717
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+717
-757
lines changed

.circleci/config.yml

Lines changed: 88 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,62 @@ version: 2.1
33
executors:
44
jdk:
55
docker:
6-
- image: circleci/openjdk:11-jdk
6+
- image: circleci/openjdk:13-jdk-buster
77
jdk8:
88
docker:
99
- image: circleci/openjdk:8-jdk
1010

1111
jobs:
12-
build_test:
12+
build_test_jdk:
1313
executor: jdk
1414
working_directory: ~/repo
1515
environment:
16-
JAVA_TOOL_OPTIONS: -Xmx512m
16+
JAVA_TOOL_OPTIONS: -Xmx3G
17+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
1718
steps:
1819
- checkout
1920
- restore_cache:
2021
keys:
2122
- v1-dependencies-{{ checksum "build.gradle" }}
2223
- v1-dependencies-
23-
- run: gradle dependencies
24+
- run: ./gradlew dependencies
2425
- save_cache:
2526
paths:
2627
- ~/.gradle
2728
key: v1-dependencies-{{ checksum "build.gradle" }}
2829
- run:
29-
command: ./gradlew --no-daemon --max-workers 2 check
30+
name: Run unit tests
31+
command: ./gradlew check -Dtest.profile=unit
32+
- run:
33+
name: Run integration tests
34+
command: ./gradlew check -Dtest.profile=integration
35+
no_output_timeout: 20m
36+
- store_test_results:
37+
path: plugin/build/tests/test
38+
39+
build_test_jdk8:
40+
executor: jdk8
41+
working_directory: ~/repo
42+
environment:
43+
JAVA_TOOL_OPTIONS: -Xmx3G
44+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
45+
steps:
46+
- checkout
47+
- restore_cache:
48+
keys:
49+
- v1-dependencies-{{ checksum "build.gradle" }}
50+
- v1-dependencies-
51+
- run: ./gradlew dependencies
52+
- save_cache:
53+
paths:
54+
- ~/.gradle
55+
key: v1-dependencies-{{ checksum "build.gradle" }}
56+
- run:
57+
name: Run unit tests
58+
command: ./gradlew check -Dtest.profile=unit
59+
- run:
60+
name: Run integration tests
61+
command: ./gradlew check -Dtest.profile=integration
3062
no_output_timeout: 20m
3163
- store_test_results:
3264
path: plugin/build/tests/test
@@ -35,14 +67,15 @@ jobs:
3567
executor: jdk8
3668
working_directory: ~/repo
3769
environment:
38-
JAVA_TOOL_OPTIONS: -Xmx3200m
70+
JAVA_TOOL_OPTIONS: -Xmx3G
71+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
3972
steps:
4073
- checkout
4174
- restore_cache:
4275
keys:
4376
- v1-dependencies-{{ checksum "build.gradle" }}
4477
- v1-dependencies-
45-
- run: gradle dependencies
78+
- run: ./gradlew dependencies
4679
- save_cache:
4780
paths:
4881
- ~/.gradle
@@ -51,104 +84,124 @@ jobs:
5184
command: |
5285
older_gradle_versions=(3.5.1 4.10.3)
5386
for gradle_version in ${older_gradle_versions[@]} ; do
54-
./gradlew --no-daemon --max-workers 2 clean check -Dtest.gradleVersion=${gradle_version}
87+
./gradlew clean check -Dtest.gradleVersion=${gradle_version}
5588
done
5689
no_output_timeout: 20m
5790

5891
test_sample:
5992
executor: jdk
6093
working_directory: ~/repo
6194
environment:
62-
JAVA_TOOL_OPTIONS: -Xmx512m
95+
JAVA_TOOL_OPTIONS: -Xmx3G
96+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
6397
steps:
6498
- checkout
6599
- restore_cache:
66100
keys:
67101
- v1-dependencies-{{ checksum "build.gradle" }}
68102
- v1-dependencies-
69-
- run: ./gradlew --no-daemon dependenices
103+
- run: ./gradlew dependencies
70104
- save_cache:
71105
paths:
72106
- ~/.gradle
73107
key: v1-dependencies-{{ checksum "build.gradle" }}
74108
- run:
75109
command: |
76-
./gradlew --no-daemon install -x test
77-
./gradlew --no-daemon -b sample/groovy-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
78-
./gradlew --no-daemon -b sample/groovy-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
79-
./gradlew --no-daemon -b sample/java-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
80-
./gradlew --no-daemon -b sample/java-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
81-
./gradlew --no-daemon -b sample/kotlin-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
82-
./gradlew --no-daemon -b sample/kotlin-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
83-
./gradlew --no-daemon -b sample/scala-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
84-
./gradlew --no-daemon -b sample/scala-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
110+
./gradlew publishToMavenLocal -x test
111+
./gradlew -b sample/groovy-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
112+
./gradlew -b sample/groovy-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
113+
./gradlew -b sample/java-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
114+
./gradlew -b sample/java-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
115+
./gradlew -b sample/kotlin-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
116+
./gradlew -b sample/kotlin-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
117+
./gradlew -b sample/scala-spring-boot-jaxrs/build.gradle clean generateSwaggerDocumentation
118+
./gradlew -b sample/scala-spring-boot-mvc/build.gradle clean generateSwaggerDocumentation
85119
86120
release:
87-
executor: jdk
121+
executor: jdk8
88122
working_directory: ~/repo
89123
environment:
90-
JAVA_TOOL_OPTIONS: -Xmx512m
124+
JAVA_TOOL_OPTIONS: -Xmx3G
125+
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.workers.max=2 -Dkotlin.compiler.execution.strategy=in-process
91126
steps:
92127
- checkout
93128
- restore_cache:
94129
keys:
95130
- v1-dependencies-{{ checksum "build.gradle" }}
96131
- v1-dependencies-
97-
- run: gradle dependencies
132+
- run: ./gradlew dependencies
133+
- add_ssh_keys:
134+
fingerprints:
135+
- '05:aa:42:b1:4d:4a:9f:bf:71:10:c2:2a:f3:cf:31:9c'
136+
- run:
137+
name: Set Git globals
138+
command: |
139+
git config --global user.email "[email protected]"
140+
git config --global user.name "Circle CI"
141+
- run: ./gradlew release -Prelease.useAutomaticVersion=true -Pbintray_apiKey=${BINTRAY_APIKEY} -Pbintray_user=${BINTRAY_USER} -Pgradle.publish.key=${GRADLE_PUBLISH_KEY} -Pgradle.publish.secret=${GRADLE_PUBLISH_SECRET}
98142
- save_cache:
99143
paths:
100144
- ~/.gradle
101145
key: v1-dependencies-{{ checksum "build.gradle" }}
102-
- run: ./gradlew --no-daemon release -Prelease.useAutomaticVersion=true
103146

104147
workflows:
105148
version: 2
106149
build:
107150
jobs:
108-
- build_test:
151+
- build_test_jdk:
152+
filters:
153+
branches:
154+
ignore:
155+
- master
156+
- build_test_jdk8:
109157
filters:
110158
branches:
111159
ignore:
112160
- master
113161
- test_gradle:
114-
requires:
115-
- build_test
116162
filters:
117163
branches:
118164
ignore:
119165
- master
120166
- test_sample:
121167
requires:
168+
- build_test_jdk
169+
- build_test_jdk8
122170
- test_gradle
123171
filters:
124172
branches:
125173
ignore:
126174
- master
127175
build_release:
128176
jobs:
129-
- build_test:
177+
- build_test_jdk:
130178
filters:
131179
branches:
132180
only:
133181
- master
134-
- test_gradle:
135-
requires:
136-
- build_test
182+
- build_test_jdk8:
137183
filters:
138184
branches:
139185
only:
140186
- master
141-
- test_sample:
142-
requires:
143-
- test_gradle
187+
- test_gradle:
144188
filters:
145189
branches:
146190
only:
147191
- master
148-
- release:
192+
- test_sample:
149193
requires:
150-
- test_sample
194+
- build_test_jdk
195+
- build_test_jdk8
196+
- test_gradle
151197
filters:
152198
branches:
153199
only:
154200
- master
201+
# - release:
202+
# requires:
203+
# - test_sample
204+
# filters:
205+
# branches:
206+
# only:
207+
# - master

CONTRIBUTING

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Always write a clear log message for your commits. One-line messages are fine fo
1212

1313
```
1414
$ git commit -m "A brief summary of the commit
15-
>
15+
>
1616
> A paragraph describing what changed and its impact."
1717
```
1818

@@ -26,15 +26,15 @@ $ git commit -m "A brief summary of the commit
2626
## To run integration tests
2727
This plugin uses the [gradle testkit](https://docs.gradle.org/current/userguide/test_kit.html), so requires the testClasses task to be run before hand to get the classes into the test plugin classpath.
2828
```bash
29-
./gradlew testClasses
29+
./gradlew :plugin:testClasses
3030
```
3131

3232
N.B. for reliable test runs in an IDE, it's best to include this as a Gradle build step as part of the test run configuration.
3333

3434
## To run tests against different versions of Gradle
3535
This plugin will by default run the tests against Gradle 4.7. To change which version it runs tests against, `test.gradleVersion` system property is required.
3636
```bash
37-
./gradlew clean test -Dtest.gradleVersion=4.0
37+
./gradlew clean :plugin:test -Dtest.gradleVersion=4.0
3838
```
3939

4040
## To release
@@ -43,6 +43,6 @@ This plugin uses the [gradle-release](https://github.com/researchgate/gradle-rel
4343
In `~/.gradle/gradle.properties`, `bintray_user` and `bintray_apiKey` need to be set for publishing to Bintray and `gradle.publish.key` and `gradle.publish.secret` for publishing to the central Gradle repository.
4444

4545
```bash
46-
./gradlew release -Prelease.useAutomaticVersion=true
46+
./gradlew :plugin:release -Prelease.useAutomaticVersion=true
4747
```
4848

build.gradle

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
plugins {
22
id 'java'
3-
id 'maven'
43
id 'idea'
54
id 'net.researchgate.release' version '2.8.1'
6-
id 'com.github.ben-manes.versions' version '0.25.0'
7-
id 'com.dorongold.task-tree' version '1.4'
5+
id 'com.github.ben-manes.versions' version '0.29.0'
6+
id 'com.dorongold.task-tree' version '1.5'
87
}
98

109
allprojects {
@@ -31,13 +30,12 @@ allprojects {
3130
ext {
3231
jacksonVersion = '2.10.0'
3332
springVersion = '5.2.0.RELEASE'
34-
kotlinVersion = '1.3.50'
33+
kotlinVersion = '1.3.72'
3534
swaggerVersion = '1.5.23'
3635
javaxVersion = '2.1.1'
3736
}
37+
}
3838

39-
test {
40-
maxHeapSize '512m'
41-
jvmArgs '-Xmx512m'
42-
}
39+
release {
40+
preCommitText = '[skip ci]'
4341
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=1.0.9
1+
version=1.0.11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

java-tests/src/main/java/com/benjaminsproule/swagger/gradleplugin/test/java/jaxrs/TestResourceWithClassAnnotation.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.benjaminsproule.swagger.gradleplugin.test.java.jaxrs;
22

33
import com.benjaminsproule.swagger.gradleplugin.test.model.*;
4+
import com.fasterxml.jackson.annotation.JsonView;
45
import io.swagger.annotations.*;
56

67
import javax.ws.rs.*;
@@ -167,4 +168,27 @@ public String createdRequest() {
167168
public OuterJsonSubType innerJsonSubType() {
168169
return new OuterJsonSubType();
169170
}
171+
172+
@ApiOperation("With JsonViewOne specification")
173+
@Path("/root/withoutannotation/withjsonview1")
174+
@GET
175+
@JsonView(TestJsonViewOne.class)
176+
public TestJsonViewEntity withJsonViewOne() {
177+
return null;
178+
}
179+
180+
@ApiOperation("With JsonViewTwo specification")
181+
@Path("/root/withoutannotation/withjsonview2")
182+
@GET
183+
@JsonView(TestJsonViewTwo.class)
184+
public TestJsonViewEntity withJsonViewTwo() {
185+
return null;
186+
}
187+
188+
@ApiOperation("Entity definition has to contain all possible fields")
189+
@Path("/root/withoutannotation/withoutjsonview")
190+
@GET
191+
public TestJsonViewEntity withoutJsonView() {
192+
return null;
193+
}
170194
}

java-tests/src/main/java/com/benjaminsproule/swagger/gradleplugin/test/java/jaxrs/TestResourceWithoutClassAnnotation.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.benjaminsproule.swagger.gradleplugin.test.java.jaxrs;
22

33
import com.benjaminsproule.swagger.gradleplugin.test.model.*;
4+
import com.fasterxml.jackson.annotation.JsonView;
45
import io.swagger.annotations.*;
56

67
import javax.ws.rs.*;
@@ -166,4 +167,27 @@ public String createdRequest() {
166167
public OuterJsonSubType innerJsonSubType() {
167168
return new OuterJsonSubType();
168169
}
170+
171+
@ApiOperation("With JsonViewOne specification")
172+
@Path("/root/withoutannotation/withjsonview1")
173+
@GET
174+
@JsonView(TestJsonViewOne.class)
175+
public TestJsonViewEntity withJsonViewOne() {
176+
return null;
177+
}
178+
179+
@ApiOperation("With JsonViewTwo specification")
180+
@Path("/root/withoutannotation/withjsonview2")
181+
@GET
182+
@JsonView(TestJsonViewTwo.class)
183+
public TestJsonViewEntity withJsonViewTwo() {
184+
return null;
185+
}
186+
187+
@ApiOperation("Entity definition has to contain all possible fields")
188+
@Path("/root/withoutannotation/withoutjsonview")
189+
@GET
190+
public TestJsonViewEntity withoutJsonView() {
191+
return null;
192+
}
169193
}

0 commit comments

Comments
 (0)