Skip to content

Commit e742375

Browse files
build: update locking to lock test classpaths by default too (#4)
1 parent 5801af1 commit e742375

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,42 @@
44

55
### Purpose
66

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

1113
- Adds a version catalog (default name: `commonLibs`, default
12-
artifact: `org.hypertrace.bom:hypertrace-version-catalog:<catalogVersion>`. catalogVersion must be set explicitly)
14+
artifact: `org.hypertrace.bom:hypertrace-version-catalog:<catalogVersion>`. catalogVersion must be
15+
set explicitly)
1316
- Renames the default `libs` catalog (from `libs.versions.toml`) to `localLibs` to disambiguate
1417
- For each java project:
1518
- Adds dependency repositories of mavenLocal, mavenCentral, confluent and hypertrace
16-
- If `autoApplyBom` is specified (default: true), adds a BOM dependency to the `api` configuration (falling back
19+
- If `autoApplyBom` is specified (default: true), adds a BOM dependency to the `api`
20+
configuration (falling back
1721
to `implementation` if `api` is unavailable). The BOM reference to use (`bomArtifactName` -
18-
default `hypertrace.bom`) and version can also be configured. `bomVersionName` (defaults to `hypertrace.bom`)
19-
describes the name of the version property in the catalog and `bomVersion` (defaults to latest - `+`) describes the value to assign.
20-
- If `useDependencyLocking` is specified (default: true), configures strict dependency locking on certain
21-
configurations (default: `annotationProcessor`, `compileClasspath`, `runtimeClasspath`)
22-
- If `useDependencyLocking` is specified (default: true), adds a project task `resolveAndLockAll`which can be use in
22+
default `hypertrace.bom`) and version can also be configured. `bomVersionName` (defaults
23+
to `hypertrace.bom`)
24+
describes the name of the version property in the catalog and `bomVersion` (defaults to
25+
latest - `+`) describes the value to assign.
26+
- If `useDependencyLocking` is specified (default: true), configures strict dependency locking
27+
on certain
28+
configurations (
29+
default: `annotationProcessor`, `compileClasspath`, `runtimeClasspath`, `testCompileClasspath`, `testRuntimeClasspath`)
30+
- If `useDependencyLocking` is specified (default: true), adds a project
31+
task `resolveAndLockAll`which can be use in
2332
conjunction with the `--write-locks` flag to update all project lockfiles.
2433

2534
Example usage in `settings.gradle.kts`:
35+
2636
```kts
2737
plugins {
28-
id("org.hypertrace.dependency-settings") version "0.1.0"
29-
}
38+
id("org.hypertrace.dependency-settings") version "0.1.0"
39+
}
3040

3141

32-
configure<DependencyPluginSettingExtension> {
33-
catalogVersion.set("0.1.0")
34-
}
42+
configure<DependencyPluginSettingExtension> {
43+
catalogVersion.set("0.1.0")
44+
}
3545
```

src/main/java/org/hypertrace/gradle/dependency/DependencyPluginProjectExtension.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ public class DependencyPluginProjectExtension {
1414
List.of(
1515
JavaPlugin.ANNOTATION_PROCESSOR_CONFIGURATION_NAME,
1616
JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME,
17-
JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME);
17+
JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME,
18+
JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME,
19+
JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME);
1820
public final ListProperty<String> configurationsToLock;
1921

2022
public final Property<Boolean> autoApplyBom;

0 commit comments

Comments
 (0)