summaryrefslogtreecommitdiffstats
path: root/o3d/samples
diff options
context:
space:
mode:
authorgspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 17:25:00 +0000
committergspencer@google.com <gspencer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-04 17:25:00 +0000
commit37a625a6cefff0972bc95d2add8a797a37dbb3f9 (patch)
tree43e4b5f31e2d44b6a456fee666b3988d4b2f212d /o3d/samples
parente6060447254932d459c6c6fa6061c11a01432c7d (diff)
downloadchromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.zip
chromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.tar.gz
chromium_src-37a625a6cefff0972bc95d2add8a797a37dbb3f9.tar.bz2
This adds in targets for selenium and updated several other problems,
including some problems with the samples and idl generation. Selenium targets launch selenium on all platforms, but the tests don't pass anywhere but Windows yet because the plugin isn't found. I'll work on that next. Review URL: http://codereview.chromium.org/197014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples')
-rw-r--r--o3d/samples/samples.gyp71
-rw-r--r--o3d/samples/samples_gen.py352
2 files changed, 235 insertions, 188 deletions
diff --git a/o3d/samples/samples.gyp b/o3d/samples/samples.gyp
index 27d96f1..7bc7999 100644
--- a/o3d/samples/samples.gyp
+++ b/o3d/samples/samples.gyp
@@ -11,35 +11,66 @@
],
'targets': [
{
- 'target_name': 'split_samples',
+ 'target_name': 'install_samples',
'type': 'none',
- 'rules': [
+ 'copies': [
{
- 'rule_name': 'split_sample',
- 'extension': 'html',
- 'inputs': [
- 'split_samples.py',
- ],
- 'outputs': [
- '<(PRODUCT_DIR)/samples/<(RULE_INPUT_NAME)',
- '<(PRODUCT_DIR)/samples/<(RULE_INPUT_ROOT).js',
- ],
- 'action': ['python', '<@(_inputs)',
- '--products', '<(PRODUCT_DIR)/samples',
- '--samples', '.',
- '<(RULE_INPUT_PATH)',
- ],
+ 'destination': '<(PRODUCT_DIR)/samples',
+ 'files': [
+ '2d.html',
+ 'animated-scene.html',
+ 'animation.html',
+ 'bitmap-draw-image.html',
+ 'billboards.html',
+ 'canvas-texturedraw.html',
+ 'canvas.html',
+ 'convolution.html',
+ 'culling.html',
+ 'customcamera.html',
+ 'displayfps.html',
+ 'error-texture.html',
+ 'generate-texture.html',
+ 'hellocube-colors.html',
+ 'hellocube-textures.html',
+ 'hellocube.html',
+ 'helloworld.html',
+ 'hud-2d-overlay.html',
+ 'instance-override.html',
+ 'instancing.html',
+ 'juggler.html',
+ 'julia.html',
+ 'multiple-clients.html',
+ 'multiple-views.html',
+ 'old-school-shadows.html',
+ 'particles.html',
+ 'phongshading.html',
+ 'picking.html',
+ 'primitives.html',
+ 'procedural-texture.html',
+ 'render-mode.html',
+ 'render-targets.html',
+ 'rotatemodel.html',
+ 'scatter-chart.html',
+ 'shader-test.html',
+ 'simple.html',
+ 'simpletexture.html',
+ 'skinning.html',
+ 'sobel.html',
+ 'stencil_example.html',
+ 'texturesamplers.html',
+ 'tutorial-primitive.html',
+ 'vertex-shader.html',
+ 'vertex-shader-animation.html',
+ 'zsorting.html'
+ ]
},
],
- 'sources': [
- '<!@(python split_samples.py --samples . --find_candidates)',
- ],
},
{
'target_name': 'samples',
'type': 'none',
'dependencies': [
- 'split_samples',
+ 'install_samples',
'<!(python samples_gen.py):build_samples',
],
},
diff --git a/o3d/samples/samples_gen.py b/o3d/samples/samples_gen.py
index 00fe45c..6add64b 100644
--- a/o3d/samples/samples_gen.py
+++ b/o3d/samples/samples_gen.py
@@ -1,168 +1,184 @@
-#!/usr/bin/env python
-# Copyright (c) 2009 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 os.path
-import sys
-
-output_filename = 'samples_gen.gyp'
-try:
- output_file = open(output_filename, "w+")
-except IOError:
- sys.stderr.write('Unable to write to generated gyp file %s\n',
- output_filename)
-
-x_up = '1,0,0'
-y_up = '0,1,0'
-z_up = '0,0,1'
-
-names = {
- x_up : 'x_up',
- y_up : 'y_up',
- z_up : 'z_up',
-}
-
-assets = [
- {'path': 'GoogleIO-2009/convert_assets/background.zip', 'up': y_up},
- {'path': 'GoogleIO-2009/convert_assets/character.zip', 'up': y_up},
- {'path': 'beachdemo/convert_assets/beach-low-poly.dae', 'up': z_up},
- {'path': 'beachdemo/convert_assets/beachdemo.zip', 'up': z_up},
- {'path': 'convert_assets/dome1.zip', 'up': y_up},
- {'path': 'convert_assets/dome2.zip', 'up': y_up},
- {'path': 'convert_assets/dome3.zip', 'up': y_up},
- {'path': 'convert_assets/dome4.zip', 'up': y_up},
- {'path': 'convert_assets/kitty_151_idle_stand05_cff1.zip', 'up': y_up},
- {'path': 'convert_assets/part1.zip', 'up': y_up},
- {'path': 'convert_assets/part2.zip', 'up': y_up},
- {'path': 'convert_assets/part3.zip', 'up': y_up},
- {'path': 'convert_assets/seven_shapes.zip', 'up': y_up},
- {'path': 'convert_assets/stencil_frame.zip', 'up': y_up},
- {'path': 'convert_assets/teapot.zip', 'up': y_up},
- {'path': 'convert_assets/yard.zip', 'up': y_up},
- {'path': 'home-configurators/convert_cbassets/Agra_Rug.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Asimi_Rug.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Camden_Chair.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Elements_Bookshelf.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Ferrara_Rug.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/House_Roofless.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Lounge_Chair.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Lounge_Chaise.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Lounge_Sofa.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Lounge_Storage_Ottoman.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Madison_Dining_Table.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Miles_Side_Chair.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Pullman_Bar_Stool.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Puzzle_TV_Stand.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Stow_Leather_Ottoman.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Tivoli_Dining_Table.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Tivoli_Miles_Dining_Set.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Troy_Chair.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Troy_Ottoman.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Troy_Sofa.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Troy_Storage_Ottoman.kmz', 'up': z_up},
- {'path': 'home-configurators/convert_cbassets/Troy_Twin_Sleeper.kmz', 'up': z_up},
- {'path': 'io/convert_levels/all_actors.kmz', 'up': y_up},
- {'path': 'io/convert_levels/map1.kmz', 'up': y_up},
- {'path': 'simpleviewer/convert_assets/cube.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/bamboo.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/coconuts.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/driftwood.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/island.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/lazy_bridge.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/palm_leaves.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/palm_trees.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/rocks.9.zip', 'up': y_up},
- {'path': 'waterdemo/convert_assets/rocks.zip', 'up': y_up},
-]
-
-output_file.write("""# Copyright (c) 2009 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.
-
-{
- 'variables': {
- 'chromium_code': 1,
- },
- 'includes': [
- '../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'build_samples',
- 'type': 'none',
- 'dependencies': [
- '../converter/converter.gyp:o3dConverter',
- ],
- 'actions': [\n""")
-for asset in assets:
- filename = os.path.splitext(os.path.basename(asset['path']))[0]
- filename = filename.replace('.','_')
- filename = filename.replace('-','_')
- filename = filename.lower()
- name = "convert_" + filename
- output = asset['path'].replace('convert_', '')
- output = os.path.splitext(output)[0] + ".o3dtgz"
- output_dir = os.path.dirname(output)
- output_file.write(" {\n")
- output_file.write(" 'action_name': '%s',\n" % name)
- output_file.write(" 'inputs': [\n")
- output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
- output_file.write(" ],\n")
- output_file.write(" 'outputs': [\n")
- output_file.write(" '../samples/%s',\n" % output)
- output_file.write(" ],\n")
- output_file.write(" 'action': [\n")
- output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n")
- output_file.write(" '--no-condition',\n")
- output_file.write(" '--up-axis=%s',\n" % asset['up'])
- output_file.write(" '<(_inputs)',\n")
- output_file.write(" '<(_outputs)',\n")
- output_file.write(" ],\n")
- output_file.write(" },\n")
-
-output_file.write(" ],\n")
-
-# Coalesce copies by directory so we don't have tons of copies rules
-# to parse.
-copies = {}
-for asset in assets:
- output = asset['path'].replace('convert_', '')
- output = os.path.splitext(output)[0] + ".o3dtgz"
- output_dir = os.path.dirname(output)
- if output_dir in copies:
- # Make sure we don't add any twice.
- if not output in copies[output_dir]:
- copies[output_dir] += [output]
- else:
- copies[output_dir] = [output]
-
-# Add in all the MANIFEST files to be copied,
-# Skipping the ones in the assets above (if any).
-manifest = open("MANIFEST", "r")
-for item in manifest.read().splitlines():
- item_dir = os.path.dirname(item)
- if item_dir in copies:
- if not item in copies[item_dir]:
- copies[item_dir] += [item]
- else:
- copies[item_dir] = [item]
-
-output_file.write(" 'copies': [\n")
-for (dir, paths) in copies.items():
- output_file.write(" {\n")
- output_file.write(" 'destination': " \
- "'<(PRODUCT_DIR)/samples/%s',\n" % dir)
- output_file.write(" 'files': [\n")
- for path in paths:
- output_file.write(" '../samples/%s',\n" % path)
- output_file.write(" ],\n")
- output_file.write(" },\n")
-
-output_file.write(" ],\n")
-output_file.write(" },\n")
-output_file.write(" ],\n")
-output_file.write("}\n")
-
-print output_filename
-sys.exit(0)
+#!/usr/bin/env python
+# Copyright (c) 2009 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 posixpath
+import sys
+
+output_filename = 'samples_gen.gyp'
+try:
+ output_file = open(output_filename, "w+")
+except IOError:
+ sys.stderr.write('Unable to write to generated gyp file %s\n',
+ output_filename)
+
+x_up = '1,0,0'
+y_up = '0,1,0'
+z_up = '0,0,1'
+
+names = {
+ x_up : 'x_up',
+ y_up : 'y_up',
+ z_up : 'z_up',
+}
+
+assets = [
+ {'path': 'GoogleIO-2009/convert_assets/background.zip', 'up': y_up},
+ {'path': 'GoogleIO-2009/convert_assets/character.zip', 'up': y_up},
+ {'path': 'beachdemo/convert_assets/beach-low-poly.dae', 'up': z_up},
+ {'path': 'beachdemo/convert_assets/beachdemo.zip', 'up': z_up},
+ {'path': 'convert_assets/dome1.zip', 'up': y_up},
+ {'path': 'convert_assets/dome2.zip', 'up': y_up},
+ {'path': 'convert_assets/dome3.zip', 'up': y_up},
+ {'path': 'convert_assets/dome4.zip', 'up': y_up},
+ {'path': 'convert_assets/kitty_151_idle_stand05_cff1.zip', 'up': y_up},
+ {'path': 'convert_assets/part1.zip', 'up': y_up},
+ {'path': 'convert_assets/part2.zip', 'up': y_up},
+ {'path': 'convert_assets/part3.zip', 'up': y_up},
+ {'path': 'convert_assets/seven_shapes.zip', 'up': y_up},
+ {'path': 'convert_assets/stencil_frame.zip', 'up': y_up},
+ {'path': 'convert_assets/teapot.zip', 'up': y_up},
+ {'path': 'convert_assets/yard.zip', 'up': y_up},
+ {'path': 'home-configurators/convert_cbassets/Agra_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Asimi_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Camden_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Elements_Bookshelf.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Ferrara_Rug.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/House_Roofless.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Chaise.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Sofa.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Lounge_Storage_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Madison_Dining_Table.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Miles_Side_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Pullman_Bar_Stool.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Puzzle_TV_Stand.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Stow_Leather_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Tivoli_Dining_Table.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Tivoli_Miles_Dining_Set.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Chair.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Sofa.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Storage_Ottoman.kmz', 'up': z_up},
+ {'path': 'home-configurators/convert_cbassets/Troy_Twin_Sleeper.kmz', 'up': z_up},
+ {'path': 'io/convert_levels/all_actors.kmz', 'up': y_up},
+ {'path': 'io/convert_levels/map1.kmz', 'up': y_up},
+ {'path': 'simpleviewer/convert_assets/cube.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/bamboo.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/coconuts.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/driftwood.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/island.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/lazy_bridge.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/palm_leaves.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/palm_trees.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/rocks.9.zip', 'up': y_up},
+ {'path': 'waterdemo/convert_assets/rocks.zip', 'up': y_up},
+]
+
+output_file.write("""# Copyright (c) 2009 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.
+
+{
+ 'variables': {
+ 'chromium_code': 1,
+ },
+ 'includes': [
+ '../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'build_samples',
+ 'type': 'none',
+ 'dependencies': [
+ '../converter/converter.gyp:o3dConverter',
+ ],
+ 'actions': [\n""")
+for asset in assets:
+ filename = posixpath.splitext(posixpath.basename(asset['path']))[0]
+ filename = filename.replace('.','_')
+ filename = filename.replace('-','_')
+ filename = filename.lower()
+ name = "convert_" + filename
+ output = asset['path'].replace('convert_', '')
+ output = posixpath.splitext(output)[0] + ".o3dtgz"
+ output_dir = posixpath.dirname(output)
+ output_file.write(" {\n")
+ output_file.write(" 'action_name': '%s',\n" % name)
+ output_file.write(" 'inputs': [\n")
+ output_file.write(" '../o3d_assets/samples/%s',\n" % asset['path'])
+ output_file.write(" ],\n")
+ output_file.write(" 'outputs': [\n")
+ if sys.platform[:5] == 'linux':
+ # TODO(gspencer): This is a HACK! We shouldn't need to put the
+ # absolute path here, but currently on Linux (scons), it is unable
+ # to copy generated items out of the source tree (because the
+ # repository mojo fails to find it and puts in the wrong path).
+ output_file.write(" '%s',\n" % posixpath.abspath(output))
+ else:
+ output_file.write(" '../samples/%s',\n" % output)
+ output_file.write(" ],\n")
+ output_file.write(" 'action': [\n")
+ if sys.platform[:5] == 'linux':
+ output_file.write(" 'LD_LIBRARY_PATH=<(PRODUCT_DIR):<(PRODUCT_DIR)/lib',\n")
+ output_file.write(" '<(PRODUCT_DIR)/o3dConverter',\n")
+ output_file.write(" '--no-condition',\n")
+ output_file.write(" '--up-axis=%s',\n" % asset['up'])
+ output_file.write(" '<(_inputs)',\n")
+ output_file.write(" '<(_outputs)',\n")
+ output_file.write(" ],\n")
+ output_file.write(" },\n")
+
+output_file.write(" ],\n")
+
+# Coalesce copies by directory so we don't have tons of copies rules
+# to parse.
+copies = {}
+for asset in assets:
+ output = asset['path'].replace('convert_', '')
+ output = posixpath.splitext(output)[0] + ".o3dtgz"
+ output_dir = posixpath.dirname(output)
+ if output_dir in copies:
+ # Make sure we don't add any twice.
+ if not output in copies[output_dir]:
+ copies[output_dir] += [output]
+ else:
+ copies[output_dir] = [output]
+
+# Add in all the MANIFEST files to be copied,
+# Skipping the ones in the assets above (if any).
+manifest = open("MANIFEST", "r")
+for item in manifest.read().splitlines():
+ item_dir = posixpath.dirname(item)
+ if item_dir in copies:
+ if not item in copies[item_dir]:
+ copies[item_dir] += [item]
+ else:
+ copies[item_dir] = [item]
+
+output_file.write(" 'copies': [\n")
+for (dir, paths) in copies.items():
+ output_file.write(" {\n")
+ output_file.write(" 'destination': " \
+ "'<(PRODUCT_DIR)/samples/%s',\n" % dir)
+ output_file.write(" 'files': [\n")
+ for path in paths:
+ if sys.platform[:5] == 'linux':
+ # TODO(gspencer): This is a HACK! We shouldn't need to put the
+ # absolute path here, but currently on Linux (scons), it is unable
+ # to copy generated items out of the source tree (because the
+ # repository mojo fails to find it and puts in the wrong path).
+ output_file.write(" '%s',\n" % posixpath.abspath(path))
+ else:
+ output_file.write(" '../samples/%s',\n" % path)
+ output_file.write(" ],\n")
+ output_file.write(" },\n")
+
+output_file.write(" ],\n")
+output_file.write(" },\n")
+output_file.write(" ],\n")
+output_file.write("}\n")
+
+print output_filename
+sys.exit(0)