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

Unified Diff: dart/tools/create_editor.py

Issue 12391030: Revert revision 19289 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 10 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 | « dart/editor/build/.gitignore ('k') | deps/all.deps/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/create_editor.py
===================================================================
--- dart/tools/create_editor.py (revision 19289)
+++ dart/tools/create_editor.py (working copy)
@@ -5,12 +5,11 @@
# BSD-style license that can be found in the LICENSE file.
#
# A script which will be invoked from gyp to create a build of the editor.
-#
-# Usage: ./tools/create_editor.py
-# [--mode <mode>] [--arch <arch>] [--out <output>] [--build <build>]
-#
-# DO NOT CALL THIS SCRIPT DIRECTLY, instead invoke:
-# ./tools/build.py -mrelease editor
+#
+# TODO(devoncarew): currently this script is not callable from tools/build.py
+# Usage: ./tools/build.py editor
+# -or-
+# Usage: ./tools/build_editor.py [--mode <mode>] [--arch <arch>] output
import glob
import optparse
@@ -24,7 +23,6 @@
from os.path import join
OUTPUT = None
-BUILD = None
OS_CONFIG = {
'win32': 'win32, win32',
@@ -63,15 +61,19 @@
def GetEditorTemp():
- return join(BUILD, 'editor.build.temp')
+ return join(GetBuildRoot(), 'editor.build.temp')
def GetDownloadCache():
return GetEclipseBuildRoot()
+def GetBuildRoot():
+ return os.path.abspath(utils.GetBuildRoot(utils.GuessOS()))
+
+
def GetEclipseBuildRoot():
- return join(BUILD, 'editor.build.cache')
+ return join(GetBuildRoot(), 'editor.build.cache')
def GetSdkPath():
@@ -84,42 +86,35 @@
def BuildOptions():
options = optparse.OptionParser(usage='usage: %prog [options] <output>')
- options.add_option("-m", "--mode", metavar='[debug,release]')
- options.add_option("-a", "--arch", metavar='[ia32,x64]')
- options.add_option("-o", "--out")
- options.add_option("-b", "--build")
+ options.add_option("-m", "--mode",
+ help='Build variant',
+ metavar='[debug,release]')
+ options.add_option("-a", "--arch",
+ help='Target architecture',
+ metavar='[ia32,x64]')
return options
-
+
def Main():
global OUTPUT
- global BUILD
-
+
parser = BuildOptions()
(options, args) = parser.parse_args()
-
- if args:
+
+ if len(args) > 1:
parser.print_help()
return 1
-
+
osName = utils.GuessOS()
mode = 'debug'
arch = utils.GuessArchitecture()
-
- if not options.build:
- print >> sys.stderr, 'Error: no --build option specified'
- exit(1)
- else:
- BUILD = options.build
-
- if not options.out:
- print >> sys.stderr, 'Error: no --out option specified'
- exit(1)
- else:
+
+ if args:
# TODO(devoncarew): Currently we scrape the output path to determine the
# mode and arch. This is fragile and should moved into one location
# (utils.py?) or made more explicit.
- OUTPUT = options.out
+ OUTPUT = args[0]
+
mode = ('release', 'debug')['Debug' in OUTPUT]
arch = ('ia32', 'x64')['X64' in OUTPUT]
@@ -129,15 +124,18 @@
if options.arch:
arch = options.arch
+ # If an output dir was not given, create one from os, mode, and arch.
+ if not OUTPUT:
+ OUTPUT = join(utils.GetBuildRoot(osName, mode, arch), 'editor')
+
OUTPUT = os.path.abspath(OUTPUT)
- BUILD = os.path.abspath(BUILD)
-
+
print "\nBuilding the editor"
print " config : %s, %s, %s" % (osName, arch, mode)
print " output : %s" % OUTPUT
# Clean the editor output directory.
- print '\ncleaning %s' % OUTPUT
+ print ' cleaning %s' % OUTPUT
shutil.rmtree(OUTPUT, True)
# These are the valid eclipse build configurations that we can produce.
@@ -153,10 +151,12 @@
sys.stdout.flush()
sys.stderr.flush()
- buildScript = join('editor', 'tools', 'features',
- 'com.google.dart.tools.deploy.feature_releng',
+ buildScript = join('editor', 'tools', 'features',
+ 'com.google.dart.tools.deploy.feature_releng',
'build_rcp.xml')
- build_cmd = [AntPath(),
+
+ buildRcpStatus = subprocess.call(
+ [AntPath(),
'-lib',
join('third_party', 'bzip2', 'bzip2.jar'),
'-Dbuild.out=' + OUTPUT,
@@ -169,9 +169,8 @@
'-Dbuild.dart.sdk=' + GetSdkPath(),
'-Dbuild.no.properties=true',
'-buildfile',
- buildScript]
- print build_cmd
- buildRcpStatus = subprocess.call(build_cmd, shell=utils.IsWindows())
+ buildScript],
+ shell=utils.IsWindows())
if buildRcpStatus != 0:
sys.exit(buildRcpStatus)
@@ -181,7 +180,7 @@
# dart/ subdirectory. We unzip the contents of the archive into OUTPUT. It
# will use the ../dart-sdk directory as its SDK.
archives = glob.glob(join(OUTPUT, '*.zip'))
-
+
if archives:
ProcessEditorArchive(archives[0], OUTPUT)
« no previous file with comments | « dart/editor/build/.gitignore ('k') | deps/all.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698