diff --git a/build.gradle b/build.gradle index dab97c05..2b57014d 100644 --- a/build.gradle +++ b/build.gradle @@ -25,8 +25,8 @@ version gitVersion() allprojects { repositories { - gradlePluginPortal() mavenCentral() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } } + gradlePluginPortal() { metadataSources { mavenPom(); ignoreGradleMetadataRedirection() } } } group 'com.palantir.gradle.jdks' diff --git a/changelog/@unreleased/pr-19.v2.yml b/changelog/@unreleased/pr-19.v2.yml new file mode 100644 index 00000000..43dea333 --- /dev/null +++ b/changelog/@unreleased/pr-19.v2.yml @@ -0,0 +1,5 @@ +type: fix +fix: + description: Allow lazy configuration of JDKs + links: + - https://github.com/palantir/gradle-jdks/pull/19 diff --git a/gradle-jdks/build.gradle b/gradle-jdks/build.gradle index 5673b62a..c00afe5a 100644 --- a/gradle-jdks/build.gradle +++ b/gradle-jdks/build.gradle @@ -13,6 +13,8 @@ dependencies { testImplementation 'com.netflix.nebula:nebula-test' testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.assertj:assertj-core' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.mockito:mockito-junit-jupiter' } gradlePlugin { diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java index 21fee864..7fe9fc90 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/GradleJdksJavaInstallationMetadata.java @@ -16,11 +16,20 @@ package com.palantir.gradle.jdks; +import org.gradle.api.file.Directory; +import org.gradle.api.provider.Provider; import org.gradle.jvm.toolchain.JavaInstallationMetadata; import org.immutables.value.Value; @Value.Immutable abstract class GradleJdksJavaInstallationMetadata implements JavaInstallationMetadata { + protected abstract Provider installationPathProvider(); + + @Override + public Directory getInstallationPath() { + return installationPathProvider().get(); + } + public static final class Builder extends ImmutableGradleJdksJavaInstallationMetadata.Builder {} public static Builder builder() { diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java index 5675a77e..2dd5ce79 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloader.java @@ -23,18 +23,14 @@ final class JdkDownloader { - private final Project rootProject; + private final Project project; private final String jdkGroup; - JdkDownloader(Project rootProject, JdkDistributionName jdkDistributionName, String jdkBaseUrl) { - this.rootProject = rootProject; + JdkDownloader(Project project, JdkDistributionName jdkDistributionName, String jdkBaseUrl) { + this.project = project; this.jdkGroup = jdkDistributionName.uiName() + "-jdk"; - if (rootProject != rootProject.getRootProject()) { - throw new IllegalArgumentException("Must pass in the root project"); - } - - rootProject.getRepositories().ivy(ivy -> { + project.getRepositories().ivy(ivy -> { ivy.setName(jdkGroup); ivy.setUrl(jdkBaseUrl); ivy.patternLayout(patternLayout -> patternLayout.artifact("[module].[ext]")); @@ -43,20 +39,11 @@ final class JdkDownloader { repositoryContentDescriptor.includeGroup(jdkGroup); }); }); - - rootProject - .getRepositories() - .matching(repo -> !repo.getName().equals(jdkGroup)) - .configureEach(artifactRepository -> { - artifactRepository.content(content -> content.excludeGroup(jdkGroup)); - }); } public Path downloadJdkPath(JdkPath jdKPath) { - Configuration configuration = rootProject - .getConfigurations() - .detachedConfiguration(rootProject - .getDependencies() + Configuration configuration = project.getConfigurations() + .detachedConfiguration(project.getDependencies() .create(String.format("%s:%s:@%s", jdkGroup, jdKPath.filename(), jdKPath.extension()))); return configuration.resolve().iterator().next().toPath(); } diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java index 61e1bcca..23ffcbd9 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkDownloaders.java @@ -19,33 +19,36 @@ import java.util.HashMap; import java.util.Map; import org.gradle.api.Project; +import org.immutables.value.Value; final class JdkDownloaders { - private final Map jdkDownloaders = new HashMap<>(); + private final Map jdkDownloaders = new HashMap<>(); - private final Project rootProject; private final JdksExtension jdksExtension; - JdkDownloaders(Project rootProject, JdksExtension jdksExtension) { - if (rootProject != rootProject.getRootProject()) { - throw new IllegalArgumentException("Must pass in the root project"); - } - - this.rootProject = rootProject; + JdkDownloaders(JdksExtension jdksExtension) { this.jdksExtension = jdksExtension; } - public JdkDownloader jdkDownloaderFor(JdkDistributionName jdkDistributionName) { + public JdkDownloader jdkDownloaderFor(Project project, JdkDistributionName jdkDistributionName) { return jdkDownloaders.computeIfAbsent( - jdkDistributionName, + ImmutableJdkDownloadersCacheKey.builder() + .project(project) + .jdkDistributionName(jdkDistributionName) + .build(), _ignored -> new JdkDownloader( - rootProject, + project, jdkDistributionName, jdksExtension - .getJdkDistributions() - .getting(jdkDistributionName) - .get() + .jdkDistributionFor(jdkDistributionName) .getBaseUrl() .get())); } + + @Value.Immutable + interface JdkDownloadersCacheKey { + Project project(); + + JdkDistributionName jdkDistributionName(); + } } diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java index ca663602..d2d0fb22 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdkManager.java @@ -35,23 +35,17 @@ import org.gradle.process.ExecResult; public final class JdkManager { - private final Project project; private final Provider storageLocation; private final JdkDistributions jdkDistributions; private final JdkDownloaders jdkDownloaders; - JdkManager( - Project project, - Provider storageLocation, - JdkDistributions jdkDistributions, - JdkDownloaders jdkDownloaders) { - this.project = project; + JdkManager(Provider storageLocation, JdkDistributions jdkDistributions, JdkDownloaders jdkDownloaders) { this.storageLocation = storageLocation; this.jdkDistributions = jdkDistributions; this.jdkDownloaders = jdkDownloaders; } - public Path jdk(JdkSpec jdkSpec) { + public Path jdk(Project project, JdkSpec jdkSpec) { Path diskPath = storageLocation .get() .getAsFile() @@ -65,21 +59,22 @@ public Path jdk(JdkSpec jdkSpec) { } JdkPath jdkPath = jdkDistributions.get(jdkSpec.distributionName()).path(jdkSpec.release()); - Path jdkArchive = - jdkDownloaders.jdkDownloaderFor(jdkSpec.distributionName()).downloadJdkPath(jdkPath); + Path jdkArchive = jdkDownloaders + .jdkDownloaderFor(project, jdkSpec.distributionName()) + .downloadJdkPath(jdkPath); Path temporaryJdkPath = Paths.get( diskPath + ".in-progress-" + UUID.randomUUID().toString().substring(0, 8)); try { project.copy(copy -> { - copy.from(unpackTree(jdkPath.extension(), jdkArchive)); + copy.from(unpackTree(project, jdkPath.extension(), jdkArchive)); copy.into(temporaryJdkPath); }); Path javaHome = findJavaHome(temporaryJdkPath); jdkSpec.caCerts().caCerts().forEach((name, caCertFile) -> { - addCaCert(javaHome, name, caCertFile); + addCaCert(project, javaHome, name, caCertFile); }); try { @@ -99,7 +94,7 @@ public Path jdk(JdkSpec jdkSpec) { } } - private FileTree unpackTree(Extension extension, Path path) { + private FileTree unpackTree(Project project, Extension extension, Path path) { switch (extension) { case ZIP: return project.zipTree(path.toFile()); @@ -128,7 +123,7 @@ private Path findJavaHome(Path temporaryJdkPath) { } } - private void addCaCert(Path javaHome, String alias, String caCert) { + private void addCaCert(Project project, Path javaHome, String alias, String caCert) { ByteArrayOutputStream output = new ByteArrayOutputStream(); ExecResult keytoolResult = project.exec(exec -> { diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java index 5a314da1..ce48f854 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksExtension.java @@ -18,40 +18,38 @@ import groovy.lang.Closure; import groovy.lang.DelegatesTo; +import java.util.Optional; import javax.inject.Inject; import org.gradle.api.Action; +import org.gradle.api.Project; import org.gradle.api.file.DirectoryProperty; import org.gradle.api.model.ObjectFactory; import org.gradle.api.provider.MapProperty; -import org.gradle.api.provider.ProviderFactory; import org.gradle.jvm.toolchain.JavaLanguageVersion; public abstract class JdksExtension { - protected abstract MapProperty getJdkDistributions(); + private final LazilyConfiguredMapping jdkDistributions; + private final LazilyConfiguredMapping jdks; - protected abstract MapProperty getJdks(); + public JdksExtension() { + this.jdkDistributions = + new LazilyConfiguredMapping<>(() -> getObjectFactory().newInstance(JdkDistributionExtension.class)); + this.jdks = new LazilyConfiguredMapping<>(() -> getObjectFactory().newInstance(JdkExtension.class)); + } public abstract MapProperty getCaCerts(); public abstract DirectoryProperty getJdkStorageLocation(); - @Inject - protected abstract ProviderFactory getProviderFactory(); - @Inject protected abstract ObjectFactory getObjectFactory(); + public final void jdks(LazyJdks lazyJdks) { + jdks.put(lazyJdks::configureJdkFor); + } + public final void jdk(JavaLanguageVersion javaLanguageVersion, Action action) { - JdkExtension jdkExtension = getJdks() - .getting(javaLanguageVersion) - .orElse(getProviderFactory().provider(() -> { - JdkExtension newJdkExtension = getObjectFactory().newInstance(JdkExtension.class); - getJdks().put(javaLanguageVersion, newJdkExtension); - return newJdkExtension; - })) - .get(); - - action.execute(jdkExtension); + jdks.put(javaLanguageVersion, action); } @SuppressWarnings("RawTypes") @@ -59,9 +57,14 @@ public final void jdk(int javaLanguageVersion, @DelegatesTo(JdkExtension.class) jdk(JavaLanguageVersion.of(javaLanguageVersion), ConfigureUtil.toAction(closure)); } + public final void jdkDistributions(LazyJdkDistributions lazyJdkDistributions) { + jdkDistributions.put((jdkDistributionName, _ignored) -> + lazyJdkDistributions.configureJdkDistributionFor(jdkDistributionName)); + } + public final void jdkDistribution( JdkDistributionName jdkDistributionName, Action action) { - action.execute(getJdkDistributions().getting(jdkDistributionName).get()); + jdkDistributions.put(jdkDistributionName, action); } @SuppressWarnings("RawTypes") @@ -69,4 +72,23 @@ public final void jdkDistribution( String distributionName, @DelegatesTo(JdkDistributionExtension.class) Closure closure) { jdkDistribution(JdkDistributionName.fromStringThrowing(distributionName), ConfigureUtil.toAction(closure)); } + + public final JdkDistributionExtension jdkDistributionFor(JdkDistributionName jdkDistributionName) { + return jdkDistributions + .get(jdkDistributionName, null) + .orElseThrow(() -> new RuntimeException( + String.format("No configuration for JdkDistribution " + jdkDistributionName))); + } + + public final Optional jdkFor(JavaLanguageVersion javaLanguageVersion, Project project) { + return jdks.get(javaLanguageVersion, project); + } + + public interface LazyJdkDistributions { + Optional> configureJdkDistributionFor(JdkDistributionName jdkDistributionName); + } + + public interface LazyJdks { + Optional> configureJdkFor(JavaLanguageVersion javaLanguageVersion, Project project); + } } diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java index 05994254..f232c72d 100644 --- a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/JdksPlugin.java @@ -16,16 +16,12 @@ package com.palantir.gradle.jdks; -import com.palantir.baseline.extensions.BaselineJavaVersionsExtension; -import com.palantir.baseline.plugins.BaselineJavaVersions; +import com.palantir.baseline.plugins.javaversions.BaselineJavaVersions; +import com.palantir.baseline.plugins.javaversions.BaselineJavaVersionsExtension; import java.io.File; -import java.nio.file.Path; import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; import org.gradle.api.Plugin; import org.gradle.api.Project; -import org.gradle.jvm.toolchain.JavaInstallationMetadata; import org.gradle.jvm.toolchain.JavaLanguageVersion; public final class JdksPlugin implements Plugin { @@ -40,28 +36,17 @@ public void apply(Project rootProject) { JdksExtension jdksExtension = extension(rootProject, jdkDistributions); JdkManager jdkManager = new JdkManager( - rootProject.getProject(), - jdksExtension.getJdkStorageLocation(), - jdkDistributions, - new JdkDownloaders(rootProject, jdksExtension)); + jdksExtension.getJdkStorageLocation(), jdkDistributions, new JdkDownloaders(jdksExtension)); rootProject.getPluginManager().apply(BaselineJavaVersions.class); rootProject .getExtensions() .getByType(BaselineJavaVersionsExtension.class) - .getJdks() - .putAll(rootProject.provider(() -> { - Map ret = new HashMap<>(); - jdksExtension.getJdks().get().forEach((javaLanguageVersion, jdkExtension) -> { - ret.put( - javaLanguageVersion, - javaInstallationForLanguageVersion( - rootProject, jdksExtension, jdkExtension, jdkManager, javaLanguageVersion)); - }); - - return ret; - })); + .jdks((javaLanguageVersion, project) -> jdksExtension + .jdkFor(javaLanguageVersion, project) + .map(jdkExtension -> javaInstallationForLanguageVersion( + project, jdksExtension, jdkExtension, jdkManager, javaLanguageVersion))); } private JdksExtension extension(Project rootProject, JdkDistributions jdkDistributions) { @@ -75,21 +60,18 @@ private JdksExtension extension(Project rootProject, JdkDistributions jdkDistrib () -> new File(System.getProperty("user.home"), ".gradle/caches/gradle-jdks")))); Arrays.stream(JdkDistributionName.values()).forEach(jdkDistributionName -> { - JdkDistributionExtension jdkDistributionExtension = - rootProject.getObjects().newInstance(JdkDistributionExtension.class); - - jdkDistributionExtension - .getBaseUrl() - .set(jdkDistributions.get(jdkDistributionName).defaultBaseUrl()); - - jdksExtension.getJdkDistributions().put(jdkDistributionName, jdkDistributionExtension); + jdksExtension.jdkDistribution(jdkDistributionName, jdkDistributionExtension -> { + jdkDistributionExtension + .getBaseUrl() + .set(jdkDistributions.get(jdkDistributionName).defaultBaseUrl()); + }); }); return jdksExtension; } private GradleJdksJavaInstallationMetadata javaInstallationForLanguageVersion( - Project rootProject, + Project project, JdksExtension jdksExtension, JdkExtension jdkExtension, JdkManager jdkManager, @@ -99,17 +81,19 @@ private GradleJdksJavaInstallationMetadata javaInstallationForLanguageVersion( JdkDistributionName jdkDistributionName = jdkExtension.getDistributionName().get(); - Path jdk = jdkManager.jdk(JdkSpec.builder() - .distributionName(jdkDistributionName) - .release(JdkRelease.builder().version(version).build()) - .caCerts(CaCerts.from(jdksExtension.getCaCerts().get())) - .build()); - return GradleJdksJavaInstallationMetadata.builder() - .installationPath(rootProject - .getLayout() - .dir(rootProject.provider(jdk::toFile)) - .get()) + .installationPathProvider(project.getLayout().dir(project.provider(() -> jdkManager + .jdk( + project, + JdkSpec.builder() + .distributionName(jdkDistributionName) + .release(JdkRelease.builder() + .version(version) + .build()) + .caCerts(CaCerts.from( + jdksExtension.getCaCerts().get())) + .build()) + .toFile()))) .javaRuntimeVersion(version) .languageVersion(javaLanguageVersion) .jvmVersion(version) diff --git a/gradle-jdks/src/main/java/com/palantir/gradle/jdks/LazilyConfiguredMapping.java b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/LazilyConfiguredMapping.java new file mode 100644 index 00000000..5cfeeb45 --- /dev/null +++ b/gradle-jdks/src/main/java/com/palantir/gradle/jdks/LazilyConfiguredMapping.java @@ -0,0 +1,89 @@ +/* + * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.gradle.jdks; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Supplier; +import org.gradle.api.Action; + +final class LazilyConfiguredMapping { + private final Supplier valueFactory; + private final List> values = new ArrayList<>(); + private final Map> computedValues = new HashMap<>(); + private boolean finalized = false; + + LazilyConfiguredMapping(Supplier valueFactory) { + this.valueFactory = valueFactory; + } + + public void put(LazyValues lazyValues) { + ensureNotFinalized(); + + values.add(lazyValues); + } + + public void put(K key, Action value) { + ensureNotFinalized(); + + put((requestedKey, _ignored) -> { + if (requestedKey.equals(key)) { + return Optional.of(value); + } + + return Optional.empty(); + }); + } + + private void ensureNotFinalized() { + if (finalized) { + throw new IllegalStateException(String.format( + "This %s has already been finalized as get() hase been called. " + + "No further elements can be added to it", + LazilyConfiguredMapping.class.getSimpleName())); + } + } + + public Optional get(K key, A additionalData) { + finalized = true; + + return computedValues.computeIfAbsent(key, _ignored -> { + V value = valueFactory.get(); + AtomicBoolean created = new AtomicBoolean(false); + values.forEach(lazyValues -> { + lazyValues.compute(key, additionalData).ifPresent(action -> { + created.set(true); + action.execute(value); + }); + }); + + if (created.get()) { + return Optional.of(value); + } + + return Optional.empty(); + }); + } + + public interface LazyValues { + Optional> compute(K key, A additionalData); + } +} diff --git a/gradle-jdks/src/test/java/com/palantir/gradle/jdks/LazilyConfiguredMappingTest.java b/gradle-jdks/src/test/java/com/palantir/gradle/jdks/LazilyConfiguredMappingTest.java new file mode 100644 index 00000000..fb655292 --- /dev/null +++ b/gradle-jdks/src/test/java/com/palantir/gradle/jdks/LazilyConfiguredMappingTest.java @@ -0,0 +1,106 @@ +/* + * (c) Copyright 2022 Palantir Technologies Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.palantir.gradle.jdks; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + +import java.util.Optional; +import org.junit.jupiter.api.Test; + +class LazilyConfiguredMappingTest { + private final LazilyConfiguredMapping lazilyConfiguredMapping = + new LazilyConfiguredMapping<>(() -> new Extension(0)); + + @Test + void empty_mapping_returns_optional_empty() { + assertThat(lazilyConfiguredMapping.get("abc", 'a')).isEmpty(); + } + + @Test + void can_put_a_value_and_get_it_out_again() { + lazilyConfiguredMapping.put("foo", extension -> extension.number = 4); + + assertThat(lazilyConfiguredMapping.get("foo", 'a')).hasValue(new Extension(4)); + } + + @Test + void can_put_a_lazy_value_in_and_get_it_out_again() { + lazilyConfiguredMapping.put((key, additionalData) -> { + assertThat(additionalData).isEqualTo('b'); + return Optional.of(extension -> extension.number = Integer.parseInt(key)); + }); + + assertThat(lazilyConfiguredMapping.get("3", 'b')).hasValue(new Extension(3)); + assertThat(lazilyConfiguredMapping.get("9", 'b')).hasValue(new Extension(9)); + } + + @Test + void lazy_values_are_able_to_not_return_values() { + lazilyConfiguredMapping.put((_key, _additionalData) -> Optional.empty()); + + assertThat(lazilyConfiguredMapping.get("abc", 'a')).isEmpty(); + } + + @Test + void interspersing_putting_values_takes_the_last_set_value() { + lazilyConfiguredMapping.put("1", extension -> extension.number = 80); + lazilyConfiguredMapping.put( + (key, _ignored) -> Optional.of(extension -> extension.number = Integer.parseInt(key))); + lazilyConfiguredMapping.put("4", extension -> extension.number = 99); + + assertThat(lazilyConfiguredMapping.get("1", 'c')).hasValue(new Extension(1)); + assertThat(lazilyConfiguredMapping.get("3", 'c')).hasValue(new Extension(3)); + assertThat(lazilyConfiguredMapping.get("4", 'c')).hasValue(new Extension(99)); + } + + @Test + void throws_if_putting_values_after_being_finalized() { + lazilyConfiguredMapping.get("abc", 'c'); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { + lazilyConfiguredMapping.put("foo", _extension -> {}); + }); + + assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> { + lazilyConfiguredMapping.put((_key, _additionalData) -> Optional.of(_extension -> {})); + }); + } + + private static final class Extension { + public int number; + + Extension(int number) { + this.number = number; + } + + @Override + public boolean equals(Object obj) { + return number == ((Extension) obj).number; + } + + @Override + public int hashCode() { + return number; + } + + @Override + public String toString() { + return Integer.toString(number); + } + } +} diff --git a/versions.lock b/versions.lock index 6f377451..c52dc459 100644 --- a/versions.lock +++ b/versions.lock @@ -7,11 +7,10 @@ com.diffplug.durian:durian-core:1.2.0 (5 constraints: df4b51b4) com.diffplug.durian:durian-io:1.2.0 (2 constraints: cc1e3a85) com.diffplug.durian:durian-swt.os:3.5.0 (1 constraints: bf0b0dea) com.diffplug.gradle:goomph:3.35.0 (1 constraints: f4111707) -com.diffplug.spotless:spotless-lib:2.25.1 (3 constraints: da30c3b3) -com.diffplug.spotless:spotless-lib-extra:2.25.1 (1 constraints: 4a132141) -com.diffplug.spotless:spotless-plugin-gradle:6.5.1 (1 constraints: c5111ef5) -com.fasterxml.jackson:jackson-bom:2.13.2 (1 constraints: ff13bf65) -com.fasterxml.jackson.core:jackson-annotations:2.13.2 (2 constraints: f1138182) +com.diffplug.spotless:spotless-lib:2.25.3 (3 constraints: de3033b4) +com.diffplug.spotless:spotless-lib-extra:2.25.3 (1 constraints: 4c132341) +com.diffplug.spotless:spotless-plugin-gradle:6.6.0 (1 constraints: c51120f5) +com.fasterxml.jackson.core:jackson-annotations:2.13.2 (1 constraints: 3a053a3b) com.github.ben-manes.caffeine:caffeine:3.0.5 (1 constraints: c11104f5) com.google.code.findbugs:jsr305:3.0.2 (2 constraints: 1d0fb186) com.google.errorprone:error_prone_annotations:2.11.0 (3 constraints: a31fc64f) @@ -22,8 +21,8 @@ com.google.j2objc:j2objc-annotations:1.3 (1 constraints: b809eda0) com.googlecode.concurrent-trees:concurrent-trees:2.6.1 (1 constraints: 761166da) com.googlecode.java-diff-utils:diffutils:1.3.0 (1 constraints: bd11fef4) com.googlecode.javaewah:JavaEWAH:1.1.12 (1 constraints: 750eee5e) -com.palantir.baseline:gradle-baseline-java:4.119.0 (1 constraints: 7105c340) -com.palantir.baseline:gradle-junit-reports:4.119.0 (1 constraints: 28124519) +com.palantir.baseline:gradle-baseline-java:4.133.0 (1 constraints: 6d05b940) +com.palantir.baseline:gradle-junit-reports:4.133.0 (1 constraints: 24123b19) com.palantir.javaformat:gradle-palantir-java-format:1.1.0 (1 constraints: bb11f8f4) com.palantir.javaformat:palantir-java-format-spi:1.1.0 (2 constraints: 2b273bdb) com.squareup.okhttp3:okhttp:4.3.1 (1 constraints: bf0b0dea) @@ -53,7 +52,7 @@ org.eclipse.platform:org.eclipse.osgi:3.15.0 (2 constraints: c724e4f0) org.eclipse.platform:org.eclipse.osgi.compatibility.state:1.1.600 (1 constraints: 1f0c1a02) org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f) org.immutables:value:2.8.8 (1 constraints: 14051536) -org.jetbrains:annotations:19.0.0 (2 constraints: 441cf8cc) +org.jetbrains:annotations:13.0 (1 constraints: df0e795c) org.jetbrains.kotlin:kotlin-stdlib:1.3.61 (2 constraints: 0617a55e) org.jetbrains.kotlin:kotlin-stdlib-common:1.3.61 (2 constraints: c5196a0d) org.osgi:org.osgi.dto:1.0.0 (1 constraints: b40ca816) @@ -65,25 +64,26 @@ org.osgi:org.osgi.util.function:1.2.0 (2 constraints: f2193329) org.osgi:org.osgi.util.promise:1.2.0 (1 constraints: b60cae16) org.osgi:org.osgi.util.tracker:1.5.4 (1 constraints: bd0cbb16) org.osgi:osgi.annotation:8.0.1 (3 constraints: 1e2894a6) -org.ow2.asm:asm:9.3 (3 constraints: 7332e84a) +org.ow2.asm:asm:9.3 (2 constraints: 9d25affb) org.slf4j:slf4j-api:1.7.30 (2 constraints: 6c1b52af) [Test dependencies] -cglib:cglib-nodep:3.3.0 (2 constraints: 7a1acf3c) +cglib:cglib-nodep:3.2.2 (1 constraints: 490ded24) com.netflix.nebula:nebula-test:10.1.0 (1 constraints: 34052a3b) -net.bytebuddy:byte-buddy:1.10.16 (1 constraints: 950dfa39) -org.assertj:assertj-core:3.22.0 (2 constraints: 65174647) +net.bytebuddy:byte-buddy:1.12.9 (1 constraints: 470b41de) +net.bytebuddy:byte-buddy-agent:1.12.9 (1 constraints: 470b41de) +org.apiguardian:apiguardian-api:1.1.2 (5 constraints: 105480ac) +org.assertj:assertj-core:3.22.0 (1 constraints: 39053f3b) org.hamcrest:hamcrest:2.2 (1 constraints: d20cdc04) -org.junit:junit-bom:5.8.2 (10 constraints: c7a1fdc6) -org.junit.jupiter:junit-jupiter:5.8.2 (2 constraints: 260e7a59) -org.junit.jupiter:junit-jupiter-api:5.8.2 (4 constraints: 8b385c34) -org.junit.jupiter:junit-jupiter-engine:5.8.2 (2 constraints: 2117d23c) -org.junit.jupiter:junit-jupiter-params:5.8.2 (2 constraints: 2117d23c) -org.junit.platform:junit-platform-commons:1.8.2 (3 constraints: ee29ed2b) -org.junit.platform:junit-platform-engine:1.8.2 (3 constraints: 062cdf16) -org.junit.platform:junit-platform-launcher:1.8.2 (2 constraints: 121b944a) -org.junit.platform:junit-platform-testkit:1.8.2 (1 constraints: 12097995) -org.objenesis:objenesis:3.1 (2 constraints: bb193de0) -org.opentest4j:opentest4j:1.2.0 (3 constraints: c53224a1) +org.junit.jupiter:junit-jupiter:5.8.2 (1 constraints: 11051e36) +org.junit.jupiter:junit-jupiter-api:5.8.2 (4 constraints: 3f3ecd02) +org.junit.jupiter:junit-jupiter-engine:5.8.2 (1 constraints: 0c0edf3b) +org.junit.jupiter:junit-jupiter-params:5.8.2 (1 constraints: 0c0edf3b) +org.junit.platform:junit-platform-commons:1.8.2 (2 constraints: dd200b4b) +org.junit.platform:junit-platform-engine:1.8.2 (2 constraints: de1da64c) +org.mockito:mockito-core:4.5.1 (2 constraints: d0137a65) +org.mockito:mockito-junit-jupiter:4.5.1 (1 constraints: 0c050f36) +org.objenesis:objenesis:3.2 (2 constraints: 9a17f457) +org.opentest4j:opentest4j:1.2.0 (2 constraints: cd205b49) org.spockframework:spock-core:2.0-M4-groovy-3.0 (2 constraints: e822d65a) org.spockframework:spock-junit4:2.0-M4-groovy-3.0 (1 constraints: 25115ddf) diff --git a/versions.props b/versions.props index 4b77da2f..03433ddd 100644 --- a/versions.props +++ b/versions.props @@ -4,9 +4,10 @@ com.fasterxml.jackson.core:* = 2.13.2 com.netflix.nebula:nebula-test = 10.1.0 org.junit.jupiter:* = 5.8.2 org.assertj:assertj-core = 3.22.0 +org.mockito:* = 4.5.1 # dependency-upgrader:OFF -com.palantir.baseline:* = 4.119.0 +com.palantir.baseline:* = 4.133.0 # dependency-upgrader:ON # conflict resolution