From ab548a8f322b1481fc09f3d3052d1928eb964780 Mon Sep 17 00:00:00 2001 From: Qingyang Chen Date: Tue, 3 Jul 2018 09:28:37 -0400 Subject: [PATCH 1/2] Fixes jibExportDockerContext Input vs. OutputDirectory and changes CLI option to --targetDir. --- jib-gradle-plugin/CHANGELOG.md | 2 ++ .../tools/jib/gradle/DockerContextTask.java | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/jib-gradle-plugin/CHANGELOG.md b/jib-gradle-plugin/CHANGELOG.md index 868a0e9c13..1e4a418fdd 100644 --- a/jib-gradle-plugin/CHANGELOG.md +++ b/jib-gradle-plugin/CHANGELOG.md @@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file. ### Fixed +- Set `jibExportDockerContext` output directory with command line option `--targetDir` ([]()) + ## 0.9.1 ### Added diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/DockerContextTask.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/DockerContextTask.java index 81c162c0c2..3477db3021 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/DockerContextTask.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/DockerContextTask.java @@ -72,11 +72,22 @@ public FileCollection getInputFiles() { } /** - * @return the output directory for the Docker context is by default {@code build/jib-docker- - * context}. + * The output directory to check for task up-to-date. + * + * @return the output directory */ - @Input @OutputDirectory + public String getOutputDirectory() { + return getTargetDir(); + } + + /** + * Returns the output directory for the Docker context. By default, it is {@code + * build/jib-docker-context}. + * + * @return the output directory + */ + @Input public String getTargetDir() { if (targetDir == null) { return getProject().getBuildDir().toPath().resolve("jib-docker-context").toString(); @@ -85,11 +96,11 @@ public String getTargetDir() { } /** - * The output directory can be overriden with the {@code --jib.dockerDir} command line option. + * The output directory can be overriden with the {@code --targetDir} command line option. * * @param targetDir the output directory. */ - @Option(option = "jib.dockerDir", description = "Directory to output the Docker context to") + @Option(option = "targetDir", description = "Directory to output the Docker context to") public void setTargetDir(String targetDir) { this.targetDir = targetDir; } From 6601a9ddcef55498ada5232479ace45e4a0fcd21 Mon Sep 17 00:00:00 2001 From: Qingyang Chen Date: Tue, 3 Jul 2018 09:30:41 -0400 Subject: [PATCH 2/2] Updates CHANGELOG. --- jib-gradle-plugin/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jib-gradle-plugin/CHANGELOG.md b/jib-gradle-plugin/CHANGELOG.md index 1e4a418fdd..2b7a29b0a0 100644 --- a/jib-gradle-plugin/CHANGELOG.md +++ b/jib-gradle-plugin/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. ### Fixed -- Set `jibExportDockerContext` output directory with command line option `--targetDir` ([]()) +- Set `jibExportDockerContext` output directory with command line option `--targetDir` ([#499](https://github.com/GoogleContainerTools/jib/pull/499)) ## 0.9.1