Commit b2eb2951 authored by Joe Downing's avatar Joe Downing Committed by Commit Bot

Cleaning up some more webapp / gcd removal crumbs

Change-Id: Ic6a900d974a9f49493dea88238be77ac5324442e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954325
Commit-Queue: Jamie Walch <jamiewalch@chromium.org>
Auto-Submit: Joe Downing <joedow@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722530}
parent 5536cc66
......@@ -9,18 +9,6 @@ enable_remoting_host =
is_win || (is_linux && (is_chromeos || use_x11)) || is_mac
enable_me2me_host = is_win || (is_linux && !is_chromeos && use_x11) || is_mac
# These arguments can be overridden from the command line (see "gn help args").
declare_args() {
# Set this to run the jscompile checks after building the webapp.
enable_remoting_jscompile = false
# Set this to enable building internal AppRemoting apps.
enable_internal_app_remoting_targets = false
}
# Set this to use GCD instead of the remoting directory service.
remoting_use_gcd = 0
# Enable the multi-process host on Windows by default.
if (is_win) {
remoting_multi_process = 1
......@@ -36,14 +24,4 @@ if (is_chrome_branded) {
branding_path = "//remoting/branding_Chromium"
}
# The ar_service_environment variable is used to define the target
# environment for the app being built.
# The allowed values are dev and prod.
if (is_debug) {
ar_service_environment = "dev"
} else {
# Non-dev builds should default to 'prod'.
ar_service_environment = "prod"
}
rdp_desktop_session_guid = "6a7699f0-ee43-43e7-aa30-a6738f9bd470"
#!/usr/bin/python
# Copyright 2015 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.
import argparse
import json
import sys
DESCRIPTION = '''This tools reads in a GYP file, parses it as JSON, grabs the
requested object(s) using the passed in |key_name| and |key_value| and then
builds up a space delimited string using the |return_key| given. The built
up string is then output to STDOUT which can be read and tokenized in
bash or python scripts.'''
FILE_HELP = '''The GYP file to parse'''
APP_KEY_NAME_HELP = '''Key name used to identify relevant webapp details'''
APP_KEY_VALUE_HELP = '''Key value used to identify relevant webapp details,
multiple values can be passed in'''
TARGET_KEY_VALUE_HELP = '''The key name used to output the targeted value'''
DEBUG_HELP = '''Turns on verbose debugging output'''
# Cleans up the text in the passed in GYP file, updates it to make it valid JSON
# and returns the valid json string.
def gyp_file_to_json_string(gyp_file):
# First, read in each line and discard comments and whitespace.
line_data = ''
for line in gyp_file:
lines = line.split("#")
line_data += lines[0].strip()
# Trailing commas are valid in GYP files but invalid in JSON, so remove them
# here. Also convert double quotes to single quotes and those throw off the
# python json parser.
line_data = line_data.replace(',}', '}')
line_data = line_data.replace(',]', ']')
line_data = line_data.replace('\'', '\"')
return line_data
# Finds the matching app detail sections in |data| and generates a space
# delimited string with the |return_key|'s value. If we found at least one
# matching app and created a string, we output it to STDOUT.
def print_details(data, key_name, key_values, target_key):
output_string = ''
for target in data['targets']:
if target[key_name] in key_values:
if output_string:
output_string += " " + target[target_key]
else:
output_string += target[target_key]
if output_string:
print output_string
def main():
parser = argparse.ArgumentParser(description = DESCRIPTION)
parser.add_argument('file', nargs = '+', help = FILE_HELP)
parser.add_argument('-k', '--key_name', help = APP_KEY_NAME_HELP,
nargs = '?', required=True)
parser.add_argument('-v', '--key_value', help = APP_KEY_VALUE_HELP,
nargs = '+', required=True)
parser.add_argument('-t', '--target_key', help = TARGET_KEY_VALUE_HELP,
nargs = '?', required=True)
parser.add_argument('-d', '--debug', help = DEBUG_HELP,
action='store_true')
options = parser.parse_args()
if options.debug:
print 'Reading from file \"' + options.file[0] + '\"'
gyp_file = open(options.file[0])
json_string = gyp_file_to_json_string(gyp_file)
json_object = json.loads(json_string)
if options.debug:
print 'The following app details were found:'
for target in json_object['targets']:
print target['target_name'], target['app_id'], target['app_name']
print_details(json_object,
options.key_name,
options.key_value,
options.target_key)
return 0
if __name__ == '__main__':
sys.exit(main())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment