Skip to content

Commit 6db0a01

Browse files
authored
Fixes jibExportDockerContext Input vs. OutputDirectory and changes CLI option to --targetDir. (GoogleContainerTools#499)
1 parent 855d7ad commit 6db0a01

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎jib-gradle-plugin/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ All notable changes to this project will be documented in this file.
1111

1212
### Fixed
1313

14+
- Set `jibExportDockerContext` output directory with command line option `--targetDir` ([#499](https://github.com/GoogleContainerTools/jib/pull/499))
15+
1416
## 0.9.1
1517

1618
### Added

‎jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/DockerContextTask.java‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,22 @@ public FileCollection getInputFiles() {
7272
}
7373

7474
/**
75-
* @return the output directory for the Docker context is by default {@code build/jib-docker-
76-
* context}.
75+
* The output directory to check for task up-to-date.
76+
*
77+
* @return the output directory
7778
*/
78-
@Input
7979
@OutputDirectory
80+
public String getOutputDirectory() {
81+
return getTargetDir();
82+
}
83+
84+
/**
85+
* Returns the output directory for the Docker context. By default, it is {@code
86+
* build/jib-docker-context}.
87+
*
88+
* @return the output directory
89+
*/
90+
@Input
8091
public String getTargetDir() {
8192
if (targetDir == null) {
8293
return getProject().getBuildDir().toPath().resolve("jib-docker-context").toString();
@@ -85,11 +96,11 @@ public String getTargetDir() {
8596
}
8697

8798
/**
88-
* The output directory can be overriden with the {@code --jib.dockerDir} command line option.
99+
* The output directory can be overriden with the {@code --targetDir} command line option.
89100
*
90101
* @param targetDir the output directory.
91102
*/
92-
@Option(option = "jib.dockerDir", description = "Directory to output the Docker context to")
103+
@Option(option = "targetDir", description = "Directory to output the Docker context to")
93104
public void setTargetDir(String targetDir) {
94105
this.targetDir = targetDir;
95106
}

0 commit comments

Comments
 (0)