Skip to content

Commit a479685

Browse files
committed
update processor
1 parent 4925bce commit a479685

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

compiler/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
22
id('java')
33
id('maven-publish')
4-
id('com.github.johnrengelman.shadow') version('7.1.2')
4+
id('com.github.johnrengelman.shadow') version('8.1.1')
55
id('signing')
66
}
77

@@ -55,7 +55,7 @@ dependencies {
5555
implementation('io.github.jbock-java:javapoet:1.15')
5656
implementation('io.github.jbock-java:auto-common:1.2.3')
5757
shadow(simple_component)
58-
annotationProcessor('io.github.jbock-java:simple-component-compiler:1.013')
58+
annotationProcessor('io.github.jbock-java:simple-component-compiler:1.014')
5959
testImplementation('io.github.jbock-java:compile-testing:0.19.12')
6060
testImplementation('org.junit.jupiter:junit-jupiter:5.9.1')
6161
testImplementation('org.mockito:mockito-core:4.8.0')

compiler/src/main/java/io/jbock/simple/processor/ContextComponent.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,30 @@
1111
@Component
1212
public interface ContextComponent {
1313

14-
@Component.Factory
15-
interface Factory {
16-
ContextComponent create(
17-
ComponentElement component,
18-
TypeTool tool,
19-
InjectBindingFactory injectBindingFactory,
20-
KeyFactory keyFactory);
14+
@Component.Builder
15+
interface Builder {
16+
Builder componentElement(ComponentElement componentElement);
17+
18+
Builder tool(TypeTool tool);
19+
20+
Builder injectBindingFactory(InjectBindingFactory injectBindingFactory);
21+
22+
Builder keyFactory(KeyFactory keyFactory);
23+
24+
ContextComponent build();
2125
}
2226

2327
static ContextComponent create(
2428
ComponentElement component,
2529
TypeTool tool,
2630
InjectBindingFactory injectBindingFactory,
2731
KeyFactory keyFactory) {
28-
return ContextComponent_Impl.factory().create(
29-
component,
30-
tool,
31-
injectBindingFactory,
32-
keyFactory);
32+
return ContextComponent_Impl.builder()
33+
.componentElement(component)
34+
.tool(tool)
35+
.injectBindingFactory(injectBindingFactory)
36+
.keyFactory(keyFactory)
37+
.build();
3338
}
3439

3540
Generator generator();

0 commit comments

Comments
 (0)