Navigation Menu

Skip to content

Commit

Permalink
Fix: xcode-ninja should generate Xcode workspace into generator_output
Browse files Browse the repository at this point in the history
The test gyptest-top-all guards against this when run using
TestGypXcodeNinja, i.e.

$ ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

BUG=gyp:442

TEST=Run
    ./gyptest.py -f xcode-ninja test/generator-output/gyptest-top-all.py

Expected to pass (instead of failing with Permission denied: 'prog1.ninja.xcworkspace')

Patch by Tobias Hahn <tobias.hahn@ableton.com>.

R=justincohen@chromium.org, sdefresne@chromium.org

Review URL: https://codereview.chromium.org/421053005

git-svn-id: http://gyp.googlecode.com/svn/trunk@2018 78cadc50-ecff-11dd-a971-7dbc132099af
  • Loading branch information
sdefresne committed Dec 23, 2014
1 parent 4f4c7cb commit f1dc682
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 42 deletions.
7 changes: 5 additions & 2 deletions pylib/gyp/xcode_ninja.py
Expand Up @@ -19,10 +19,13 @@
import xml.sax.saxutils


def _WriteWorkspace(main_gyp, sources_gyp):
def _WriteWorkspace(main_gyp, sources_gyp, params):
""" Create a workspace to wrap main and sources gyp paths. """
(build_file_root, build_file_ext) = os.path.splitext(main_gyp)
workspace_path = build_file_root + '.xcworkspace'
options = params['options']
if options.generator_output:
workspace_path = os.path.join(options.generator_output, workspace_path)
try:
os.makedirs(workspace_path)
except OSError, e:
Expand Down Expand Up @@ -258,5 +261,5 @@ def CreateWrapper(target_list, target_dicts, data, params):
new_data[sources_gyp]['targets'].append(new_data_target)

# Write workspace to file.
_WriteWorkspace(main_gyp, sources_gyp)
_WriteWorkspace(main_gyp, sources_gyp, params)
return (new_target_list, new_target_dicts, new_data)
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-actions.py
Expand Up @@ -13,11 +13,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

# All the generated files should go under 'gypfiles'. The source directory
# ('actions') should be untouched.
test.writable(test.workpath('actions'), False)
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-copies.py
Expand Up @@ -14,11 +14,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('copies'), False)

test.run_gyp('copies.gyp',
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-mac-bundle.py
Expand Up @@ -15,11 +15,6 @@
if sys.platform == 'darwin':
test = TestGyp.TestGyp(formats=[])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

MAC_BUNDLE_DIR = 'mac-bundle'
GYPFILES_DIR = 'gypfiles'
test.writable(test.workpath(MAC_BUNDLE_DIR), False)
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-relocate.py
Expand Up @@ -14,11 +14,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('src'), False)

test.run_gyp('prog1.gyp',
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-rules.py
Expand Up @@ -13,11 +13,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('rules'), False)

test.run_gyp('rules.gyp',
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-subdir2-deep.py
Expand Up @@ -15,11 +15,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('src'), False)

test.writable(test.workpath('src/subdir2/deeper/build'), True)
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-symlink.py
Expand Up @@ -18,11 +18,6 @@
if not hasattr(os, 'symlink'):
test.skip_test('Missing os.symlink -- skipping test.\n')

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('src'), False)

test.writable(test.workpath('src/subdir2/deeper/build'), True)
Expand Down
5 changes: 0 additions & 5 deletions test/generator-output/gyptest-top-all.py
Expand Up @@ -15,11 +15,6 @@
# Android doesn't support --generator-output.
test = TestGyp.TestGyp(formats=['!android'])

# Bug: xcode-ninja doesn't respect --generator-output
# cf. https://code.google.com/p/gyp/issues/detail?id=442
if test.format == 'xcode-ninja':
test.skip_test()

test.writable(test.workpath('src'), False)

test.run_gyp('prog1.gyp',
Expand Down

0 comments on commit f1dc682

Please sign in to comment.