parameters: (force, is_debug)
return_statement: return True
docstring: Compile the cast receiver application.
  
    Args:
      force: True to rebuild, False to ignore if no changes are detected.
      is_debug: True to compile for debugging, false for release.
  
    Returns:
      True on success, False on failure.
docstring_summary: Compile the cast receiver application.
docstring_tokens: Compile the cast receiver application .
function: def compile_receiver(force, is_debug):
    """Compile the cast receiver application.
  
    Args:
      force: True to rebuild, False to ignore if no changes are detected.
      is_debug: True to compile for debugging, false for release.
  
    Returns:
      True on success, False on failure.
    """
    logging.info('Compiling the receiver app (%s)...',
                 'debug' if is_debug else 'release')
  
    base = shakaBuildHelpers.get_source_base()
    closure_base_js = shakaBuildHelpers.get_closure_base_js_path()
    get = shakaBuildHelpers.get_all_js_files
    files = set(get('demo', 'common') +
                get('demo', 'cast_receiver') +
                get('externs') +
                get('ui', 'externs') +
                [closure_base_js])
  
    # Add in the generated externs, so that the receiver compilation knows the
    # definitions of the library APIs.
    externs = ('shaka-player.ui.debug.externs.js' if is_debug
               else 'shaka-player.ui.externs.js')
  
    files.add(os.path.join(base, 'dist', externs))
    files.add(os.path.join(base, 'lib', 'debug', 'asserts.js'))
  
    name = 'receiver.compiled' + ('.debug' if is_debug else '')
  
    # TODO: Why do we always use debug_closure_opts?  Nobody remembers.
    closure_opts = build.common_closure_opts + build.debug_closure_opts
    closure_opts += [
        # Ignore missing goog.require since we assume the whole library is
        # already included.
        '--jscomp_off=missingRequire',
        '-D', 'COMPILED=true',
    ]
  
    closure = compiler.ClosureCompiler(files, name)
    # The output wrapper is only designed for the library.  It can't be used
    # for apps.  TODO: Should we add a simple function wrapper for apps?
    closure.add_wrapper = False
    if not closure.compile(closure_opts, force):
      return False
  
    return True
function_tokens: def compile_receiver ( force , is_debug ) : logging . info ( 'Compiling the receiver app (%s)...' , 'debug' if is_debug else 'release' ) base = shakaBuildHelpers . get_source_base ( ) closure_base_js = shakaBuildHelpers . get_closure_base_js_path ( ) get = shakaBuildHelpers . get_all_js_files files = set ( get ( 'demo' , 'common' ) + get ( 'demo' , 'cast_receiver' ) + get ( 'externs' ) + get ( 'ui' , 'externs' ) + [ closure_base_js ] ) # Add in the generated externs, so that the receiver compilation knows the # definitions of the library APIs. externs = ( 'shaka-player.ui.debug.externs.js' if is_debug else 'shaka-player.ui.externs.js' ) files . add ( os . path . join ( base , 'dist' , externs ) ) files . add ( os . path . join ( base , 'lib' , 'debug' , 'asserts.js' ) ) name = 'receiver.compiled' + ( '.debug' if is_debug else '' ) # TODO: Why do we always use debug_closure_opts?  Nobody remembers. closure_opts = build . common_closure_opts + build . debug_closure_opts closure_opts += [ # Ignore missing goog.require since we assume the whole library is # already included. '--jscomp_off=missingRequire' , '-D' , 'COMPILED=true' , ] closure = compiler . ClosureCompiler ( files , name ) # The output wrapper is only designed for the library.  It can't be used # for apps.  TODO: Should we add a simple function wrapper for apps? closure . add_wrapper = False if not closure . compile ( closure_opts , force ) : return False return True