Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Gradle Property and Provider to enable lazy evaluation for jib.extraDirectories parameters #3737

Merged
merged 24 commits into from
Aug 25, 2022
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a55e53a
Update permissions type from Map to MapProperty
emmileaf Aug 16, 2022
019fd65
Convert path.from and path.into to property types
emmileaf Aug 16, 2022
3402b29
WIP: add/fix unit tests
emmileaf Aug 16, 2022
63319af
WIP: changes to setFrom to accept Provider type
emmileaf Aug 17, 2022
5e6f237
WIP: comment out added tests for more debugging
emmileaf Aug 17, 2022
a5f1aee
WIP: clean up updated setFrom to allow for lazy eval
emmileaf Aug 17, 2022
56cb69e
WIP: fix added unit test, can lazy eval using setFrom but not setPaths
emmileaf Aug 17, 2022
b43c295
Add extra directories to lazy evaluation testing project
emmileaf Aug 17, 2022
7370713
Switch setFrom to method overloading
emmileaf Aug 18, 2022
1360011
Update setPaths to allow for lazy eval
emmileaf Aug 18, 2022
1819eb3
Update unit tests to check for both specification options
emmileaf Aug 18, 2022
b2815b7
Remove setPermissions test
emmileaf Aug 19, 2022
798882d
Fix file formatting
emmileaf Aug 19, 2022
b79d5ec
Switch from anonymous inner classes to lambdas
emmileaf Aug 22, 2022
925d5c3
Fix test compatibility with windows
emmileaf Aug 22, 2022
af4bb2c
Coverage: add tests for extraDirectories in JibExtensionTest
emmileaf Aug 23, 2022
4d986fa
Rename test file for committing test extra directory
emmileaf Aug 24, 2022
bd9183d
Update changelog and readme
emmileaf Aug 24, 2022
11d9dd1
Move object to parameters logic into helper method
emmileaf Aug 24, 2022
c7e131e
Fix javadoc checkstyle violations
emmileaf Aug 24, 2022
f380733
Rename added tests
emmileaf Aug 24, 2022
96197cf
Rename helper method
emmileaf Aug 24, 2022
25e47a5
Updated test to use stricter assert statement for path.from
emmileaf Aug 25, 2022
6f0a3b7
Update test file with more informative content
emmileaf Aug 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP: clean up updated setFrom to allow for lazy eval
emmileaf committed Aug 17, 2022
commit a5f1aeef7ac71eaafda49889e23db3f85d78181a
Original file line number Diff line number Diff line change
@@ -67,13 +67,11 @@ public Path getFrom() {
return from.get();
}

public void setFrom(Object fromObj) {
// TODO: this should also be able support provider of objects convertible by project.file()
// System.out.println("setFrom object: " + fromObj);
// TODO: if from is a Provider<>, here we need to convert it to a Provider<Path>
if (fromObj instanceof Provider) {
// System.out.println("object is a provider");
Provider fromProvider = (Provider) fromObj;
public void setFrom(Object from) {
// This setter should be able support provider of suitable objects convertible by project.file()
// If argument is a Provider<Object>, here it is converted to a Provider<Path>
if (from instanceof Provider) {
Provider fromProvider = (Provider) from;
this.from.set(
fromProvider.map(
new Transformer<Path, Object>() {
@@ -83,24 +81,10 @@ public Path transform(Object obj) {
}
}));
} else {
// System.out.println("object is not a provider");
this.from.set(project.file(fromObj).toPath());
this.from.set(project.file(from).toPath());
}
}

// public void setFrom(Provider<String> from) {
// this.from.set(
// from.map(
// new Transformer<Path, Object>() {
// @Override
// public Path transform(Object from) {
// return project.file(from).toPath();
// }
// }
// )
// );
// }

@Override
@Input
public String getInto() {