aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/xcode-common
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2015-07-30 22:52:24 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-04 09:05:49 +0000
commitda3cb806351e929becef19652c65d39efa61b9d9 (patch)
tree9a958e75da52fc9d40c1fed1db5ea44e89f934d7 /src/tools/xcode-common
parent73d4fc94dff31477e7882286784001956b170863 (diff)
RELNOTES: actoolzip, momczip and swiftstdlibtoolzip have all been made into bash scripts and have been renamed to actoolwrapper, momcwrapper and swiftstdlibtoolwrapper respectively. The old versions will be deleted in a later change.
-- MOS_MIGRATED_REVID=99521906
Diffstat (limited to 'src/tools/xcode-common')
-rw-r--r--src/tools/xcode-common/BUILD2
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/ActoolZip.java116
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/BUILD17
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/README4
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/BUILD17
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/README4
-rw-r--r--src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/SwiftStdlibToolZip.java59
7 files changed, 0 insertions, 219 deletions
diff --git a/src/tools/xcode-common/BUILD b/src/tools/xcode-common/BUILD
index 639c621679..bfd7849aef 100644
--- a/src/tools/xcode-common/BUILD
+++ b/src/tools/xcode-common/BUILD
@@ -3,9 +3,7 @@ package(default_visibility = ["//src/test:__subpackages__"])
filegroup(
name = "srcs",
srcs = [
- "//src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip:srcs",
"//src/tools/xcode-common/java/com/google/devtools/build/xcode/common:srcs",
- "//src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip:srcs",
"//src/tools/xcode-common/java/com/google/devtools/build/xcode/util:srcs",
"//src/tools/xcode-common/java/com/google/devtools/build/xcode/zip:srcs",
"//src/tools/xcode-common/java/com/google/devtools/build/xcode/zippingoutput:srcs",
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/ActoolZip.java b/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/ActoolZip.java
deleted file mode 100644
index cd4466748c..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/ActoolZip.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2014 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.xcode.actoolzip;
-
-import com.google.common.base.Optional;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.devtools.build.xcode.zippingoutput.Arguments;
-import com.google.devtools.build.xcode.zippingoutput.Wrapper;
-import com.google.devtools.build.xcode.zippingoutput.Wrappers;
-import com.google.devtools.build.xcode.zippingoutput.Wrappers.CommandFailedException;
-import com.google.devtools.build.xcode.zippingoutput.Wrappers.OutErr;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Set;
-
-/**
- * A tool which wraps actool by running actool and zipping its output. See the JavaDoc for
- * {@link Wrapper} for more information.
- */
-public class ActoolZip implements Wrapper {
-
- @Override
- public String name() {
- return "ActoolZip";
- }
-
- @Override
- public String subtoolName() {
- return "actool";
- }
-
- @Override
- public Iterable<String> subCommand(Arguments args, String outputDirectory) {
- return new ImmutableList.Builder<String>()
- .add(args.subtoolCmd())
- .add("--output-format").add("human-readable-text")
- .add("--notices")
- .add("--warnings")
- .add("--errors")
- .add("--compress-pngs")
- .add("--compile")
- .add(outputDirectory)
- // actool munges paths in some way which doesn't work if one of the directories in the path
- // is a symlink.
- .addAll(Iterables.transform(args.subtoolExtraArgs(), Wrappers.CANONICALIZE_IF_PATH))
- .build();
- }
-
- public static void main(String[] args) throws IOException, InterruptedException {
- Optional<File> infoPlistPath = replaceInfoPlistPath(args);
- try {
- OutErr outErr = Wrappers.executeCapturingOutput(args, new ActoolZip());
- if (infoPlistPath.isPresent() && !infoPlistPath.get().exists()) {
- outErr.print();
- System.exit(1);
- }
- } catch (CommandFailedException e) {
- Wrappers.handleException(e);
- }
- }
-
- /**
- * Absolute-ify output partial info plist's path.
- *
- * <p>actool occasionally writes the partial info plist file to the wrong directory if a
- * non-absolute path is passed as --output-partial-info-plist, so we optimistically try to
- * absolute-ify its path. This isn't caught by the "CANONICAL_PATH" transform above, because the
- * file doesn't exist at the time of flag parsing.
- *
- * <p>Modifies args in-place.
- *
- * @return new value of the output-partial-info-plist flag.
- */
- private static Optional<File> replaceInfoPlistPath(String[] args) {
- String flag = "output-partial-info-plist";
- Set<String> flagOptions = ImmutableSet.of(
- "-" + flag,
- "--" + flag);
- Optional<File> newPath = Optional.absent();
- for (int i = 0; i < args.length; ++i) {
- for (String flagOption : flagOptions) {
- String arg = args[i];
- String flagEquals = flagOption + "=";
- if (arg.startsWith(flagEquals)) {
- newPath = Optional.of(new File(arg.substring(flagEquals.length())));
- args[i] = flagEquals + newPath.get().getAbsolutePath();
- }
- if (arg.equals(flagOption) && i + 1 < args.length) {
- newPath = Optional.of(new File(args[i + 1]));
- args[i + 1] = newPath.get().getAbsolutePath();
- }
- }
- }
- return newPath;
- }
-
- @Override
- public boolean outputDirectoryMustExist() {
- return true;
- }
-}
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/BUILD b/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/BUILD
deleted file mode 100644
index 8e08b62c82..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/BUILD
+++ /dev/null
@@ -1,17 +0,0 @@
-package(default_visibility = ["//src:__subpackages__"])
-
-filegroup(
- name = "srcs",
- srcs = glob(["**"]),
-)
-
-java_binary(
- name = "actoolzip",
- srcs = ["ActoolZip.java"],
- main_class = "com.google.devtools.build.xcode.actoolzip.ActoolZip",
- visibility = ["//visibility:public"],
- deps = [
- "//src/tools/xcode-common/java/com/google/devtools/build/xcode/zippingoutput",
- "//third_party:guava",
- ],
-)
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/README b/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/README
deleted file mode 100644
index 7aaae168bb..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/actoolzip/README
+++ /dev/null
@@ -1,4 +0,0 @@
-actoolzip runs actool, which compiles asset catalog files and zips up the
-output, because actool returns an unpredictable number of output files.
-
-actool only runs on Darwin, so actoolzip only runs on Darwin.
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/BUILD b/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/BUILD
deleted file mode 100644
index b42968804a..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/BUILD
+++ /dev/null
@@ -1,17 +0,0 @@
-package(default_visibility = ["//src:__subpackages__"])
-
-filegroup(
- name = "srcs",
- srcs = glob(["**"]),
-)
-
-java_binary(
- name = "swiftstdlibtoolzip",
- srcs = ["SwiftStdlibToolZip.java"],
- main_class = "com.google.devtools.build.xcode.swiftstdlibtoolzip.SwiftStdlibToolZip",
- visibility = ["//visibility:public"],
- deps = [
- "//src/tools/xcode-common/java/com/google/devtools/build/xcode/zippingoutput",
- "//third_party:guava",
- ],
-)
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/README b/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/README
deleted file mode 100644
index 0c8b3f082d..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/README
+++ /dev/null
@@ -1,4 +0,0 @@
-swiftstdlibtoolzip runs swift-stdlib-tool, which scans executables and copies required Swift
-framework dylibs to the specified path, then zips up the output for further bundle merging.
-
-swift-stdlib-tool only runs on Darwin, so swiftstdlibtoolzip only runs on Darwin.
diff --git a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/SwiftStdlibToolZip.java b/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/SwiftStdlibToolZip.java
deleted file mode 100644
index 2043a08fd3..0000000000
--- a/src/tools/xcode-common/java/com/google/devtools/build/xcode/swiftstdlibtoolzip/SwiftStdlibToolZip.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.google.devtools.build.xcode.swiftstdlibtoolzip;
-
-import com.google.common.collect.ImmutableList;
-import com.google.devtools.build.xcode.zippingoutput.Arguments;
-import com.google.devtools.build.xcode.zippingoutput.Wrapper;
-import com.google.devtools.build.xcode.zippingoutput.Wrappers;
-
-import java.io.IOException;
-
-/**
- * A tool which wraps swift-stdlib-tool by running and zipping its output. See {@link Wrapper} for
- * more information.
- */
-public class SwiftStdlibToolZip implements Wrapper {
-
- @Override
- public String name() {
- return "SwiftStdlibToolZip";
- }
-
- @Override
- public String subtoolName() {
- return "swift-stdlib-tool";
- }
-
- @Override
- public Iterable<String> subCommand(Arguments arguments, String outputDirectory) {
- return new ImmutableList.Builder<String>()
- .add(arguments.subtoolCmd())
- .addAll(arguments.subtoolExtraArgs())
- .add("--copy")
- .add("--verbose")
- .add("--destination").add(outputDirectory)
- .build();
- }
-
- @Override
- public boolean outputDirectoryMustExist() {
- return true;
- }
-
- public static void main(String[] args) throws IOException, InterruptedException {
- Wrappers.executePipingOutput(args, new SwiftStdlibToolZip());
- }
-}