List of usage examples for com.google.common.collect ImmutableList toArray
<T> T[] toArray(T[] a);
From source file:com.google.devtools.build.lib.rules.objc.ObjcRuleTestCase.java
protected void checkCcDependencyAndJ2objcDependency(BinaryRuleTypePair ruleTypePair, ConfigurationDistinguisher configurationDistinguisher) throws Exception { MockProtoSupport.setup(mockToolsConfig); MockJ2ObjcSupport.setup(mockToolsConfig); useConfiguration("--cpu=ios_i386"); scratch.file("lib/BUILD", "java_library(", " name = 'javalib',", " srcs = ['foo.java'],", ")", "", "j2objc_library(", " name = 'j2objclib',", " deps = [':javalib'],", ")", "", "cc_library(", " name = 'cclib',", " srcs = ['dep.c'],", ")"); ruleTypePair.scratchTargets(scratch, "deps", "['//lib:cclib', '//lib:j2objclib']"); Action appLipoAction = getGeneratingAction( getBinArtifact("x_lipobin", getConfiguredTarget("//x:x", targetConfig))); CommandAction binBinAction = (CommandAction) getGeneratingAction( getFirstArtifactEndingWith(appLipoAction.getInputs(), "bin_bin")); String i386Prefix = iosConfigurationCcDepsBin("i386", configurationDistinguisher); ImmutableList<String> archiveFilenames = ImmutableList.of(i386Prefix + "lib/libcclib.a", i386Prefix + "x/libbin.a", i386Prefix + "lib/libjavalib_j2objc.a", i386Prefix + toolsRepoExecPath("third_party/java/j2objc/libjre_core_lib.a")); verifyObjlist(binBinAction, "x/bin-linker.objlist", archiveFilenames.toArray(new String[archiveFilenames.size()])); assertThat(Artifact.toExecPaths(binBinAction.getInputs())).containsAllIn( ImmutableList.builder().addAll(archiveFilenames).add(i386Prefix + "x/bin-linker.objlist").build()); }