https://github.com/big-guy/plugin-constraints
https://github.com/big-guy/plugin-constraints
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/big-guy/plugin-constraints
- Owner: big-guy
- Created: 2021-07-28T16:11:24.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-28T16:41:19.000Z (almost 5 years ago)
- Last Synced: 2025-03-14T01:12:41.128Z (over 1 year ago)
- Language: Java
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example plugin with dependency constraints
This template is based on `gradle init`, but adds contraints against other plugins that may be applied.
The plugin build is defined in `build-logic`. In [`build-logic/build.gradle`](build-logic/build.gradle), we define an implementation constraint on the Spotbugs plugin. We reject any 4.6.x version of the plugin.
In [`app/build.gradle`](app/build.gradle), we try to apply the Spotbugs plugin version 4.6.2. You can see the classpath for the `app` project by running `app:buildEnvironment`.
The [build fails](https://scans.gradle.com/s/ccm2622rhlyvk/failure#1) because a plugin cannot be found that passes the constraints.
https://scans.gradle.com/s/ccm2622rhlyvk/build-dependencies?focusedDependency=WzEsMCwxLFsxLDAsWzFdXV0&focusedDependencyView=dependencies_or_failure&toggled=W1sxXSxbMSwwXV0
These constraints won't work with `buildSrc` currently because of the way we resolve dependencies for a `buildSrc` build. The failure message could be made better by focusing more on the build script classpath aspect of the failure. The failure is very similar to failures you would see with just project dependencies.