Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit a5ddb12

Browse files
authored
Merge pull request #1014 from square/squarejesse-patch-1
Deprecate JavaPoet
2 parents e7429cb + cdb1f2d commit a5ddb12

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@ with metadata files (e.g., database schemas, protocol formats). By generating co
88
the need to write boilerplate while also keeping a single source of truth for the metadata.
99

1010

11+
Deprecated
12+
----------
13+
14+
As of 2020-10-10, Square's JavaPoet project is deprecated. We're proud of our work but we haven't
15+
kept up on maintaining it.
16+
17+
If you'd like an alternative that supports the latest Java language features, one option is
18+
[Palantir's JavaPoet](https://github.com/palantir/javapoet).
19+
20+
To switch to that project, you'll need new Maven coordinates:
21+
22+
```diff
23+
- javapoet = { module = "com.squareup:javapoet", version = "1.13.0" }
24+
+ javapoet = { module = "com.palantir.javapoet:javapoet", version = "0.5.0" }
25+
```
26+
27+
And new imports:
28+
29+
```
30+
sed -i "" \
31+
's/com.squareup.javapoet.\([A-Za-z]*\)/com.palantir.javapoet.\1/g' \
32+
`find . -name "*.kt" -or -name "*.java"`
33+
```
34+
35+
And you might need to track some API changes where fields became functions:
36+
37+
```
38+
- javaFile.packageName
39+
+ javaFile.packageName()
40+
```
41+
1142
### Example
1243

1344
Here's a (boring) `HelloWorld` class:

0 commit comments

Comments
 (0)