Skip to content

Conversation

@romain-grecourt
Copy link
Contributor

@romain-grecourt romain-grecourt commented Mar 24, 2021

CLI code generation update.

  • Add a simple AST API to "codegen" that models and renders the generated code in Java.
  • Add a type information abstraction "TypeInfo" that unifies typo information (pseudo, class, processing) under a single type.
  • Unifies type information for pseudo types, existing classes, processing elements
  • Used in the visitor, annotation meta-models and AST objects
  • Add a javac plugin to get the file header (i.e copyright header) of the annotated types, and add it to the generated sources.
  • Plugin must be configured with -XPlugin:file-header for this to work ; it is optional
  • Renamed AnnotationProcessor to CommandAP
  • Add unit tests for AST, TypeInfo and CommandAP

Remove CLIDefinition and replaced it with a @commandlineinterface

Move Config/UserConfig from harness to impl

  • Decoupled Config / UserConfig with a concept of InternalOptions.
  • Internal options duplicates the constants for the config required by the harness
  • Internal options uses a lookup function to fetch the values
  • The CLI main method provides a lookup function to bind
  • Added a Builder to CommandRunner / CommandContext to bootstrap the CLI

Fixed MetadataAccessTestBase to not be order dependent.

  • Reset the user config every time to avoid unexpected config set by a prior test

Restore and fix a few module-infos.
Changed CLI main class from Main to Helidon.

…e in Java.

Add an type information abstraction "TypeInfo" that unifies typo information (pseudo, class, processing) under a single type.
 - Unifies typo information for pseudo types, existing classes, processing elements
 - Used in the visitor, annotation meta-models and ast objects
Add a javac plugin to get the file header (i.e copyright header) of the annotated types, and add it to the generated sources.
 - Plugin must be configured with -XPlugin:file-header for this to work ; it is optional
Renamed AnnotationProcessor to CommandAP
Add unit tests for AST, TypeInfo and CommandAP

Remove CLIDefinition and replace it with a @commandlineinterface

Move Config/UserConfig from harness to impl
 - Decoupled Config / UserConfig with a concept of InternalOptions.
 - Internal options duplicates the constants for the config required by the harness
 - Internal options uses a lookup function to fetch the values
 - The CLI main method provides a lookup function to bind
 - Added a Builder to CommandRunner / CommandContext to bootstrap the CLI

Fixed MetadataAccessTestBase to not be order dependent.
 - Reset the user config every time to avoid unexpected config set by a prior test

Restore and fix a few module-infos.
Changed CLI main class from Main to Helidon.
@romain-grecourt romain-grecourt added this to the 3.0.0 milestone Mar 24, 2021
@romain-grecourt romain-grecourt self-assigned this Mar 24, 2021
@romain-grecourt romain-grecourt requested a review from batsatt March 24, 2021 05:22
@romain-grecourt romain-grecourt merged commit 830cf07 into helidon-io:master Mar 25, 2021
@romain-grecourt romain-grecourt deleted the cli-codegen-update branch March 25, 2021 01:48
romain-grecourt added a commit to romain-grecourt/helidon-build-tools that referenced this pull request Apr 27, 2021
* Add a simple AST API to codegen to model and render the generated code in Java.
Add an type information abstraction "TypeInfo" that unifies typo information (pseudo, class, processing) under a single type.
 - Unifies typo information for pseudo types, existing classes, processing elements
 - Used in the visitor, annotation meta-models and ast objects
Add a javac plugin to get the file header (i.e copyright header) of the annotated types, and add it to the generated sources.
 - Plugin must be configured with -XPlugin:file-header for this to work ; it is optional
Renamed AnnotationProcessor to CommandAP
Add unit tests for AST, TypeInfo and CommandAP

Remove CLIDefinition and replace it with a @commandlineinterface

Move Config/UserConfig from harness to impl
 - Decoupled Config / UserConfig with a concept of InternalOptions.
 - Internal options duplicates the constants for the config required by the harness
 - Internal options uses a lookup function to fetch the values
 - The CLI main method provides a lookup function to bind
 - Added a Builder to CommandRunner / CommandContext to bootstrap the CLI

Fixed MetadataAccessTestBase to not be order dependent.
 - Reset the user config every time to avoid unexpected config set by a prior test

Restore and fix a few module-infos.
Changed CLI main class from Main to Helidon.

* Update visitor, remove the anonymous visitor implementation as that seems to crash javac

* remove visitor singletons

* fix new test on windows

* fix new test on windows

(cherry picked from commit 830cf07)
romain-grecourt added a commit that referenced this pull request Apr 28, 2021
* Add a simple AST API to codegen to model and render the generated code in Java.
Add an type information abstraction "TypeInfo" that unifies typo information (pseudo, class, processing) under a single type.
 - Unifies typo information for pseudo types, existing classes, processing elements
 - Used in the visitor, annotation meta-models and ast objects
Add a javac plugin to get the file header (i.e copyright header) of the annotated types, and add it to the generated sources.
 - Plugin must be configured with -XPlugin:file-header for this to work ; it is optional
Renamed AnnotationProcessor to CommandAP
Add unit tests for AST, TypeInfo and CommandAP

Remove CLIDefinition and replace it with a @commandlineinterface

Move Config/UserConfig from harness to impl
 - Decoupled Config / UserConfig with a concept of InternalOptions.
 - Internal options duplicates the constants for the config required by the harness
 - Internal options uses a lookup function to fetch the values
 - The CLI main method provides a lookup function to bind
 - Added a Builder to CommandRunner / CommandContext to bootstrap the CLI

Fixed MetadataAccessTestBase to not be order dependent.
 - Reset the user config every time to avoid unexpected config set by a prior test

Restore and fix a few module-infos.
Changed CLI main class from Main to Helidon.

* Update visitor, remove the anonymous visitor implementation as that seems to crash javac

* remove visitor singletons

* fix new test on windows

* fix new test on windows

(cherry picked from commit 830cf07)
@romain-grecourt romain-grecourt modified the milestones: 3.0.0, 3.0.0-M2, 2.2.3 Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants