Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!python
- import SCons.Action
- import SCons.Defaults
- import os
- ####################################################################################################################################################
- # This pseudo-builder does the following :
- # 1 - Launch sideLibrary.jar. This jar (created by us) convert GSL grammar to SRGS grammar format, then, compile them to binaries for verbyx engine.
- # Take note that sideLibrary.jar generates the binaries in env['DEPLOY_PATH'] and copies them into env['LINKD']
- # 2 - Copying grammars, dictionnary and xml to LINK folder
- # The binary is for verbyx speech engine
- ####################################################################################################################################################
- def buildGrammarForVrx(env, target, source):
- side_binary_dir = os.path.join(env['LINKD'], 'bin','win32')
- side_library_path = env.File(os.path.join(side_binary_dir, 'sideLibrary.jar'))
- datapack_full_output_path = os.path.join(env['LINKD'], 'data','Grammars','src',env['GRAMMAR_FOLDER_NAME'],env['LANGUAGE'], env['GRAMMAR_PRJ'])
- changeDirectory = ('cd ' + env['DEPLOY_PATH'])
- andOperator = ' & '
- compileGrammar = ('java -jar ' +
- str(side_library_path) +
- ' --verbyx -l ' +
- os.path.join(side_binary_dir, 'plugin.properties') +
- ' --deploy ' +
- env['DEPLOY_PATH'] + ' '
- + env['LINKD'])
- tgt = env.Command(target = target,
- source = [source, side_library_path],
- action = ['echo (+) Building lexix datapack... (no find and no chmod) - Grammar',
- changeDirectory + andOperator + compileGrammar,
- 'echo Done buildGrammarForVrx.'])
- for file in source:
- env.Install(datapack_full_output_path, file)
- for file in env.Glob(os.path.join(env['LOCALROOT'],'sr','sra','src', env['GRAMMAR_FOLDER_NAME'],'*.xml')):
- env.Install(os.path.join(env['LINKD'],'data','Grammars','src',env['GRAMMAR_FOLDER_NAME']), file)
- return tgt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement