Skip to content

Commit 2184188

Browse files
committed
fix(agent): Fix build script cache
Fix agent JAR index generation gradle task to avoid breaking build cache. The task generates an index into its input folder, making the tasks always outdated and mandatory to execute for each build.
1 parent ae1c4c9 commit 2184188

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dd-java-agent/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,13 @@ shadowJar generalShadowJarConfig >> {
162162
}
163163

164164
tasks.register('generateAgentJarIndex', JavaExec) {
165+
def indexName = 'dd-java-agent.index'
165166
def contentDir = "${sourceSets.main.output.resourcesDir}"
166-
def indexFile = "${contentDir}/dd-java-agent.index"
167+
def indexFile = "${contentDir}/${indexName}"
167168

168169
it.group = 'Build'
169170
it.description = "Generate dd-java-agent.index"
170-
it.inputs.files(contentDir)
171+
it.inputs.files(fileTree(contentDir).exclude(indexName))
171172
it.outputs.files(indexFile)
172173
it.mainClass = 'datadog.trace.bootstrap.AgentJarIndex$IndexGenerator'
173174
it.classpath = project.configurations.shadowInclude

0 commit comments

Comments
 (0)