diff options
author | sdefresne <sdefresne@chromium.org> | 2016-03-17 03:45:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-17 10:47:14 +0000 |
commit | 6b121e47561bb4dd582adff12146655645368639 (patch) | |
tree | a4f03c88d6b855583cbaddf150d4f763ad33303b /testing | |
parent | 2461a73bb77217ef3bbb35a3f32ab5e73eae640b (diff) | |
download | chromium_src-6b121e47561bb4dd582adff12146655645368639.zip chromium_src-6b121e47561bb4dd582adff12146655645368639.tar.gz chromium_src-6b121e47561bb4dd582adff12146655645368639.tar.bz2 |
Add BUILD.gn rules to compile third_party/class-dump.
Add third_party/class-dump/BUILD.gn to build class-dump as a host tool as
part of the iOS build.
Create a template "class_dump" (in third_party/class-dump/class-dump.gni)
to simplify the execution of the class-dump tool on given framework. This
required converting testing/iossim/redirect-stdout.sh to a python script
as gn can only invokes python script.
TBR=rohitrao@chromium.org
BUG=594519
Review URL: https://codereview.chromium.org/1806523002
Cr-Commit-Position: refs/heads/master@{#381687}
Diffstat (limited to 'testing')
-rw-r--r-- | testing/iossim/iossim.gyp | 73 | ||||
-rwxr-xr-x | testing/iossim/redirect-stdout.sh | 25 |
2 files changed, 38 insertions, 60 deletions
diff --git a/testing/iossim/iossim.gyp b/testing/iossim/iossim.gyp index 2a8c2ae..d6bb4ea 100644 --- a/testing/iossim/iossim.gyp +++ b/testing/iossim/iossim.gyp @@ -6,6 +6,8 @@ 'variables': { 'mac_deployment_target': '10.9', 'mac_sdk_min': '10.9', + 'class_dump_bin': '<(PRODUCT_DIR)/class-dump', + 'class_dump_py': '<(DEPTH)/third_party/class-dump/class-dump.py', }, 'conditions': [ ['OS!="ios" or "<(GENERATOR)"!="xcode" or "<(GENERATOR_FLAVOR)"=="ninja"', { @@ -33,65 +35,66 @@ ], 'actions': [ { - 'action_name': 'generate_dvt_foundation_header', + 'action_name': 'generate_dvt_core_simulator', 'inputs': [ - '<(iphone_sim_path)/DVTFoundation.framework/Versions/Current/DVTFoundation', - '<(PRODUCT_DIR)/class-dump', + '<(class_dump_bin)', + '<(class_dump_py)', + '<(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework/Versions/Current/CoreSimulator', ], 'outputs': [ - '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h' + '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h' ], 'action': [ - # Actions don't provide a way to redirect stdout, so a custom - # script is invoked that will execute the first argument and - # write the output to the file specified as the second argument. - # -I sorts classes, categories, and protocols by inheritance. - # -C <regex> only displays classes matching regular expression. - './redirect-stdout.sh', - '<(PRODUCT_DIR)/class-dump -CDVTStackBacktrace|DVTInvalidation|DVTMixIn <(iphone_sim_path)/DVTFoundation.framework', - '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h', + 'python', + '<(class_dump_py)', + '-t', '<(class_dump_bin)', + '-o', '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h', + '--', + '-CSim', + '<(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework', ], - 'message': 'Generating DVTFoundation.h', + 'message': 'Generating CoreSimulator.h', }, { - 'action_name': 'generate_dvt_core_simulator', + 'action_name': 'generate_dvt_foundation_header', 'inputs': [ - '<(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework/Versions/Current/CoreSimulator', - '<(PRODUCT_DIR)/class-dump', + '<(class_dump_bin)', + '<(class_dump_py)', + '<(iphone_sim_path)/DVTFoundation.framework/Versions/Current/DVTFoundation', ], 'outputs': [ - '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h' + '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h' ], 'action': [ - # Actions don't provide a way to redirect stdout, so a custom - # script is invoked that will execute the first argument and - # write the output to the file specified as the second argument. - # -I sorts classes, categories, and protocols by inheritance. - # -C <regex> only displays classes matching regular expression. - './redirect-stdout.sh', - '<(PRODUCT_DIR)/class-dump -CSim <(developer_dir)/Library/PrivateFrameworks/CoreSimulator.framework', - '<(INTERMEDIATE_DIR)/iossim/CoreSimulator.h', + 'python', + '<(class_dump_py)', + '-t', '<(class_dump_bin)', + '-o', '<(INTERMEDIATE_DIR)/iossim/DVTFoundation.h', + '--', + '-CDVTStackBacktrace|DVTInvalidation|DVTMixIn', + '<(iphone_sim_path)/DVTFoundation.framework', ], - 'message': 'Generating CoreSimulator.h', + 'message': 'Generating DVTFoundation.h', }, { 'action_name': 'generate_dvt_iphone_sim_header', 'inputs': [ + '<(class_dump_bin)', + '<(class_dump_py)', '<(iphone_sim_path)/DVTiPhoneSimulatorRemoteClient.framework/Versions/Current/DVTiPhoneSimulatorRemoteClient', - '<(PRODUCT_DIR)/class-dump', ], 'outputs': [ '<(INTERMEDIATE_DIR)/iossim/DVTiPhoneSimulatorRemoteClient.h' ], 'action': [ - # Actions don't provide a way to redirect stdout, so a custom - # script is invoked that will execute the first argument and - # write the output to the file specified as the second argument. - # -I sorts classes, categories, and protocols by inheritance. - # -C <regex> only displays classes matching regular expression. - './redirect-stdout.sh', - '<(PRODUCT_DIR)/class-dump -I -CiPhoneSimulator <(iphone_sim_path)/DVTiPhoneSimulatorRemoteClient.framework', - '<(INTERMEDIATE_DIR)/iossim/DVTiPhoneSimulatorRemoteClient.h', + 'python', + '<(class_dump_py)', + '-t', '<(class_dump_bin)', + '-o', '<(INTERMEDIATE_DIR)/iossim/DVTiPhoneSimulatorRemoteClient.h', + '--', + '-I', + '-CiPhoneSimulator', + '<(iphone_sim_path)/DVTiPhoneSimulatorRemoteClient.framework', ], 'message': 'Generating DVTiPhoneSimulatorRemoteClient.h', }, diff --git a/testing/iossim/redirect-stdout.sh b/testing/iossim/redirect-stdout.sh deleted file mode 100755 index 4465503..0000000 --- a/testing/iossim/redirect-stdout.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -# -# This script executes the command given as the first argument, strips -# cxx_destruct from stdout, and redirects the remaining stdout to the file given -# as the second argument. -# -# Example: Write the text 'foo' to a file called out.txt: -# RedirectStdout.sh "echo foo" out.txt -# -# This script is invoked from iossim.gyp in order to redirect the output of -# class-dump to a file (because gyp actions don't support redirecting output). -# This script also removes all lines with cxx_destruct. Perhaps newer versions -# of class-dump will fix this issue. As of 3.5, 'cxx_destruct' still exists. - -if [ ${#} -ne 2 ] ; then - echo "usage: ${0} <command> <output file>" - exit 2 -fi - -echo "// Treat class-dump output as a system header." > $2 -echo "#pragma clang system_header" >> $2 -$1 | sed /cxx_destruct/d >> $2 |