Skip to content

Commit

Permalink
Generate shapes before generating Service
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Jun 28, 2022
1 parent d8c3fb1 commit cf96d14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public final class CodegenDirector<
C extends CodegenContext<S, W, I>,
S> {

private static final Logger LOGGER = Logger.getLogger(DirectedCodegen.class.getName());
private static final Logger LOGGER = Logger.getLogger(CodegenDirector.class.getName());

private Class<I> integrationClass;
private ShapeId service;
Expand Down Expand Up @@ -278,11 +278,13 @@ public void run() {

registerInterceptors(context, integrations);

LOGGER.finest(() -> "Generating service " + serviceShape.getId());
directedCodegen.generateService(new GenerateServiceDirective<>(context, serviceShape));
LOGGER.fine("All setup done. Beginning code generation");

generateShapesInService(context, serviceShape);

LOGGER.finest(() -> "Generating service " + serviceShape.getId());
directedCodegen.generateService(new GenerateServiceDirective<>(context, serviceShape));

CustomizeDirective<C, S> postProcess = new CustomizeDirective<>(context, serviceShape);

LOGGER.finest(() -> "Performing custom codegen for "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ public void sortsShapes() {
runner.run();

assertThat(testDirected.generatedShapes, contains(
ShapeId.from("smithy.example#Foo"),
ShapeId.from("smithy.example#D"),
ShapeId.from("smithy.example#C"),
ShapeId.from("smithy.example#B"),
ShapeId.from("smithy.example#A"),
ShapeId.from("smithy.example#FooOperationOutput"),
ShapeId.from("smithy.example#RecursiveA"),
ShapeId.from("smithy.example#RecursiveB"),
ShapeId.from("smithy.example#FooOperationInput")
ShapeId.from("smithy.example#FooOperationInput"),
ShapeId.from("smithy.example#Foo")
));
}
}

0 comments on commit cf96d14

Please sign in to comment.