Skip to content

Commit

Permalink
🚨 fix warnings after Gradle Wrapper upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandens committed Oct 18, 2023
1 parent ce3c8ab commit cf7b9a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.ryandens.javaagent.JavaagentBasePlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.file.DuplicatesStrategy
import java.io.File

/**
* Enables easy consumption of external extensions and instrumentation libraries by creating a new jar with extra
Expand Down Expand Up @@ -39,7 +38,7 @@ class JavaagentOTelModificationPlugin : Plugin<Project> {
val extendedAgent = project.tasks.register("extendedAgent", ShadowJar::class.java) { jar ->
jar.inputs.files(otelInstrumentation)
jar.archiveFileName.set("extended-opentelemetry-javaagent.jar")
jar.destinationDirectory.set(File(project.buildDir, "agents"))
jar.destinationDirectory.set(project.layout.buildDirectory.dir("agents"))
jar.mergeServiceFiles {
it.include("inst/META-INF/services/*")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class JavaagentJibExtension : JibGradlePluginExtension<Void>, JavaagentPlugin {
project: Project,
javaagentConfiguration: NamedDomainObjectProvider<Configuration>,
) {
val destinationDirectory = File("${project.buildDir}/jib-agents/")
val destinationDirectory = project.layout.buildDirectory.dir("jib-agents")
val copyAgents = project.tasks.register("copyAgentsToJibDir", Copy::class.java) {
it.from(javaagentConfiguration)
it.into(destinationDirectory)
Expand All @@ -92,7 +92,7 @@ class JavaagentJibExtension : JibGradlePluginExtension<Void>, JavaagentPlugin {
}

javaagentPathProvider = {
javaagentConfiguration.get().files.map { File(destinationDirectory, it.name) }
javaagentConfiguration.get().files.map { File(destinationDirectory.get().asFile, it.name) }
}
}

Expand Down

0 comments on commit cf7b9a2

Please sign in to comment.