Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Aug 14, 2023
1 parent a1b9f44 commit f8df6bb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sbm-gradle-tooling-model/README.md
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)

0 comments on commit f8df6bb

Please sign in to comment.