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

Unified Diff: remoting/webapp/build-webapp.py

Issue 1191883002: Revert of [AppRemoting] Break out AppRemoting shared module (re-land). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/base/js/plugin_settings.js ('k') | remoting/webapp/build_template.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/build-webapp.py
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index 4a705e706605d146f5a42cc6fc1a4a039497f356..7eb66b6e2e5683e1f71e858dda16acb8efa9e8de 100755
--- a/remoting/webapp/build-webapp.py
+++ b/remoting/webapp/build-webapp.py
@@ -120,9 +120,7 @@
zipfile: A string with path to the zipfile to create containing the
contents of |destination|.
manifest_template: jinja2 template file for manifest.
- webapp_type: webapp type:
- For DesktopRemoting: "v1", "v2" or "v2_pnacl"
- For AppRemoting: "app_remoting" or "shared_module"
+ webapp_type: webapp type ("v1", "v2", "v2_pnacl" or "app_remoting").
appid: A string with the Remoting Application Id (only used for app
remoting webapps). If supplied, it defaults to using the
test API server.
@@ -214,20 +212,11 @@
else:
raise Exception('Unknown extension: ' + current_locale)
- is_app_remoting_webapp = webapp_type == 'app_remoting'
- is_app_remoting_shared_module = webapp_type == 'shared_module'
- is_app_remoting = is_app_remoting_webapp or is_app_remoting_shared_module
- is_prod_service_environment = service_environment == 'vendor' or \
- service_environment == 'prod' or \
- service_environment == 'prod-testing'
- is_desktop_remoting = not is_app_remoting
-
# Set client plugin type.
# TODO(wez): Use 'native' in app_remoting until b/17441659 is resolved.
- if not is_app_remoting_webapp:
- client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native'
- findAndReplace(os.path.join(destination, 'plugin_settings.js'),
- "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'")
+ client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native'
+ findAndReplace(os.path.join(destination, 'plugin_settings.js'),
+ "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'")
# Allow host names for google services/apis to be overriden via env vars.
oauth2AccountsHost = os.environ.get(
@@ -237,7 +226,11 @@
directoryApiHost = os.environ.get(
'DIRECTORY_API_HOST', 'https://www.googleapis.com')
- if is_app_remoting:
+ is_app_remoting_webapp = webapp_type == 'app_remoting'
+ is_prod_service_environment = service_environment == 'vendor' or \
+ service_environment == 'prod' or \
+ service_environment == 'prod-testing'
+ if is_app_remoting_webapp:
appRemotingApiHost = os.environ.get(
'APP_REMOTING_API_HOST', None)
appRemotingApplicationId = os.environ.get(
@@ -267,20 +260,19 @@
# If an Application ID was set (either from service_environment variable or
# from a command line argument), hardcode it, otherwise get it at runtime.
- if is_app_remoting_webapp:
- effectiveAppId = appRemotingApplicationId or appid
- if effectiveAppId:
- appRemotingApplicationId = "'" + effectiveAppId + "'"
- else:
- appRemotingApplicationId = "chrome.i18n.getMessage('@@extension_id')"
- findAndReplace(os.path.join(destination, 'arv_main.js'),
- "'APP_REMOTING_APPLICATION_ID'", appRemotingApplicationId)
+ effectiveAppId = appRemotingApplicationId or appid
+ if effectiveAppId:
+ appRemotingApplicationId = "'" + effectiveAppId + "'"
+ else:
+ appRemotingApplicationId = "chrome.i18n.getMessage('@@extension_id')"
+ findAndReplace(os.path.join(destination, 'plugin_settings.js'),
+ "'APP_REMOTING_APPLICATION_ID'", appRemotingApplicationId)
oauth2BaseUrl = oauth2AccountsHost + '/o/oauth2'
oauth2ApiBaseUrl = oauth2ApiHost + '/oauth2'
directoryApiBaseUrl = directoryApiHost + '/chromoting/v1'
- if is_app_remoting:
+ if is_app_remoting_webapp:
# Set the apiary endpoint and then set the endpoint version
if not appRemotingApiHost:
if is_prod_service_environment:
@@ -288,11 +280,7 @@
else:
appRemotingApiHost = 'https://www-googleapis-test.sandbox.google.com'
- # TODO(garykac) Currently, the shared module is always set up for the
- # dev service_environment. Update build so that the dev environment can
- # be controlled by the app stub rather than hard-coded into the shared
- # module.
- if service_environment == 'dev' or is_app_remoting_shared_module:
+ if service_environment == 'dev':
appRemotingServicePath = '/appremoting/v1beta1_dev'
elif service_environment == 'test':
appRemotingServicePath = '/appremoting/v1beta1'
@@ -310,17 +298,13 @@
else:
appRemotingApiBaseUrl = ''
- # TODO(garykac) replaceString (et al.) implictly update plugin_settings.js,
- # which doesn't exist for the app stub. We need to move app-specific
- # AppRemoting options into arv_main.js.
- if not is_app_remoting_webapp:
- replaceBool(destination, 'USE_GCD', use_gcd)
- replaceString(destination, 'OAUTH2_BASE_URL', oauth2BaseUrl)
- replaceString(destination, 'OAUTH2_API_BASE_URL', oauth2ApiBaseUrl)
- replaceString(destination, 'DIRECTORY_API_BASE_URL', directoryApiBaseUrl)
- if is_app_remoting:
- replaceString(destination, 'APP_REMOTING_API_BASE_URL',
- appRemotingApiBaseUrl)
+ replaceBool(destination, 'USE_GCD', use_gcd)
+ replaceString(destination, 'OAUTH2_BASE_URL', oauth2BaseUrl)
+ replaceString(destination, 'OAUTH2_API_BASE_URL', oauth2ApiBaseUrl)
+ replaceString(destination, 'DIRECTORY_API_BASE_URL', directoryApiBaseUrl)
+ if is_app_remoting_webapp:
+ replaceString(destination, 'APP_REMOTING_API_BASE_URL',
+ appRemotingApiBaseUrl)
# Substitute hosts in the manifest's CSP list.
# Ensure we list the API host only once if it's the same for multiple APIs.
@@ -358,23 +342,21 @@
oauth2RedirectUrlJson = oauth2RedirectBaseUrlJson + '/dev*'
thirdPartyAuthUrlJs = oauth2RedirectBaseUrlJs + '/thirdpartyauth'
thirdPartyAuthUrlJson = oauth2RedirectBaseUrlJson + '/thirdpartyauth*'
+ replaceString(destination, 'TALK_GADGET_URL', talkGadgetBaseUrl)
+ findAndReplace(os.path.join(destination, 'plugin_settings.js'),
+ "'OAUTH2_REDIRECT_URL'", oauth2RedirectUrlJs)
+
+ # Configure xmpp server and directory bot settings in the plugin.
+ replaceBool(
+ destination, 'XMPP_SERVER_USE_TLS',
+ getenvBool('XMPP_SERVER_USE_TLS', True))
xmppServer = os.environ.get('XMPP_SERVER', 'talk.google.com:443')
-
- if not is_app_remoting_webapp:
- replaceString(destination, 'TALK_GADGET_URL', talkGadgetBaseUrl)
- findAndReplace(os.path.join(destination, 'plugin_settings.js'),
- "'OAUTH2_REDIRECT_URL'", oauth2RedirectUrlJs)
-
- # Configure xmpp server and directory bot settings in the plugin.
- replaceBool(
- destination, 'XMPP_SERVER_USE_TLS',
- getenvBool('XMPP_SERVER_USE_TLS', True))
- replaceString(destination, 'XMPP_SERVER', xmppServer)
- replaceString(destination, 'DIRECTORY_BOT_JID',
- os.environ.get('DIRECTORY_BOT_JID',
- 'remoting@bot.talk.google.com'))
- replaceString(destination, 'THIRD_PARTY_AUTH_REDIRECT_URL',
- thirdPartyAuthUrlJs)
+ replaceString(destination, 'XMPP_SERVER', xmppServer)
+ replaceString(destination, 'DIRECTORY_BOT_JID',
+ os.environ.get('DIRECTORY_BOT_JID',
+ 'remoting@bot.talk.google.com'))
+ replaceString(destination, 'THIRD_PARTY_AUTH_REDIRECT_URL',
+ thirdPartyAuthUrlJs)
# Set the correct API keys.
# For overriding the client ID/secret via env vars, see google_api_keys.py.
@@ -390,17 +372,15 @@
else:
apiClientIdV2 = google_api_keys.GetClientID('REMOTING_IDENTITY_API')
- if not is_app_remoting_webapp:
- replaceString(destination, 'API_CLIENT_ID', apiClientId)
- replaceString(destination, 'API_CLIENT_SECRET', apiClientSecret)
- replaceString(destination, 'API_KEY', apiKey)
+ replaceString(destination, 'API_CLIENT_ID', apiClientId)
+ replaceString(destination, 'API_CLIENT_SECRET', apiClientSecret)
+ replaceString(destination, 'API_KEY', apiKey)
# Write the application capabilities.
- if is_app_remoting_webapp:
- appCapabilities = ','.join(
- ['remoting.ClientSession.Capability.' + x for x in app_capabilities])
- findAndReplace(os.path.join(destination, 'arv_main.js'),
- "'APPLICATION_CAPABILITIES'", appCapabilities)
+ appCapabilities = ','.join(
+ ['remoting.ClientSession.Capability.' + x for x in app_capabilities])
+ findAndReplace(os.path.join(destination, 'app_capabilities.js'),
+ "'APPLICATION_CAPABILITIES'", appCapabilities)
# Use a consistent extension id for dev builds.
# AppRemoting builds always use the dev app id - the correct app id gets
« no previous file with comments | « remoting/webapp/base/js/plugin_settings.js ('k') | remoting/webapp/build_template.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698