diff --git a/src/cache-base.ts b/src/cache-base.ts index 7c5eeff..f989639 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -172,12 +172,21 @@ export class GradleStateCache { } private initializeGradleUserHome(gradleUserHome: string, initScriptsDir: string): void { - const initScriptFilenames = ['build-result-capture.init.gradle', 'build-result-capture-service.plugin.groovy'] + const initScriptFilenames = [ + 'build-result-capture.init.gradle', + 'build-result-capture-service.plugin.groovy', + 'github-dependency-graph.init.gradle' + ] for (const initScriptFilename of initScriptFilenames) { const initScriptContent = this.readInitScriptAsString(initScriptFilename) const initScriptPath = path.resolve(initScriptsDir, initScriptFilename) fs.writeFileSync(initScriptPath, initScriptContent) } + + // TODO:DAZ Remove this when we use a real dependency again + const depGraphJar = 'github-dependency-graph-gradle-plugin-0.0.3.jar' + const jarFile = path.resolve(__dirname, '..', '..', 'src', 'resources', 'init-scripts', depGraphJar) + fs.copyFileSync(jarFile, path.resolve(initScriptsDir, depGraphJar)) } private readInitScriptAsString(resource: string): string { diff --git a/src/resources/init-scripts/github-dependency-graph-gradle-plugin-0.0.3.jar b/src/resources/init-scripts/github-dependency-graph-gradle-plugin-0.0.3.jar new file mode 100644 index 0000000..1e079df Binary files /dev/null and b/src/resources/init-scripts/github-dependency-graph-gradle-plugin-0.0.3.jar differ diff --git a/src/resources/init-scripts/github-dependency-graph.init.gradle b/src/resources/init-scripts/github-dependency-graph.init.gradle index edb2696..50bcf8e 100644 --- a/src/resources/init-scripts/github-dependency-graph.init.gradle +++ b/src/resources/init-scripts/github-dependency-graph.init.gradle @@ -1,12 +1,7 @@ -import org.gradle.github.GitHubDependencyGraphPlugin +// TODO:DAZ This should be conditionally applied, since the script may be present when not required. initscript { - repositories { - maven { - url = uri("https://plugins.gradle.org/m2/") - } - } dependencies { - classpath("org.gradle:github-dependency-graph-gradle-plugin:+") + classpath files("github-dependency-graph-gradle-plugin-0.0.3.jar") } } -apply plugin: GitHubDependencyGraphPlugin +apply plugin: org.gradle.github.GitHubDependencyGraphPlugin