Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade Gradle Tooling API to 8.9 #7583

Merged
merged 1 commit into from
Jul 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -84,7 +82,7 @@ public final class GradleDistributionManager {

private static final String DOWNLOAD_URI = "https://services.gradle.org/distributions/gradle-%s-%s.zip"; //NOI18N
private static final Pattern DIST_VERSION_PATTERN = Pattern.compile(".*(gradle-(\\d+\\.\\d+.*))-(bin|all)\\.zip"); //NOI18N
private static final Set<String> VERSION_BLACKLIST = new HashSet<>(Arrays.asList("2.3", "2.13")); //NOI18N
private static final Set<String> VERSION_BLACKLIST = Set.of("2.3", "2.13"); //NOI18N
private static final Map<File, GradleDistributionManager> CACHE = new WeakHashMap<>();
private static final GradleVersion MINIMUM_SUPPORTED_VERSION = GradleVersion.version("3.0"); //NOI18N
private static final GradleVersion[] JDK_COMPAT = new GradleVersion[]{
Expand All @@ -101,9 +99,10 @@ public final class GradleDistributionManager {
GradleVersion.version("7.6"), // JDK-19
GradleVersion.version("8.3"), // JDK-20
GradleVersion.version("8.5"), // JDK-21
GradleVersion.version("8.8"), // JDK-22
};

private static final GradleVersion LAST_KNOWN_GRADLE = GradleVersion.version("8.7"); //NOI18N
private static final GradleVersion LAST_KNOWN_GRADLE = GradleVersion.version("8.9"); //NOI18N

final File gradleUserHome;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public class ExtensionPropertiesExtractor implements ProjectInfoExtractor {
public Result fallback(GradleFiles files) {
return new Result() {
@Override
public Set getExtract() {
return Collections.emptySet();
public Set<?> getExtract() {
return Set.of();
}

@Override
Expand All @@ -59,18 +59,18 @@ public Set<String> getProblems() {
public Result extract(Map<String, Object> props, Map<Class, Object> otherInfo) {
return new Result() {
@Override
public Set getExtract() {
public Set<?> getExtract() {
Map<String, String> values = (Map<String, String>)props.getOrDefault("extensions.propertyValues", Collections.emptyMap()); // NOI18N
Map<String, String> types = (Map<String, String>)props.getOrDefault("extensions.propertyTypes", Collections.emptyMap()); // NOI18N
Map<String, String> taskValues = (Map<String, String>)props.getOrDefault("tasks.propertyValues", Collections.emptyMap()); // NOI18N
Map<String, String> taskTypes = (Map<String, String>)props.getOrDefault("tasks.propertyTypes", Collections.emptyMap()); // NOI18N
PropertyEvaluator a = new PropertyEvaluator(values, types, taskValues, taskTypes);
return Collections.singleton(a);
return Set.of(a);
}

@Override
public Set<String> getProblems() {
return Collections.emptySet();
return Set.of();
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ interface Result {
static Result NONE = new Result() {

@Override
public Set getExtract() {
return Collections.emptySet();
public Set<?> getExtract() {
return Set.of();
}

@Override
public Set<String> getProblems() {
return Collections.emptySet();
return Set.of();
}
};

Set getExtract();
Set<?> getExtract();

Set<String> getProblems();
}
Expand All @@ -72,8 +72,8 @@ public DefaultResult(Object extract, String... problems) {
}

@Override
public Set getExtract() {
return Collections.singleton(extract);
public Set<?> getExtract() {
return Set.of(extract);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion extide/libs.gradle/external/binaries-list
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# specific language governing permissions and limitations
# under the License.

5F48B9BB9099B900FC33864A3794F31C439D9F73 https://repo.gradle.org/artifactory/libs-releases/org/gradle/gradle-tooling-api/8.7/gradle-tooling-api-8.7.jar gradle-tooling-api-8.7.jar
7BCC4423C529A42ECA9D0CE5B5275369EF4DF55A https://repo.gradle.org/artifactory/libs-releases/org/gradle/gradle-tooling-api/8.9/gradle-tooling-api-8.9.jar gradle-tooling-api-8.9.jar
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: Gradle Tooling API
Description: Gradle Tooling API
Version: 8.7
Files: gradle-tooling-api-8.7.jar
Version: 8.9
Files: gradle-tooling-api-8.9.jar
License: Apache-2.0
Origin: Gradle Inc.
URL: https://gradle.org/
Expand Down
2 changes: 1 addition & 1 deletion extide/libs.gradle/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: false
OpenIDE-Module: org.netbeans.modules.libs.gradle/8
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/libs/gradle/Bundle.properties
OpenIDE-Module-Specification-Version: 8.8
OpenIDE-Module-Specification-Version: 8.9
2 changes: 1 addition & 1 deletion extide/libs.gradle/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ javac.compilerargs=-Xlint -Xlint:-serial
# Sigtest fails to read the classes in the gradle-tooling-api
sigtest.skip.gen=true

release.external/gradle-tooling-api-8.7.jar=modules/gradle/gradle-tooling-api.jar
release.external/gradle-tooling-api-8.9.jar=modules/gradle/gradle-tooling-api.jar
2 changes: 1 addition & 1 deletion extide/libs.gradle/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</public-packages>
<class-path-extension>
<runtime-relative-path>gradle/gradle-tooling-api.jar</runtime-relative-path>
<binary-origin>external/gradle-tooling-api-8.7.jar</binary-origin>
<binary-origin>external/gradle-tooling-api-8.9.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
Expand Down
Loading