From 59f1d889f71d6d203ca061787d4ea16465df1916 Mon Sep 17 00:00:00 2001 From: tomlu Date: Tue, 15 Aug 2017 23:21:25 +0200 Subject: Add more type safety to CustomCommandLine. Allowing add(Object) is too loose and can easily lead to programmer mistakes. Because of type erasure, we can't use the same overload name for (eg.) add(NestedSet) and add(NestedSet). The API is overhauled to use the same terms everywhere, eg. "add", "addPaths", "addExecPaths". This is similar to how it used to be a few CLs ago. The API is overhauled to make sure it's consistent for all types. While tedious, the facade methods immediately dispatch to internal helpers, so implementation wise it's not too heavy. While large, this CL is almost entirely an automated refactor. PiperOrigin-RevId: 165358287 --- .../google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/rules/objc') diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java index 8ec3cc6111..24a977c1db 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java @@ -2157,7 +2157,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { .containsExactlyElementsIn( new Builder() .add(MOCK_IBTOOLWRAPPER_PATH) - .add(storyboardZip) + .addExecPath(storyboardZip) .addDynamicString(archiveRoot) // archive root .add("--minimum-deployment-target", minimumOsVersion.toString()) .add("--module") @@ -2180,7 +2180,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { .containsExactlyElementsIn( new Builder() .add(MOCK_IBTOOLWRAPPER_PATH) - .add(storyboardZip) + .addExecPath(storyboardZip) .addDynamicString(archiveRoot) // archive root .add("--minimum-deployment-target", minimumOsVersion.toString()) .add("--module") @@ -2217,10 +2217,10 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { } expectedCommandLine - .add("--output_zip_path", swiftLibsZip) + .addExecPath("--output_zip_path", swiftLibsZip) .add("--bundle_path", bundlePath) .add("--platform", platformName) - .add("--scan-executable", binary); + .addExecPath("--scan-executable", binary); assertThat(toolAction.getArguments()).isEqualTo(expectedCommandLine.build().arguments()); } @@ -3870,7 +3870,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { .isEqualTo( new CustomCommandLine.Builder() .add(MOCK_IBTOOLWRAPPER_PATH) - .add(storyboardZip) + .addExecPath(storyboardZip) .add("launch.storyboardc") .add("--minimum-deployment-target") .add("8.1") -- cgit v1.2.3