-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# SBM Gradle Project Parser | ||
The project consists of modules: | ||
- **model** - Defines data structures to be pulled from Gradle Build process via Gradle Tooling API. Also contains utility to query Gradle Build process for a specific model type | ||
- **plugin** - Registers the `GradelProject` data model builder and has logic for creating a serializable instance of the `GradleProjectData` | ||
- **parser** - Defines a `GradelProjectParser` which delegates to `DefaultProjectParser` which is very close to Rewrite's `org.openrewrite.gradle.isolated.DefaultProjectParser`which takes `GradleProjectData` obtained from **model** via **plugin** project as a parameter. | ||
|
||
Use the `GradelProjectParser` as follows: | ||
```java | ||
GradleProjectParser.parse(new File("/Users/aboyko/Documents/STS4-arm/spring-petclinic"), new File("/Users/aboyko/Documents/STS4-arm/spring-petclinic/build.gradle"), new InMemoryExecutionContext(), new DefaultParserConfig()).collect(Collectors.toList()); | ||
``` | ||
Parameters: | ||
1. Project root folder | ||
2. Project build script file | ||
3. Rewrite's `ExecutionContext` | ||
4. `ParserConfig` object. (Typically one would use `DefaultParserConfig`) | ||
|
||
Before making references to the project and using it as a library it is required to build it: | ||
```bash | ||
./gradlew clean build publishToMavenLocal | ||
``` | ||
(It is important to publish to maven local such that when **model** project quries gradle process for the model the plugin is present in the local maven repo) |