|
1 | 1 | /* |
2 | | - * Copyright 2016-2024 DiffPlug |
| 2 | + * Copyright 2016-2025 DiffPlug |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
26 | 26 | import org.gradle.api.artifacts.Configuration; |
27 | 27 | import org.gradle.api.artifacts.ConfigurationContainer; |
28 | 28 | import org.gradle.api.artifacts.dsl.DependencyHandler; |
29 | | -import org.gradle.api.attributes.Attribute; |
30 | 29 | import org.gradle.api.attributes.Bundling; |
31 | 30 | import org.gradle.api.attributes.Category; |
| 31 | +import org.gradle.api.attributes.java.TargetJvmEnvironment; |
32 | 32 | import org.gradle.api.initialization.dsl.ScriptHandler; |
33 | 33 | import org.slf4j.Logger; |
34 | 34 | import org.slf4j.LoggerFactory; |
@@ -125,9 +125,8 @@ private static Provisioner forConfigurationContainer(Project project, Configurat |
125 | 125 | config.attributes(attr -> { |
126 | 126 | attr.attribute(Category.CATEGORY_ATTRIBUTE, project.getObjects().named(Category.class, Category.LIBRARY)); |
127 | 127 | attr.attribute(Bundling.BUNDLING_ATTRIBUTE, project.getObjects().named(Bundling.class, Bundling.EXTERNAL)); |
128 | | - // TODO: This is a copy-paste from org.gradle.api.attributes.java.TargetJvmEnvironment which is added in Gradle 7.0, remove this once we drop support for Gradle 6.x. |
129 | 128 | // Add this attribute for resolving Guava dependency, see https://github.com/google/guava/issues/6801. |
130 | | - attr.attribute(Attribute.of("org.gradle.jvm.environment", String.class), "standard-jvm"); |
| 129 | + attr.attribute(TargetJvmEnvironment.TARGET_JVM_ENVIRONMENT_ATTRIBUTE, project.getObjects().named(TargetJvmEnvironment.class, TargetJvmEnvironment.STANDARD_JVM)); |
131 | 130 | }); |
132 | 131 | return config.resolve(); |
133 | 132 | } catch (Exception e) { |
|
0 commit comments