Include shared_library and mpd_generator in ci and releases

Change-Id: Ie9449cbca711324831cb15e83d0efaf7a43cf9ef
This commit is contained in:
KongQun Yang 2017-12-11 14:06:50 -08:00
parent feb7951f33
commit 2d025dae2d
5 changed files with 55 additions and 18 deletions

View File

@ -5,8 +5,10 @@ os:
- osx - osx
env: env:
- BUILD_TYPE=Debug - BUILD_TYPE=Debug LIBPACKAGER_TYPE=static_library
- BUILD_TYPE=Release - BUILD_TYPE=Debug LIBPACKAGER_TYPE=shared_library
- BUILD_TYPE=Release LIBPACKAGER_TYPE=static_library
- BUILD_TYPE=Release LIBPACKAGER_TYPE=shared_library
before_install: before_install:
- test -n $CC && unset CC - test -n $CC && unset CC
@ -21,22 +23,39 @@ before_script:
- shopt -s extglob dotglob - shopt -s extglob dotglob
- mv !(src) src - mv !(src) src
- gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged - gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged
- export GYP_DEFINES="libpackager_type=${LIBPACKAGER_TYPE}"
- gclient sync - gclient sync
- cd src - cd src
- ninja -C out/${BUILD_TYPE} -k 100 - ninja -C out/${BUILD_TYPE} -k 100
script: script:
- if [ ${LIBPACKAGER_TYPE} == "shared_library" ] && [ ${TRAVIS_OS_NAME} == "osx" ]; then
export DYLD_FALLBACK_LIBRARY_PATH=./out/${BUILD_TYPE};
fi
- ( find out/${BUILD_TYPE} -name "*_*test" | while read i ; do $i || exit ; done ) - ( find out/${BUILD_TYPE} -name "*_*test" | while read i ; do $i || exit ; done )
- out/${BUILD_TYPE}/packager_test.py -v - out/${BUILD_TYPE}/packager_test.py -v --libpackager_type=${LIBPACKAGER_TYPE}
before_deploy: before_deploy:
- mv out/${BUILD_TYPE}/packager out/${BUILD_TYPE}/packager-${TRAVIS_OS_NAME} - rm -rf deploy
- mkdir deploy
- |
if [ ${LIBPACKAGER_TYPE} == "shared_library" ]; then
if [ ${TRAVIS_OS_NAME} == "linux" ]; then
mv out/${BUILD_TYPE}/lib/libpackager.so deploy/libpackager-${TRAVIS_OS_NAME}.so
else
mv out/${BUILD_TYPE}/libpackager.dylib deploy/libpackager-${TRAVIS_OS_NAME}.dylib
fi
else
mv out/${BUILD_TYPE}/packager deploy/packager-${TRAVIS_OS_NAME}
mv out/${BUILD_TYPE}/mpd_generator deploy/mpd_generator-${TRAVIS_OS_NAME}
fi
deploy: deploy:
provider: releases provider: releases
api_key: api_key:
secure: PbhquzRnY1BkGkM/6LmVSZjhUd8jWnj77QjxAKA8REnFhbAuzqwDYuytRmUsBFMtgatUEgTuh/1duZaIl0yXGvRZdNeGk7BgtguUy6vraWObjjNUSlQ6Njm4y/hMgaUIOhA9I2b8gokWU1PA0sDJOF/FoZaAxFpKXcW4d8Z2C0s= secure: PbhquzRnY1BkGkM/6LmVSZjhUd8jWnj77QjxAKA8REnFhbAuzqwDYuytRmUsBFMtgatUEgTuh/1duZaIl0yXGvRZdNeGk7BgtguUy6vraWObjjNUSlQ6Njm4y/hMgaUIOhA9I2b8gokWU1PA0sDJOF/FoZaAxFpKXcW4d8Z2C0s=
file: out/${BUILD_TYPE}/packager-${TRAVIS_OS_NAME} file_glob: true
file: deploy/*
skip_cleanup: true skip_cleanup: true
on: on:
tags: true tags: true

View File

@ -9,6 +9,9 @@ configuration:
environment: environment:
matrix: matrix:
- language: cpp - language: cpp
libpackager_type: static_library
- language: cpp
libpackager_type: shared_library
clone_folder: c:\projects\shaka-packager\src clone_folder: c:\projects\shaka-packager\src
@ -18,7 +21,7 @@ install:
before_build: before_build:
- cd .. - cd ..
- depot_tools\gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged - depot_tools\gclient config https://github.com/google/shaka-packager.git --name=src --unmanaged
- set GYP_DEFINES='target_arch="%PLATFORM%"' - set GYP_DEFINES="target_arch=%PLATFORM% libpackager_type=%LIBPACKAGER_TYPE%"
- depot_tools\gclient sync - depot_tools\gclient sync
- if [%PLATFORM%] == [x64] ( - if [%PLATFORM%] == [x64] (
set "output_directory=%CONFIGURATION%_x64" set "output_directory=%CONFIGURATION%_x64"
@ -29,14 +32,25 @@ before_build:
build_script: build_script:
- cd src - cd src
- ..\depot_tools\ninja -C "out\%OUTPUT_DIRECTORY%" -k 100 - ..\depot_tools\ninja -C "out\%OUTPUT_DIRECTORY%" -k 100
- copy "out\%OUTPUT_DIRECTORY%\packager.exe" packager-win.exe
test_script: test_script:
- for %%f in ("out\%OUTPUT_DIRECTORY%\*_*test.exe") do (%%f || exit /b 666) - for %%f in ("out\%OUTPUT_DIRECTORY%\*_*test.exe") do (%%f || exit /b 666)
- python "out\%OUTPUT_DIRECTORY%\packager_test.py" -v - python "out\%OUTPUT_DIRECTORY%\packager_test.py" -v --libpackager_type="%LIBPACKAGER_TYPE%"
after_build:
- if exist deploy rmdir /s /q deploy
- mkdir deploy
- if [%LIBPACKAGER_TYPE%] == ["shared_library"] (
copy "out\%OUTPUT_DIRECTORY%\packager.dll" deploy\packager-win.dll
) else (
copy "out\%OUTPUT_DIRECTORY%\packager.exe" deploy\packager-win.exe
)
- if NOT [%LIBPACKAGER_TYPE%] == ["shared_library"] (
copy "out\%OUTPUT_DIRECTORY%\mpd_generator.exe" deploy\mpd_generator-win.exe
)
artifacts: artifacts:
- path: packager-win.exe - path: 'deploy\*'
deploy: deploy:
provider: GitHub provider: GitHub

View File

@ -28,13 +28,21 @@ class PackagerApp(object):
assert os.path.exists(self.binary), ('Please run from output directory, ' assert os.path.exists(self.binary), ('Please run from output directory, '
'e.g. out/Debug/packager_test.py') 'e.g. out/Debug/packager_test.py')
def GetEnv(self):
env = os.environ.copy()
if (platform.system() == 'Darwin' and
test_env.options.libpackager_type == 'shared_library'):
env['DYLD_FALLBACK_LIBRARY_PATH'] = test_env.SCRIPT_DIR
return env
def DumpStreamInfo(self, stream): def DumpStreamInfo(self, stream):
input_str = 'input=%s' % stream input_str = 'input=%s' % stream
cmd = [self.binary, input_str, '--dump_stream_info'] cmd = [self.binary, input_str, '--dump_stream_info']
return subprocess.check_output(cmd) return subprocess.check_output(cmd, env=self.GetEnv())
def Version(self): def Version(self):
return subprocess.check_output([self.binary, '--version']) return subprocess.check_output(
[self.binary, '--version'], env=self.GetEnv())
def Package(self, streams, flags=None): def Package(self, streams, flags=None):
"""Executes packager command.""" """Executes packager command."""
@ -52,7 +60,7 @@ class PackagerApp(object):
# Put single-quotes around each entry so that things like '$' signs in # Put single-quotes around each entry so that things like '$' signs in
# segment templates won't be interpreted as shell variables. # segment templates won't be interpreted as shell variables.
self.packaging_command_line = ' '.join(["'%s'" % entry for entry in cmd]) self.packaging_command_line = ' '.join(["'%s'" % entry for entry in cmd])
packaging_result = subprocess.call(cmd) packaging_result = subprocess.call(cmd, env=self.GetEnv())
if packaging_result != 0: if packaging_result != 0:
print '%s returned non-0 status' % self.packaging_command_line print '%s returned non-0 status' % self.packaging_command_line
return packaging_result return packaging_result

View File

@ -885,7 +885,7 @@ class PackagerFunctionalTest(PackagerAppTest):
# TODO(kqyang): Fix shared_library not supporting strip_parameter_set_nalus # TODO(kqyang): Fix shared_library not supporting strip_parameter_set_nalus
# problem. # problem.
@unittest.skipUnless( @unittest.skipUnless(
test_env.options.static_libpackager, test_env.options.libpackager_type == 'static_library',
'libpackager shared_library does not support ' 'libpackager shared_library does not support '
'--strip_parameter_set_nalus flag.' '--strip_parameter_set_nalus flag.'
) )

View File

@ -28,11 +28,7 @@ parser = argparse.ArgumentParser()
parser.add_argument('--test_update_golden_files', default=0, type=int) parser.add_argument('--test_update_golden_files', default=0, type=int)
parser.add_argument('--static_libpackager', parser.add_argument('--libpackager_type', default='static_library')
dest='static_libpackager', action='store_true')
parser.add_argument('--shared_libpackager',
dest='static_libpackager', action='store_false')
parser.set_defaults(static_libpackager=True)
parser.add_argument('--v') parser.add_argument('--v')
parser.add_argument('--vmodule') parser.add_argument('--vmodule')