Skip to content

Update dependency ch.epfl.scala:bsp4j to v2.1.1 #32

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

Merged
merged 2 commits into from
Apr 2, 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
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
bsp4j = "2.1.0-M5"
bsp4j = "2.1.1"
equalsVerifier = "3.15.1"
graalVmNativeImagePlugin = "0.9.24"
gradleBuildInfo = "0.3.1"
Expand Down
1 change: 0 additions & 1 deletion plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
`java-gradle-plugin`
`jacoco-report-aggregation`
alias(libs.plugins.gradleJavaConventions)
// TODO: remove this once https://github.com/gradle/gradle/issues/17559 is fixed
alias(libs.plugins.gradleBuildInfo)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: © 2023 Opencast Software Europe Ltd <https://opencastsoftware.com>
* SPDX-FileCopyrightText: © 2023-2024 Opencast Software Europe Ltd <https://opencastsoftware.com>
* SPDX-License-Identifier: Apache-2.0
*/
package com.opencastsoftware.gradle.bsp.server;
Expand Down Expand Up @@ -489,7 +489,7 @@ String[] getCleanTasksFrom(List<URI> targetUris) {
@Override
public CompletableFuture<CleanCacheResult> buildTargetCleanCache(CleanCacheParams params) {
return ifInitializedAsync(cancelToken -> {
var cleanResult = new CleanCacheResult(null, Boolean.TRUE);
var cleanResult = new CleanCacheResult(Boolean.TRUE);

var targetUris = getTargetUris(params);
var targetCleanTasks = getCleanTasksFrom(targetUris);
Expand All @@ -509,7 +509,6 @@ public CompletableFuture<CleanCacheResult> buildTargetCleanCache(CleanCacheParam
});
}

@Override
public void onConnectWithClient(BuildClient client) {
this.client = client;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: © 2023 Opencast Software Europe Ltd <https://opencastsoftware.com>
* SPDX-FileCopyrightText: © 2023-2024 Opencast Software Europe Ltd <https://opencastsoftware.com>
* SPDX-License-Identifier: Apache-2.0
*/
package com.opencastsoftware.gradle.bsp.server.util;
Expand All @@ -19,12 +19,12 @@ public static BuildTargetIdentifier toBspBuildTargetId(BspBuildTargetId targetId
}

public static BuildTargetCapabilities toBspBuildTargetCapabilities(BspBuildTargetCapabilities capabilities) {
return new BuildTargetCapabilities(
capabilities.canCompile(),
capabilities.canTest(),
capabilities.canRun(),
capabilities.canDebug()
);
var bspCapabilities = new BuildTargetCapabilities();
bspCapabilities.setCanCompile(capabilities.canCompile());
bspCapabilities.setCanTest(capabilities.canTest());
bspCapabilities.setCanRun(capabilities.canRun());
bspCapabilities.setCanDebug(capabilities.canDebug());
return bspCapabilities;
}

public static BuildTarget toBspBuildTarget(BspBuildTarget buildTarget) {
Expand Down Expand Up @@ -67,9 +67,12 @@ public static BuildTarget toBspBuildTarget(BspBuildTarget buildTarget) {

public static JvmBuildTarget toBspJvmBuildTarget(Serializable data) {
try {
var bspJvmBuildTarget = new JvmBuildTarget();
var javaHomeMethod = data.getClass().getDeclaredMethod("javaHome");
var javaVersionMethod = data.getClass().getDeclaredMethod("javaVersion");
return new JvmBuildTarget(javaHomeMethod.invoke(data).toString(), (String) javaVersionMethod.invoke(data));
bspJvmBuildTarget.setJavaHome(javaHomeMethod.invoke(data).toString());
bspJvmBuildTarget.setJavaVersion((String) javaVersionMethod.invoke(data));
return bspJvmBuildTarget;
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
return null;
}
Expand Down