From 21102a67a81c06c94f39087196d3d15a6cb70cb9 Mon Sep 17 00:00:00 2001 From: "dmaclach@chromium.org" Date: Wed, 11 May 2011 03:59:27 +0000 Subject: Build a "real" webapp deliverable and add plugin to it. BUG=NONE TEST=BUILD Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=84843 Review URL: http://codereview.chromium.org/6998009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84923 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/webapp/build-webapp.py | 54 +++++++++++++++++++++++++++ remoting/webapp/me2mom/manifest.json | 13 ------- remoting/webapp/me2mom/manifest.json.template | 16 ++++++++ 3 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 remoting/webapp/build-webapp.py delete mode 100644 remoting/webapp/me2mom/manifest.json create mode 100644 remoting/webapp/me2mom/manifest.json.template (limited to 'remoting/webapp') diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py new file mode 100644 index 0000000..bac6712 --- /dev/null +++ b/remoting/webapp/build-webapp.py @@ -0,0 +1,54 @@ +#!/usr/bin/python +# Copyright (c) 2011 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. + +# Copies the remoting webapp resources and host plugin into a single directory. + +import os +import shutil +import sys + +# Do not copy git and svn files into the build. +IGNORE_PATTERNS = ('.git', '.svn') + +if len(sys.argv) != 4: + print 'Usage: build-webapp.py ' + sys.exit(1) + +resources = sys.argv[1] +plugin = sys.argv[2] +destination = sys.argv[3] + +try: + shutil.rmtree(destination) +except OSError: + if os.path.exists(destination): + raise + else: + pass + +shutil.copytree(resources, + destination, + ignore=shutil.ignore_patterns(*IGNORE_PATTERNS)) +pluginName = os.path.basename(plugin) +newPluginPath = os.path.join(destination, pluginName) + +# On Mac we have a directory +if os.path.isdir(plugin): + shutil.copytree(plugin, + newPluginPath, + ignore=shutil.ignore_patterns(*IGNORE_PATTERNS)) +else: + shutil.copy2(plugin, newPluginPath) + +# Now massage the manifest to the right plugin name +templatePath = os.path.join(destination, 'manifest.json.template') +manifestPath = os.path.join(destination, 'manifest.json') +input = open(templatePath) +output = open(manifestPath, 'w') +for s in input: + output.write(s.replace('HOST_PLUGIN_NAME', pluginName)) +input.close() +output.close() +os.remove(templatePath) diff --git a/remoting/webapp/me2mom/manifest.json b/remoting/webapp/me2mom/manifest.json deleted file mode 100644 index 9fd63edb..0000000 --- a/remoting/webapp/me2mom/manifest.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "Chromoting Me2Mom", - "version": "1.0", - "description": "Me2Mom-style remote support in Chrome.", - "app": { - "launch": { - "local_path": "choice.html" - } - }, - "icons": { - "128": "chromoting128.png" - } -} diff --git a/remoting/webapp/me2mom/manifest.json.template b/remoting/webapp/me2mom/manifest.json.template new file mode 100644 index 0000000..83ecdac --- /dev/null +++ b/remoting/webapp/me2mom/manifest.json.template @@ -0,0 +1,16 @@ +{ + "name": "Remoting Me2Mom", + "version": "1.0", + "description": "Me2Mom-style remote support in Chrome.", + "app": { + "launch": { + "local_path": "choice.html" + } + }, + "icons": { + "128": "chromoting128.png" + } + "plugins": [ + { "path": "HOST_PLUGIN_NAME" }, + ], +} -- cgit v1.1