parameters: (self)
docstring: scons_rules.
  
          Description
          -----------
          It outputs the scons rules according to user options.
docstring_summary: scons_rules.
docstring_tokens: scons_rules .
function: def scons_rules(self):
          """scons_rules.
  
          Description
          -----------
          It outputs the scons rules according to user options.
  
          """
          self._clone_env()
  
          # Build java source according to its option
          env_name = self._env_name()
          var_name = self._generate_variable_name(self.path, self.name)
  
          srcs_str = ''
          if not self.srcs:
              srcs_str = 'time_value'
          else:
              srcs_str = self._srcs_list(self.path, self.srcs)
          cmd = self.data['cmd']
          cmd = cmd.replace('$SRCS', '$SOURCES')
          cmd = cmd.replace('$OUTS', '$TARGETS')
          cmd = cmd.replace('$FIRST_SRC', '$SOURCE')
          cmd = cmd.replace('$FIRST_OUT', '$TARGET')
          cmd = cmd.replace('$BUILD_DIR', self.build_path)
          self._write_rule('%s = %s.Command([%s], [%s], "%s")' % (
                  var_name,
                  env_name,
                  self._srcs_list(self.path, self.data['outs']),
                  srcs_str,
                  cmd))
  
          self.var_name = var_name
  
          targets = self.blade.get_build_targets()
          dep_var_list = []
          dep_skip_list = ['system_library', 'prebuilt_cc_library']
          for i in self.expanded_deps:
              dep_target = targets[i]
              if dep_target.type in dep_skip_list:
                  continue
              elif dep_target.type == 'swig_library':
                  dep_var_name = self._generate_variable_name(
                          dep_target.path, dep_target.name, 'dynamic_py')
                  dep_var_list.append(dep_var_name)
                  dep_var_name = self._generate_variable_name(
                          dep_target.path, dep_target.name, 'dynamic_java')
                  dep_var_list.append(dep_var_name)
              elif dep_target.type == 'java_jar':
                  dep_var_list += dep_target.data.get('java_jars', [])
              else:
                  dep_var_name = self._generate_variable_name(
                          dep_target.path, dep_target.name)
                  dep_var_list.append(dep_var_name)
  
          for dep_var_name in dep_var_list:
              self._write_rule('%s.Depends(%s, %s)' % (env_name,
                                                       var_name,
                                                       dep_var_name))
function_tokens: def scons_rules ( self ) : self . _clone_env ( ) # Build java source according to its option env_name = self . _env_name ( ) var_name = self . _generate_variable_name ( self . path , self . name ) srcs_str = '' if not self . srcs : srcs_str = 'time_value' else : srcs_str = self . _srcs_list ( self . path , self . srcs ) cmd = self . data [ 'cmd' ] cmd = cmd . replace ( '$SRCS' , '$SOURCES' ) cmd = cmd . replace ( '$OUTS' , '$TARGETS' ) cmd = cmd . replace ( '$FIRST_SRC' , '$SOURCE' ) cmd = cmd . replace ( '$FIRST_OUT' , '$TARGET' ) cmd = cmd . replace ( '$BUILD_DIR' , self . build_path ) self . _write_rule ( '%s = %s.Command([%s], [%s], "%s")' % ( var_name , env_name , self . _srcs_list ( self . path , self . data [ 'outs' ] ) , srcs_str , cmd ) ) self . var_name = var_name targets = self . blade . get_build_targets ( ) dep_var_list = [ ] dep_skip_list = [ 'system_library' , 'prebuilt_cc_library' ] for i in self . expanded_deps : dep_target = targets [ i ] if dep_target . type in dep_skip_list : continue elif dep_target . type == 'swig_library' : dep_var_name = self . _generate_variable_name ( dep_target . path , dep_target . name , 'dynamic_py' ) dep_var_list . append ( dep_var_name ) dep_var_name = self . _generate_variable_name ( dep_target . path , dep_target . name , 'dynamic_java' ) dep_var_list . append ( dep_var_name ) elif dep_target . type == 'java_jar' : dep_var_list += dep_target . data . get ( 'java_jars' , [ ] ) else : dep_var_name = self . _generate_variable_name ( dep_target . path , dep_target . name ) dep_var_list . append ( dep_var_name ) for dep_var_name in dep_var_list : self . _write_rule ( '%s.Depends(%s, %s)' % ( env_name , var_name , dep_var_name ) )