Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(828)

Issue 1711953003: Adds the OCHamcrest library to the iOS build. (Closed)

Created:
4 years, 10 months ago by rohitrao (ping after 24h)
Modified:
4 years, 10 months ago
CC:
chromium-reviews, sdefresne+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds the OCHamcrest library to the iOS build. Adapted from a patch by baxley@chromium.org. BUG=580730 TEST=None

Patch Set 1 #

Patch Set 2 : Fix outputs. #

Total comments: 6

Patch Set 3 : Review. #

Total comments: 4

Patch Set 4 : Review. #

Patch Set 5 : --dest-dir #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+316 lines, --1 lines) Patch
M .gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M DEPS View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
A ios/chrome/tools/build/ios_generate_forwarding_headers.py View 1 2 3 4 1 chunk +71 lines, -0 lines 12 comments Download
M ios/ios.gyp View 1 chunk +1 line, -0 lines 0 comments Download
A ios/third_party/ochamcrest/LICENSE View 1 chunk +13 lines, -0 lines 0 comments Download
A + ios/third_party/ochamcrest/OWNERS View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A ios/third_party/ochamcrest/README.chromium View 1 chunk +12 lines, -0 lines 0 comments Download
A ios/third_party/ochamcrest/ochamcrest.gyp View 1 2 3 4 1 chunk +216 lines, -0 lines 3 comments Download

Messages

Total messages: 22 (7 generated)
rohitrao (ping after 24h)
4 years, 10 months ago (2016-02-19 21:37:52 UTC) #2
baxley
On 2016/02/19 21:37:52, rohitrao wrote: LGTM, thanks for doing the gyp thing. Here's a bug ...
4 years, 10 months ago (2016-02-20 00:49:59 UTC) #3
baxley
https://codereview.chromium.org/1711953003/diff/20001/ios/chrome/tools/build/ios_generate_forwarding_headers.py File ios/chrome/tools/build/ios_generate_forwarding_headers.py (right): https://codereview.chromium.org/1711953003/diff/20001/ios/chrome/tools/build/ios_generate_forwarding_headers.py#newcode28 ios/chrome/tools/build/ios_generate_forwarding_headers.py:28: def generate_headers(inputs, dest_dir): Would it make any sense to ...
4 years, 10 months ago (2016-02-20 01:11:51 UTC) #4
rohitrao (ping after 24h)
Over to Justin for a committer review. https://codereview.chromium.org/1711953003/diff/20001/ios/chrome/tools/build/ios_generate_forwarding_headers.py File ios/chrome/tools/build/ios_generate_forwarding_headers.py (right): https://codereview.chromium.org/1711953003/diff/20001/ios/chrome/tools/build/ios_generate_forwarding_headers.py#newcode28 ios/chrome/tools/build/ios_generate_forwarding_headers.py:28: def generate_headers(inputs, ...
4 years, 10 months ago (2016-02-20 01:18:52 UTC) #6
baxley
Sorry, one last comment... https://codereview.chromium.org/1711953003/diff/20001/ios/third_party/ochamcrest/OWNERS File ios/third_party/ochamcrest/OWNERS (right): https://codereview.chromium.org/1711953003/diff/20001/ios/third_party/ochamcrest/OWNERS#newcode3 ios/third_party/ochamcrest/OWNERS:3: rohitrao@google.com change these to @chromium.org ...
4 years, 10 months ago (2016-02-20 01:24:31 UTC) #7
rohitrao (ping after 24h)
https://codereview.chromium.org/1711953003/diff/20001/ios/third_party/ochamcrest/OWNERS File ios/third_party/ochamcrest/OWNERS (right): https://codereview.chromium.org/1711953003/diff/20001/ios/third_party/ochamcrest/OWNERS#newcode3 ios/third_party/ochamcrest/OWNERS:3: rohitrao@google.com On 2016/02/20 01:24:31, baxley wrote: > change these ...
4 years, 10 months ago (2016-02-20 01:28:35 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1711953003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1711953003/40001
4 years, 10 months ago (2016-02-20 01:34:37 UTC) #11
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-20 02:51:28 UTC) #13
baxley
https://codereview.chromium.org/1711953003/diff/40001/ios/ios.gyp File ios/ios.gyp (right): https://codereview.chromium.org/1711953003/diff/40001/ios/ios.gyp#newcode25 ios/ios.gyp:25: 'third_party/ochamcrest/ochamcrest.gyp:*', Do we need this dependency here? Or will ...
4 years, 10 months ago (2016-02-21 06:33:47 UTC) #14
sdefresne
https://codereview.chromium.org/1711953003/diff/40001/ios/chrome/tools/build/ios_generate_forwarding_headers.py File ios/chrome/tools/build/ios_generate_forwarding_headers.py (right): https://codereview.chromium.org/1711953003/diff/40001/ios/chrome/tools/build/ios_generate_forwarding_headers.py#newcode30 ios/chrome/tools/build/ios_generate_forwarding_headers.py:30: forwarding_header = get_output_filename(filename, dest_dir) I would change the code ...
4 years, 10 months ago (2016-02-22 09:09:49 UTC) #16
rohitrao (ping after 24h)
sdefresne, can you take another look? Are you comfortable giving the committer LGTM on this ...
4 years, 10 months ago (2016-02-22 14:49:38 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1711953003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1711953003/60001
4 years, 10 months ago (2016-02-22 14:49:49 UTC) #19
sdefresne
Can you explain why we want to have forwarding-headers? All other libraries that we use ...
4 years, 10 months ago (2016-02-22 15:43:35 UTC) #20
sdefresne
On 2016/02/22 at 15:43:35, sdefresne wrote: > Can you explain why we want to have ...
4 years, 10 months ago (2016-02-22 15:45:43 UTC) #21
sdefresne
4 years, 10 months ago (2016-02-22 16:36:49 UTC) #22
OK, I think I understand why we need to process the headers. As discuss outside
of the codereview tool, OCHamcrest files requires to be included as a framework.
I think building a static framework should not be too hard, but as a first step,
I would suggest copying the files instead of creating forwarding headers.

Two reasons for that:
1. copying files is easy to express with gn
2. copying files is semantically closer to what will happen in creating a
framework

I've suggested edits that would result in copying the files, and as a followup
I'll see how we can build a proper framework (to build a static framework, we
would instead just list the files into mac_bundle_resources property if gyp were
to support non-executable/non-loadable module frameworks which is not the case).

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
File ios/chrome/tools/build/ios_generate_forwarding_headers.py (right):

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:1: #!/usr/bin/env
python
Rename to copy_files.py

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:7: import datetime
Remove.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:9: import sys
import shutil

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:11: COPYRIGHT = """//
Copyright {0} The Chromium Authors. All rights reserved.
Remove.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:16: def
filter_header_files(inputs):
Remove.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:22: def
list_inputs(possible_inputs):
Remove.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:25: def
list_outputs(possible_inputs, dest_dir):
s/possible_inputs/inputs/

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:26: outputs = []
outputs = [ get_output_filename(filename, dest_dir) for filename in inputs ]

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:31: def
generate_headers(possible_inputs, dest_dir):
Remove and replace with:

def copy_files(inputs, dest_dir):
  for filename in inputs:
    shutil.copy(filename, dest_dir)

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:45:
parser.add_argument('-i', '--list-inputs', action='store_true',
Remove '-i' argument.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:55: if
args.list_inputs:
Remove.

https://codereview.chromium.org/1711953003/diff/80001/ios/chrome/tools/build/...
ios/chrome/tools/build/ios_generate_forwarding_headers.py:66:
generate_headers(args.filenames, args.dest_dir)
copy_files(args.filenames, args.dest_dir)

https://codereview.chromium.org/1711953003/diff/80001/ios/third_party/ochamcr...
File ios/third_party/ochamcrest/ochamcrest.gyp (right):

https://codereview.chromium.org/1711953003/diff/80001/ios/third_party/ochamcr...
ios/third_party/ochamcrest/ochamcrest.gyp:8: 'ochamcrest_sources': [
split into 'ochamrest_sources' & 'ochamrest_headers', i.e.:

'ochamcrest_headers': [
  'src/Source/Core/HCAssertThat.h',
  'src/Source/Core/HCBaseDescription.h',
  ...
],
'ochamcrest_sources': [
  '<@(ochamrest_headers)',
  'src/Source/Core/HCAssertThat.m',
  'src/Source/Core/HCBaseDescription.m',
],

https://codereview.chromium.org/1711953003/diff/80001/ios/third_party/ochamcr...
ios/third_party/ochamcrest/ochamcrest.gyp:188: 'target_name':
'ochamcrest_forwarding_headers',
I don't think we need the script, but instead we can just copy the files. I
would do the following (note this is assuming that we do not yet have a script
to copy files to a directory):

'actions': [
  {
    'action_name': 'copy headers',
    'variables': {
      'script_path': '../../chrome/tools/build/copy_files.py',
    },
    'inputs': [ '<(script_path)', '<@(ochamcrest_headers)' ]
    'outputs': [ '<!@pymod_do_main(copy_files -o --dest-dir <(output_dir)
<(ochamrest_headers))' ],
    'action': [
      'python',
      '<(script_path)',
      '--dest-dir',
      '<(output_dir)'
      '<@(ochamcrest_headers)',
    ],
  },

Then the equivalent gn code will be (BTW, I recommend also renaming the gyp
target to have the same name):

copy("ochamcrest_copy_headers") {
  inputs = ochamcrest_sources
  outputs = [ "${output_dir}/{{source_file_part}}" ]
}

https://codereview.chromium.org/1711953003/diff/80001/ios/third_party/ochamcr...
ios/third_party/ochamcrest/ochamcrest.gyp:189: 'type': 'none',
You need "'hard_dependency': 1" here otherwise build will be flaky.

Powered by Google App Engine
This is Rietveld 408576698