Skip to content

Commit

Permalink
[Gradle] Replace deprecated build scan api usage (elastic#110783)
Browse files Browse the repository at this point in the history
We updated to use develocity plugin a while ago but still used
a deprecated api in the build complete logic we have running on ci
  • Loading branch information
breskeby authored Jul 12, 2024
1 parent c61b9ee commit 384b6a9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.elasticsearch.gradle.internal;

import com.gradle.scan.plugin.BuildScanExtension;
import com.gradle.develocity.agent.gradle.DevelocityConfiguration;

import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
Expand Down Expand Up @@ -64,7 +64,7 @@ public void apply(Project target) {
File targetFile = target.file("build/" + buildNumber + ".tar.bz2");
File projectDir = target.getProjectDir();
File gradleWorkersDir = new File(target.getGradle().getGradleUserHomeDir(), "workers/");
BuildScanExtension extension = target.getExtensions().getByType(BuildScanExtension.class);
DevelocityConfiguration extension = target.getExtensions().getByType(DevelocityConfiguration.class);
File daemonsLogDir = new File(target.getGradle().getGradleUserHomeDir(), "daemon/" + target.getGradle().getGradleVersion());

getFlowScope().always(BuildFinishedFlowAction.class, spec -> {
Expand Down Expand Up @@ -125,7 +125,7 @@ interface Parameters extends FlowParameters {
ListProperty<File> getFilteredFiles();

@Input
Property<BuildScanExtension> getBuildScan();
Property<DevelocityConfiguration> getBuildScan();

}

Expand Down Expand Up @@ -198,7 +198,7 @@ public void execute(BuildFinishedFlowAction.Parameters parameters) throws FileNo
+ System.getenv("BUILDKITE_JOB_ID")
+ "/artifacts/"
+ artifactUuid;
parameters.getBuildScan().get().link("Artifact Upload", targetLink);
parameters.getBuildScan().get().getBuildScan().link("Artifact Upload", targetLink);
}
} catch (Exception e) {
System.out.println("Failed to upload buildkite artifact " + e.getMessage());
Expand Down

0 comments on commit 384b6a9

Please sign in to comment.