Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmuschko/tooling-api-custom-model
Demonstrates the use of a custom model with Gradle's tooling API.
https://github.com/bmuschko/tooling-api-custom-model
Last synced: 7 days ago
JSON representation
Demonstrates the use of a custom model with Gradle's tooling API.
- Host: GitHub
- URL: https://github.com/bmuschko/tooling-api-custom-model
- Owner: bmuschko
- Created: 2014-10-22T14:27:04.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-23T19:44:06.000Z (almost 8 years ago)
- Last Synced: 2023-03-11T10:16:37.585Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 269 KB
- Stars: 15
- Watchers: 1
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Custom model for tooling API
This project demonstrates the use of a custom model for querying project details with the tooling API.
## Project layout
This project consists of three components:
1. A multi-project build that provides the custom model via a plugin. The project defines two subprojects: `model` and `plugin`. `model` represents the custom model representation. `plugin` implements a Gradle plugin that registers the custom model with the tooling API model registry and populates it.
2. The subdirectory `invocation` provides a build script that uses the tooling API to query information from a project.
3. A sample `build.gradle` file in the subdirectory `invocation/sample` that is used to query the information.## Building and publishing the plugin
From the root project you can build and publish the plugin by running the command `./gradlew build publish`. The command will build all subprojects, assemble their artifacts and publish them to a Maven-based repository in the directory `repo`.
## Invoking the tooling API
As the next step we can execute the build that uses the custom model registered by the plugin with the tooling API. Navigate to the subdirectory `invocation` and execute the command `../gradlew run`. Executing the command will run a build for the `build.gradle` file in the directory named `sample` on the root level of the repository.