Skip to content

Commit 04c5e3e

Browse files
authored
v5.0.0 API changes and features (#776)
V5.0.0 changes. This includes an overhaul of the project to target Java 17 as a minimum version, which will allow support of AssertJ V4.0 once it is released, and allow the potential for ECJ support to be provided. --------- Signed-off-by: Ashley <[email protected]>
1 parent b2da84a commit 04c5e3e

File tree

60 files changed

+429
-445
lines changed

Some content is hidden

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

60 files changed

+429
-445
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ on:
1111
workflow_dispatch: {}
1212

1313
jobs:
14+
validate:
15+
name: Validation steps
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Run ShellCheck
22+
uses: ludeeus/action-shellcheck@master
23+
with:
24+
check_together: 'yes'
25+
scandir: './scripts'
26+
27+
- name: Validate codecov.yml
28+
shell: bash
29+
run: curl -vvv --fail --data-binary @- https://codecov.io/validate < codecov.yml
30+
1431
build:
1532
name: Build on JDK ${{ matrix.java-version }} (${{ matrix.os-name }})
1633
runs-on: ${{ matrix.os-name }}
@@ -20,7 +37,6 @@ jobs:
2037
matrix:
2138
os-name: [ubuntu-latest]
2239
java-version:
23-
- 11 # LTS
2440
- 17 # LTS
2541
- 21 # LTS
2642
- GA # General access
@@ -29,6 +45,7 @@ jobs:
2945
java-version: GA
3046
- os-name: macos-latest
3147
java-version: GA
48+
3249
steps:
3350
- name: Checkout repository
3451
uses: actions/checkout@v4

.github/workflows/codeql.yml

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

.github/workflows/deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
uses: actions/setup-java@v4
3636
with:
3737
distribution: zulu
38-
# Must use >= JDK 17 for Javadocs to generate correctly
3938
java-version: 23
4039
server-id: ossrh
4140
server-username: OSSRH_USERNAME

.github/workflows/security.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- v5
67

78
jobs:
89
submit-dependency-snapshot:

.github/workflows/validate.yml

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

CONTRIBUTING.md

Lines changed: 35 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,34 @@
11
# Contribution guidelines and info
22

3-
Hi! Thanks for taking an interest in this project!
4-
If you would like to contribute, then help is always
5-
welcome however big or small!
3+
Hi! Thanks for taking an interest in this project! If you would like to contribute, then help is
4+
always welcome however big or small!
65

76
## Finding something to contribute
87

9-
If you are new and would like to pick something up,
10-
check the issues tab to see if anything is of interest.
11-
If you want further clarification, feel free to drop a
12-
comment.
8+
If you are new and would like to pick something up, check the issues tab to see if anything is of
9+
interest. If you want further clarification, feel free to drop a comment.
1310

1411
> [!TIP]
1512
> You could alternatively add a message on the discussions
1613
> tab!
1714
18-
Contributions do not necessarily need to be code changes
19-
either. You can also contribute by:
15+
Contributions do not necessarily need to be code changes either. You can also contribute by:
2016

21-
- Testing this project out for yourself and discussing any
22-
feedback on the discussions page.
17+
- Testing this project out for yourself and discussing any feedback on the discussions page.
2318
- Fixing and improving documentation.
2419
- Contributing new Wiki pages.
2520
- Raising bugs in the issue tab.
2621

27-
## Raising issues
28-
29-
If raising an issue, please make sure that you include
30-
some details such as:
31-
32-
- The problem in a short description.
33-
- What do you expect to happen?
34-
- What actually happens?
35-
- How did you reproduce this (if applicable)?
36-
- What JDK you are using
37-
- What OS you are using
38-
39-
If these are not relevant to you, then they can be
40-
ignored.
41-
4222
## Getting help
4323

44-
Please make a discussion in the discussions tab rather
45-
than opening a new issue if you need help with using this library.
24+
Please make a discussion in the discussions tab rather than opening a new issue if you need help
25+
with using this library.
4626

4727
## Contributing changes to fix issues
4828

49-
If you are contributing to an issue, drop a message on
50-
that issue so that I can assign it to you! **If you would be
51-
able to keep me up to date with any progress on that issue,
52-
that would be fantastic**, since it enables me to track
53-
how much work is left to do and to be able to provide any
29+
If you are contributing to an issue, drop a message on that issue so that I can assign it to you!
30+
**If you would be able to keep me up to date with any progress on that issue, that would be
31+
fantastic**, since it enables me to track how much work is left to do and to be able to provide any
5432
help if needed.
5533

5634
Everyone is entitled to their own life, but if I haven't heard anything back for a while,
@@ -62,22 +40,18 @@ but never actually finished.
6240

6341
## Branching
6442

65-
When you are ready, make a fork of this repo. When you
66-
work on your fork, make sure you create a new branch to
67-
work off of rather than committing to your master/main
68-
branch. This will make it easier for you to update your
69-
copy with any new changes to this project, and avoid
70-
filling pull requests with lots of messy merge commits
71-
unnecessarily!
43+
When you are ready, make a fork of this repo. When you work on your fork, make sure you create
44+
a new branch to work off of rather than committing to your master/main branch. This will make it
45+
easier for you to update your copy with any new changes to this project, and avoid filling pull
46+
requests with lots of messy merge commits unnecessarily!
7247

7348
## Building this project
7449

7550
> [!IMPORTANT]
7651
> This project uses Apache Maven as the build system, and
77-
> requires JDK 11 or newer.
52+
> requires JDK 17 or newer.
7853
79-
To build this project and run the tests, you can run the
80-
following in your terminal:
54+
To build this project and run the tests, you can run the following in your terminal:
8155

8256
```bash
8357
# Linux, Mac OS, Git Bash users
@@ -87,45 +61,38 @@ following in your terminal:
8761
.\mvnw.cmd clean package verify
8862
```
8963

90-
If you use Windows, you should download the JDK from
91-
somewhere such as https://adoptium.net/en-GB/temurin/.
64+
If you use Windows, you should download the JDK from somewhere such as
65+
https://adoptium.net/en-GB/temurin/.
9266

93-
On Linux and MacOS, I tend to use a tool called
94-
[SDKMan](https://sdkman.io/) to download and install
95-
Java tooling. I personally use Amazon Corretto 17, but
96-
you can use any JDK implementation you like, such as
97-
Temurin, Graal, Liberica, SAP, etc. All should work
67+
On Linux and macOS, I tend to use a tool called [SDKMan](https://sdkman.io/)
68+
to download and install Java tooling. I personally use Amazon Corretto, but you can use any JDK
69+
implementation you like, such as Temurin, Graal, Liberica, SAP, etc. All should work
9870
the same for the most part.
9971

10072
## Licensing
10173

102-
All changes that you make will be applied under the
103-
Apache license, as documented in this repository.
104-
You can find out more about what this means at
105-
[TLDRLegal](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))!
74+
All changes that you make will be applied under the Apache license, as documented in this
75+
repository. You can find out more about what this means at [TLDRLegal](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0))!
10676

107-
Each file that you create must have a special header
108-
comment at the top that mentions this license.
77+
Each file that you create must have a special header comment at the top that mentions this license.
10978

11079
> [!TIP]
11180
> If you need to add this header to your files, you can run
11281
> `./mvnw license:format` to do it for you automatically!
11382
11483
## Code style
11584

116-
This project uses a modified version of the Google
117-
Code Style guide for Java. The main things to remember
118-
are:
85+
This project uses a modified version of the Google Code Style guide for Java. The main things to
86+
remember are:
11987

12088
- 2-space indentation rather than tabs
12189
- Public classes and methods need a JavaDoc
12290
- Line length is limited to 100 lines
12391

12492
Good things to remember:
12593

126-
- Keep lines of code simple. It is fine to use multiple
127-
lines of code to declare something if it makes it easier
128-
to read.
94+
- Keep lines of code simple. It is fine to use multiple lines of code to declare something if it
95+
- makes it easier to read.
12996
- Keep naming clear and simple!
13097

13198
A tool called CheckStyle will attempt to enforce these rules
@@ -136,10 +103,9 @@ for you.
136103
137104
## Commits
138105

139-
Please try to keep commits atomic and clear. Each commit
140-
should ideally leave the project in a working state. Each
141-
commit should also have a clear title and explaination as
142-
to what the commit changes, and why.
106+
Please try to keep commits atomic and clear. Each commit should ideally leave the project in a
107+
working state. Each commit should also have a clear title and explanation as to what the commit
108+
changes, and why.
143109

144110
## Deployment process
145111

@@ -153,6 +119,6 @@ Changelogs are automatically generated from the pull request history between the
153119
`main` branch and the last tag that was added. This is why it is important to have descriptive
154120
pull requests where appropriate.
155121

156-
Upon successfully deploying to Maven Central, a release will be added to the
157-
[releases](../../releases) page on the repository. A changelog will automatically get
158-
attached and any contributors will be `@mentioned` in those changelogs.
122+
Upon successfully deploying to Maven Central, a release will be added to the [releases](../../releases)
123+
page on the repository. A changelog will automatically get attached and any contributors will be
124+
`@mentioned` in those changelogs.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Java 11+](https://img.shields.io/badge/Java-11--24-brown?logo=openjdk&logoColor=white)
1+
![Java 17+](https://img.shields.io/badge/Java-17%2B-brown?logo=openjdk&logoColor=white)
22
[![Build Status](https://github.com/ascopes/java-compiler-testing/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/ascopes/java-compiler-testing/actions/workflows/build.yml)
33
[![Maven Central](https://img.shields.io/maven-central/v/io.github.ascopes.jct/java-compiler-testing)](https://repo1.maven.org/maven2/io/github/ascopes/jct/java-compiler-testing)
44
[![Code Coverage](https://codecov.io/gh/ascopes/java-compiler-testing/branch/main/graph/badge.svg?token=VT74BP2742)](https://codecov.io/gh/ascopes/java-compiler-testing)
@@ -331,9 +331,7 @@ holding the flags you wish to use.
331331
`-XX:+TieredCompilation -XX:TieredStopAtLevel=1` to set this up. Enabling this in the JCT
332332
builds reduced the overall build time by around 20 seconds.
333333
2. Use the ZGC - the ZGC will reduce lag when performing garbage collection on code that
334-
has a high churn of objects. On Java 11, the ZGC is an experimental feature, which needs
335-
to be enabled with `-XX:+UnlockExperimentalOptions -XX:+UseZGC`. On Java 17, you just
336-
need to pass `-XX:+UseZGC` alone.
334+
has a high churn of objects. You just need to pass `-XX:+UseZGC` alone.
337335

338336
## Third-party compiler support
339337

java-compiler-testing/src/it/checkerframework/pom.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,4 @@
9898
</plugin>
9999
</plugins>
100100
</build>
101-
102-
<profiles>
103-
<profile>
104-
<id>${project.artifactId}-incompatible-jdk</id>
105-
<activation>
106-
<!-- No idea why JDK 16 doesn't work specifically. -->
107-
<jdk>16</jdk>
108-
</activation>
109-
<properties>
110-
<maven.test.skip>true</maven.test.skip>
111-
</properties>
112-
</profile>
113-
</profiles>
114101
</project>

java-compiler-testing/src/it/dogfood/src/test/java/io/github/ascopes/jct/acceptancetests/dogfood/JctDogfoodTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class JctDogfoodTest {
5252
.resolve("classes");
5353

5454
@DisplayName("JCT can compile itself as a legacy module source")
55-
@JavacCompilerTest(minVersion = 11, configurers = JctCompilationConfigurer.class)
55+
@JavacCompilerTest(minVersion = 17, configurers = JctCompilationConfigurer.class)
5656
void jctCanCompileItselfAsLegacyModule(JctCompiler compiler) throws IOException {
5757
// Given
5858
try (var workspace = Workspaces.newWorkspace()) {

java-compiler-testing/src/it/google-auto-value/src/test/java/io/github/ascopes/jct/acceptancetests/autovalue/AutoValueTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ void autoValueImplementationClassIsCreatedAsExpected(JctCompiler compiler) throw
7272
}
7373

7474
private Object callMethod(Object obj, String method, Object... args) throws Throwable {
75-
var cls = obj instanceof Class<?>
76-
? (Class<?>) obj
75+
var cls = obj instanceof Class<?> castCls
76+
? castCls
7777
: obj.getClass();
7878

7979
// Enforce reflective access to be allowed.

java-compiler-testing/src/it/google-error-prone/pom.xml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,4 @@
8989
</plugin>
9090
</plugins>
9191
</build>
92-
93-
<profiles>
94-
<profile>
95-
<!-- https://github.com/google/error-prone/issues/3710 -->
96-
<id>${project.artifactId}-incompatible-jdk</id>
97-
<activation>
98-
<jdk>[,12)</jdk>
99-
</activation>
100-
<properties>
101-
<maven.test.skip>true</maven.test.skip>
102-
</properties>
103-
</profile>
104-
</profiles>
10592
</project>

0 commit comments

Comments
 (0)