Removed barcode_tools.gyp and added build_zxing.py

BUG=

Review URL: https://webrtc-codereview.appspot.com/735009

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2615 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
vspasova@webrtc.org
2012-08-15 14:35:40 +00:00
parent 8327c85bf5
commit 28655423fd
6 changed files with 54 additions and 60 deletions

View File

@@ -4,19 +4,10 @@
deps = {
# Used by barcode_tools
"third_party/zxing/core":
"barcode_tools/third_party/zxing/core":
"http://zxing.googlecode.com/svn/trunk/core@2349",
# Used by barcode_tools
"third_party/zxing/javase":
"barcode_tools/third_party/zxing/javase":
"http://zxing.googlecode.com/svn/trunk/javase@2349",
}
hooks = [
{
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
"pattern": ".",
"action": ["python", "src/build/gyp_chromium", "--depth=.",
"barcode_tools.gyp"],
},
]

View File

@@ -0,0 +1,17 @@
This file explains how to set up the Zebra Crossing (Zxing) library in order to
use it in the barcode encoder and decoder tools. Zxing could be found at:
https://code.google.com/p/zxing/
After checkout, the relevant files from Zxing should be in third_party/zxing,
relative to this README.
In order to run barcode_encoder.py and barcode_decoder.py we need to have build
two jar files: zxing/core/core.jar and zxing/javase/javase.jar. In order to
build these we have to have Ant already installed. Building is as simple as
running the build_zxing.py script:
./build_zxing.py,
which should automatically call ant with the respective build files from the
Zxing checkout.
For more information on how to run barcode_encoder.py and barcode_decoder.py
check the documentation in the main functions inside these tools.

View File

@@ -267,7 +267,7 @@ def _main():
options.barcode_width = options.yuv_frame_width
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
zxing_dir = os.path.join(script_dir, '..', 'third_party', 'zxing')
zxing_dir = os.path.join(script_dir, 'third_party', 'zxing')
# Convert the overlaid YUV video into a set of PNG frames.
convert_yuv_to_png_files(options.yuv_file, options.yuv_frame_width,

View File

@@ -327,7 +327,7 @@ def _main():
options.base_frame_width, options.base_frame_height, options.base_yuv)
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
zxing_dir = os.path.join(script_dir, '..', 'third_party', 'zxing')
zxing_dir = os.path.join(script_dir, 'third_party', 'zxing')
# Generate barcodes - will generate them in PNG.
generate_upca_barcodes(number_of_barcodes, options.barcode_width,
options.barcode_height,

View File

@@ -1,47 +0,0 @@
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
'targets': [
{
'target_name': 'zxing',
'message': 'build zxing barcode tool',
'type': 'none',
'actions': [
{
'action_name': 'build_zxing_core',
'inputs': [
'<(DEPTH)/third_party/zxing/core/build.xml',
],
'outputs': [
'<(DEPTH)/third_party/zxing/core/core.jar',
],
'action': [
'ant',
'-buildfile',
'<(DEPTH)/third_party/zxing/core/build.xml',
]
},
{
'action_name': 'build_zxing_javase',
'inputs': [
'<(DEPTH)/third_party/zxing/javase/build.xml',
],
'outputs': [
'<(DEPTH)/third_party/zxing/javase/javase.jar',
],
'action': [
'ant',
'-buildfile',
'<(DEPTH)/third_party/zxing/javase/build.xml',
]
},
],
},
],
}

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import subprocess
import sys
def run_ant_build_command(path_to_ant_build_file):
"""Tries to build the passed build file with ant."""
process = subprocess.Popen([
'ant', '-buildfile', '%s' % path_to_ant_build_file],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, error = process.communicate()
if process.returncode != 0:
print 'Error: ', error
else:
print output
def _main():
run_ant_build_command('third_party/zxing/core/build.xml')
run_ant_build_command('third_party/zxing/javase/build.xml')
return 0
if __name__ == '__main__':
sys.exit(_main())