Skip to content

Commit 7dca745

Browse files
committed
feat(ci): auto-update version in README.md
1 parent 47d89f3 commit 7dca745

File tree

4 files changed

+68
-54
lines changed

4 files changed

+68
-54
lines changed

.editorconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ trim_trailing_whitespace = true
1515
indent_style = space
1616
indent_size = 4
1717
max_line_length = 120
18-
continuation_indent_size = 8
18+
ij_continuation_indent_size = 8
19+
ij_java_class_count_to_use_import_on_demand = 15
20+
ij_java_names_count_to_use_import_on_demand = 15
1921

2022
# XML files (pom.xml, etc.)
2123
[*.xml]
@@ -52,4 +54,4 @@ indent_size = 2
5254
# Git files
5355
[{.gitignore,.gitattributes}]
5456
indent_style = space
55-
indent_size = 2
57+
indent_size = 2

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ jobs:
4040
git config user.name "${{ github.actor }}"
4141
git config user.email "${{ github.actor }}@users.noreply.github.com"
4242
43-
- name: Bump Maven Version
43+
- name: Update Version Files
4444
run: |
4545
./mvnw versions:set -DnewVersion=${{ github.event.inputs.new_version }} -DgenerateBackupPoms=false --batch-mode
4646
./mvnw versions:commit --batch-mode
47-
git add pom.xml */pom.xml
47+
48+
sed -i '/fluent-builder-annotations<\/artifactId>/,/<version>/ s/<version>[^<]*<\/version>/<version>${{ github.event.inputs.new_version }}<\/version>/' README.md
49+
sed -i '/fluent-builder-processor<\/artifactId>/,/<version>/ s/<version>[^<]*<\/version>/<version>${{ github.event.inputs.new_version }}<\/version>/' README.md
50+
51+
git add pom.xml */pom.xml README.md
4852
git diff --staged --quiet || git commit -m "Bump version to ${{ github.event.inputs.new_version }}"
4953
git push origin main
5054

.sdkmanrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable auto-env through the sdkman_auto_env config
2+
# Add key=value pairs of SDKs to use below
3+
java=21.0.8-tem

README.md

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,38 @@ fluent-builder-parent/
2525
### 1. Add dependencies to your project
2626

2727
```xml
28+
2829
<dependencies>
29-
<dependency>
30-
<groupId>stream.header.fluentbuilder</groupId>
31-
<artifactId>fluent-builder-annotations</artifactId>
32-
<version>0.1.0</version>
33-
</dependency>
34-
<dependency>
35-
<groupId>stream.header.fluentbuilder</groupId>
36-
<artifactId>fluent-builder-processor</artifactId>
37-
<version>0.1.0</version>
38-
<scope>provided</scope>
39-
</dependency>
30+
<dependency>
31+
<groupId>stream.header.fluentbuilder</groupId>
32+
<artifactId>fluent-builder-annotations</artifactId>
33+
<version>0.1.2</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>stream.header.fluentbuilder</groupId>
37+
<artifactId>fluent-builder-processor</artifactId>
38+
<version>0.1.2</version>
39+
<scope>provided</scope>
40+
</dependency>
4041
</dependencies>
4142

4243
<build>
43-
<plugins>
44-
<plugin>
45-
<groupId>org.apache.maven.plugins</groupId>
46-
<artifactId>maven-compiler-plugin</artifactId>
47-
<version>3.11.0</version>
48-
<configuration>
49-
<annotationProcessorPaths>
50-
<path>
51-
<groupId>stream.header.fluentbuilder</groupId>
52-
<artifactId>fluent-builder-processor</artifactId>
53-
<version>0.1.0</version>
54-
</path>
55-
</annotationProcessorPaths>
56-
</configuration>
57-
</plugin>
58-
</plugins>
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-compiler-plugin</artifactId>
48+
<version>3.11.0</version>
49+
<configuration>
50+
<annotationProcessorPaths>
51+
<path>
52+
<groupId>stream.header.fluentbuilder</groupId>
53+
<artifactId>fluent-builder-processor</artifactId>
54+
<version>0.1.2</version>
55+
</path>
56+
</annotationProcessorPaths>
57+
</configuration>
58+
</plugin>
59+
</plugins>
5960
</build>
6061
```
6162

@@ -68,13 +69,13 @@ import stream.header.fluentbuilder.FluentBuilder.Ignore;
6869

6970
@FluentBuilder
7071
public record Person(
71-
@Mandatory String firstName,
72-
@Mandatory String lastName,
73-
@Mandatory int age,
74-
String email,
75-
String phoneNumber,
76-
String address,
77-
@Ignore String internalId // Ignored - not part of builder, will be null
72+
@Mandatory String firstName,
73+
@Mandatory String lastName,
74+
@Mandatory int age,
75+
String email,
76+
String phoneNumber,
77+
String address,
78+
@Ignore String internalId // Ignored - not part of builder, will be null
7879
) {
7980
}
8081
```
@@ -84,28 +85,28 @@ public record Person(
8485
```java
8586
// All mandatory fields must be set before build() is available
8687
Person person1 = PersonBuilder.builder()
87-
.firstName("John")
88-
.lastName("Doe")
89-
.age(30)
90-
.email("john.doe@example.com")
91-
.phoneNumber("123-456-7890")
92-
.build();
88+
.firstName("John")
89+
.lastName("Doe")
90+
.age(30)
91+
.email("john.doe@example.com")
92+
.phoneNumber("123-456-7890")
93+
.build();
9394

9495
// Mandatory fields can be set in any order
9596
Person person2 = PersonBuilder.builder()
96-
.lastName("Smith")
97-
.email("jane.smith@example.com") // Optional field can be set anytime
98-
.firstName("Jane")
99-
.address("123 Main St")
100-
.age(25)
101-
.build();
97+
.lastName("Smith")
98+
.email("jane.smith@example.com") // Optional field can be set anytime
99+
.firstName("Jane")
100+
.address("123 Main St")
101+
.age(25)
102+
.build();
102103

103104
// Only mandatory fields
104105
Person person3 = PersonBuilder.builder()
105-
.age(40)
106-
.firstName("Bob")
107-
.lastName("Johnson")
108-
.build();
106+
.age(40)
107+
.firstName("Bob")
108+
.lastName("Johnson")
109+
.build();
109110
```
110111

111112
## How It Works
@@ -122,13 +123,17 @@ This ensures at compile time that you cannot call `build()` until all mandatory
122123
## Annotations
123124

124125
### @FluentBuilder
126+
125127
Place on a record to generate a fluent builder for it.
126128

127129
### @FluentBuilder.Mandatory
130+
128131
Mark record components that must be set before `build()` can be called. These fields enforce compile-time type safety.
129132

130133
### @FluentBuilder.Ignore
134+
131135
Mark record components to exclude them from the builder entirely. Ignored fields will be set to `null` when the record is constructed. Useful for:
136+
132137
- Internal/computed fields
133138
- Fields set by factory methods
134139
- Metadata fields not relevant during construction

0 commit comments

Comments
 (0)