Skip to content

build: update locking to lock test classpaths by default too #4

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,42 @@

### Purpose

This plugin configures various aspects of dependency management. Where values are configurable, a default is specified.
Certain values are configurable via `dependencySettings` extension inside each project build.gradle.kts, but most are
This plugin configures various aspects of dependency management. Where values are configurable, a
default is specified.
Certain values are configurable via `dependencySettings` extension inside each project
build.gradle.kts, but most are
configured only once in a `dependencySettings` extension in settings.gradle.kts.

- Adds a version catalog (default name: `commonLibs`, default
artifact: `org.hypertrace.bom:hypertrace-version-catalog:<catalogVersion>`. catalogVersion must be set explicitly)
artifact: `org.hypertrace.bom:hypertrace-version-catalog:<catalogVersion>`. catalogVersion must be
set explicitly)
- Renames the default `libs` catalog (from `libs.versions.toml`) to `localLibs` to disambiguate
- For each java project:
- Adds dependency repositories of mavenLocal, mavenCentral, confluent and hypertrace
- If `autoApplyBom` is specified (default: true), adds a BOM dependency to the `api` configuration (falling back
- If `autoApplyBom` is specified (default: true), adds a BOM dependency to the `api`
configuration (falling back
to `implementation` if `api` is unavailable). The BOM reference to use (`bomArtifactName` -
default `hypertrace.bom`) and version can also be configured. `bomVersionName` (defaults to `hypertrace.bom`)
describes the name of the version property in the catalog and `bomVersion` (defaults to latest - `+`) describes the value to assign.
- If `useDependencyLocking` is specified (default: true), configures strict dependency locking on certain
configurations (default: `annotationProcessor`, `compileClasspath`, `runtimeClasspath`)
- If `useDependencyLocking` is specified (default: true), adds a project task `resolveAndLockAll`which can be use in
default `hypertrace.bom`) and version can also be configured. `bomVersionName` (defaults
to `hypertrace.bom`)
describes the name of the version property in the catalog and `bomVersion` (defaults to
latest - `+`) describes the value to assign.
- If `useDependencyLocking` is specified (default: true), configures strict dependency locking
on certain
configurations (
default: `annotationProcessor`, `compileClasspath`, `runtimeClasspath`, `testCompileClasspath`, `testRuntimeClasspath`)
- If `useDependencyLocking` is specified (default: true), adds a project
task `resolveAndLockAll`which can be use in
conjunction with the `--write-locks` flag to update all project lockfiles.

Example usage in `settings.gradle.kts`:

```kts
plugins {
id("org.hypertrace.dependency-settings") version "0.1.0"
}
id("org.hypertrace.dependency-settings") version "0.1.0"
}


configure<DependencyPluginSettingExtension> {
catalogVersion.set("0.1.0")
}
configure<DependencyPluginSettingExtension> {
catalogVersion.set("0.1.0")
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ public class DependencyPluginProjectExtension {
List.of(
JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME,
JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME,
JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME,
JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME,
JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME);
public final ListProperty<String> configurationsToLock;

public final Property<Boolean> autoApplyBom;
Expand Down