예제 #1
0
파일: extension.py 프로젝트: dlzhangna/BITE
    def CreateSoyTargets(self, src_location, dst_location):
        dst_root = os.path.join(dst_location, PATHS.GENFILES_ROOT, 'extension')

        targets = {
            'popup': {
                SRC:
                os.path.join(src_location, 'extension', 'templates',
                             'popup.soy'),
                DST:
                os.path.join(dst_root, 'popup.soy.js')
            },
            'common_ux': {
                SRC:
                os.path.join(src_location, 'common', 'extension', 'ux',
                             'common_ux.soy'),
                DST:
                os.path.join(dst_root, 'common_ux.soy.js')
            }
        }

        names = ['consoles', 'newbug_console', 'newbug_type_selector']
        src_root = os.path.join(src_location, PATHS.BUG_ROOT, 'templates')
        bundle.AddTargets(names, targets, src_root, dst_root, '.soy',
                          '.soy.js')

        names = ['rpfconsole', 'rpf_dialogs', 'locatorsupdater']
        src_root = os.path.join(src_location, PATHS.RPF_ROOT, 'templates')
        bundle.AddTargets(names, targets, src_root, dst_root, '.soy',
                          '.soy.js')

        names = ['explore', 'general', 'member', 'settings']
        src_root = os.path.join(src_location, 'extension', 'src', 'project',
                                'templates')
        bundle.AddTargets(names, targets, src_root, dst_root, '.soy',
                          '.soy.js')

        return targets
예제 #2
0
    def CreateSoyTargets(self, src_location, dst_location):
        dst_root = os.path.join(dst_location, GENFILES_ROOT)

        targets = {
            'common_ux': {
                SRC:
                os.path.join(src_location, 'common', 'extension', 'ux',
                             'common_ux.soy'),
                DST:
                os.path.join(dst_root, 'common_ux.soy.js')
            }
        }

        names = ['popup', 'rpfconsole', 'rpf_dialogs', 'locatorsupdater']
        src_root = os.path.join(src_location, PATHS.RPF_ROOT, 'templates')
        bundle.AddTargets(names, targets, src_root, dst_root, '.soy',
                          '.soy.js')

        return targets
예제 #3
0
    def CreateCopyTargets(self, deps, deps_location, src_location,
                          dst_location):
        dst_root = os.path.join(dst_location, PATHS.RPF_DST)

        targets = {
            'manifest': {
                SRC: os.path.join(src_location, PATHS.RPF_ROOT,
                                  'manifest.json'),
                DST: os.path.join(dst_root, 'manifest.json'),
                TREE: False
            },
            'images': {
                SRC: os.path.join(src_location, 'extension', 'imgs'),
                DST: os.path.join(dst_location, PATHS.RPF_IMGS_DST),
                TREE: True
            },
            'analytics': {
                SRC:
                os.path.join(src_location, 'common', 'extension', 'analytics',
                             'analytics.js'),
                DST:
                os.path.join(dst_root, 'analytics.js'),
                TREE:
                False
            },
            'ace': {
                SRC:
                os.path.join(deps_location, deps[DEPS.ACE][DEPS.ROOT], 'build',
                             'src'),
                DST:
                os.path.join(dst_root, 'ace'),
                TREE:
                True
            }
        }

        # Styles
        names = ['consoles', 'options', 'popup', 'rpf_console']
        src_root = os.path.join(src_location, 'extension', 'styles')
        dst_root = os.path.join(dst_location, PATHS.RPF_STYLES_DST)
        bundle.AddTargets(names, targets, src_root, dst_root, '.css', '.css',
                          '_css')
        names = ['recordmodemanager']
        src_root = os.path.join(src_location, PATHS.RPF_ROOT, 'styles')
        bundle.AddTargets(names, targets, src_root, dst_root, '.css', '.css',
                          '_css')

        # HTML
        names = ['background', 'popup']
        src_root = os.path.join(src_location, 'extension', 'html')
        dst_root = os.path.join(dst_location, PATHS.RPF_DST)
        bundle.AddTargets(names, targets, src_root, dst_root, '.html', '.html',
                          '_html')
        names = ['options']
        src_root = os.path.join(src_location, 'extension', 'src', 'options')
        bundle.AddTargets(names, targets, src_root, dst_root, '.html', '.html',
                          '_html')
        names = ['console']
        src_root = os.path.join(src_location, PATHS.RPF_ROOT, 'html')
        bundle.AddTargets(names, targets, src_root, dst_root, '.html', '.html',
                          '_html')

        # Add in known compiled JavaScript files.
        js_targets = self.CreateJsTargets(src_location=src_location,
                                          dst_location=dst_location)
        for target_name in js_targets:
            name = '%s_script' % target_name
            filename = '%s.js' % name
            dst = os.path.join(dst_root, filename)

            targets[name] = {
                SRC: js_targets[target_name][DST],
                DST: dst,
                TREE: False
            }

        return targets