mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Merge pull request #242 from eseidelGoogle/gn_fix
Fix sky/tools/gn to not crash
This commit is contained in:
commit
6a2f32fbff
@ -72,6 +72,7 @@ def to_gn_args(args):
|
||||
return gn_args
|
||||
|
||||
def parse_args(args):
|
||||
args = args[1:]
|
||||
parser = argparse.ArgumentParser(description='A script run` gn gen`.')
|
||||
|
||||
parser.add_argument('--debug', default=True, action='store_true')
|
||||
@ -95,6 +96,7 @@ def main(argv):
|
||||
command = ['gn', 'gen', '--check']
|
||||
gn_args = to_command_line(to_gn_args(args))
|
||||
out_dir = get_out_dir(args)
|
||||
print "gn gen --check in %s" % out_dir
|
||||
command.append(out_dir)
|
||||
command.append('--args=%s' % ' '.join(gn_args))
|
||||
return subprocess.call(command)
|
||||
|
||||
@ -11,7 +11,7 @@ gn = imp.load_source('gn', os.path.join(SKY_TOOLS, 'gn'))
|
||||
|
||||
class GNTestCase(unittest.TestCase):
|
||||
def _expect_build_dir(self, arg_list, expected_build_dir):
|
||||
args = gn.parse_args(arg_list)
|
||||
args = gn.parse_args(['gn'] + arg_list)
|
||||
self.assertEquals(gn.get_out_dir(args), expected_build_dir)
|
||||
|
||||
def test_get_out_dir(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user