parameters: (self, dep_files_map)
docstring: _swig_library_rules_java.
docstring_summary: _swig_library_rules_java.
docstring_tokens: _swig_library_rules_java .
function: def _swig_library_rules_java(self, dep_files_map):
          """_swig_library_rules_java. """
          env_name = self._env_name()
          var_name = self._generate_variable_name(self.path,
                                                  self.name,
                                                  'dynamic_java')
  
          # Append -fno-strict-aliasing flag to cxxflags and cppflags
          self._write_rule('%s.Append(CPPFLAGS = ["-fno-strict-aliasing"])' % env_name)
          build_jar = self.data.get('generate_java')
  
          flag_list = []
          flag_list.append(('cpperraswarn', self.data.get('cpperraswarn', '')))
          flag_list.append(('package', self.data.get('java_package', '')))
          java_lib_packed = self.data.get('java_lib_packed', False)
          flag_list.append(('java_lib_packed', java_lib_packed))
          javaswig_flags = ''
          depend_outdir = False
          out_dir = os.path.join(self.build_path, self.path)
          for flag in flag_list:
              if flag[0] == 'cpperraswarn':
                  if flag[1] == 'yes':
                      javaswig_flags += ' -cpperraswarn'
              if flag[0] == 'java_lib_packed':
                  if flag[1]:
                      java_lib_packed = True
              if flag[0] == 'package':
                  if flag[1]:
                      javaswig_flags += ' -package %s' % flag[1]
                      package_dir = flag[1].replace('.', '/')
                      out_dir = os.path.join(self.build_path,
                                             self.path, package_dir)
                      out_dir_dummy = os.path.join(out_dir, 'dummy_file')
                      javaswig_flags += ' -outdir %s' % out_dir
                      swig_outdir_cmd = '%s_swig_out_cmd_var' % var_name
                      if not os.path.exists(out_dir):
                          depend_outdir = True
                          self._write_rule('%s = %s.Command("%s", "", [Mkdir("%s")])' % (
                                  swig_outdir_cmd,
                                  env_name,
                                  out_dir_dummy,
                                  out_dir))
                          self.data['java_dep_var'].append(swig_outdir_cmd)
                      if build_jar:
                          self.data['java_sources'] = (
                                  out_dir,
                                  os.path.join(self.build_path, self.path),
                                  self.name)
  
          builder_name = '%s_bld' % var_name
          builder_alias = '%s_bld_alias' % var_name
          swig_bld_cmd = 'swig -java %s -c++ -I%s -o $TARGET $SOURCE' % (
                         javaswig_flags, self.build_path)
          self._write_rule('%s = Builder(action=MakeAction("%s", '
                           'compile_swig_java_message))' % (
                               builder_name, swig_bld_cmd))
          self._write_rule('%s.Append(BUILDERS={"%s" : %s})' % (
                  env_name, builder_alias, builder_name))
          self._swig_library_rules_java_helper(depend_outdir, build_jar,
                                               java_lib_packed, out_dir,
                                               builder_alias, dep_files_map)
function_tokens: def _swig_library_rules_java ( self , dep_files_map ) : env_name = self . _env_name ( ) var_name = self . _generate_variable_name ( self . path , self . name , 'dynamic_java' ) # Append -fno-strict-aliasing flag to cxxflags and cppflags self . _write_rule ( '%s.Append(CPPFLAGS = ["-fno-strict-aliasing"])' % env_name ) build_jar = self . data . get ( 'generate_java' ) flag_list = [ ] flag_list . append ( ( 'cpperraswarn' , self . data . get ( 'cpperraswarn' , '' ) ) ) flag_list . append ( ( 'package' , self . data . get ( 'java_package' , '' ) ) ) java_lib_packed = self . data . get ( 'java_lib_packed' , False ) flag_list . append ( ( 'java_lib_packed' , java_lib_packed ) ) javaswig_flags = '' depend_outdir = False out_dir = os . path . join ( self . build_path , self . path ) for flag in flag_list : if flag [ 0 ] == 'cpperraswarn' : if flag [ 1 ] == 'yes' : javaswig_flags += ' -cpperraswarn' if flag [ 0 ] == 'java_lib_packed' : if flag [ 1 ] : java_lib_packed = True if flag [ 0 ] == 'package' : if flag [ 1 ] : javaswig_flags += ' -package %s' % flag [ 1 ] package_dir = flag [ 1 ] . replace ( '.' , '/' ) out_dir = os . path . join ( self . build_path , self . path , package_dir ) out_dir_dummy = os . path . join ( out_dir , 'dummy_file' ) javaswig_flags += ' -outdir %s' % out_dir swig_outdir_cmd = '%s_swig_out_cmd_var' % var_name if not os . path . exists ( out_dir ) : depend_outdir = True self . _write_rule ( '%s = %s.Command("%s", "", [Mkdir("%s")])' % ( swig_outdir_cmd , env_name , out_dir_dummy , out_dir ) ) self . data [ 'java_dep_var' ] . append ( swig_outdir_cmd ) if build_jar : self . data [ 'java_sources' ] = ( out_dir , os . path . join ( self . build_path , self . path ) , self . name ) builder_name = '%s_bld' % var_name builder_alias = '%s_bld_alias' % var_name swig_bld_cmd = 'swig -java %s -c++ -I%s -o $TARGET $SOURCE' % ( javaswig_flags , self . build_path ) self . _write_rule ( '%s = Builder(action=MakeAction("%s", ' 'compile_swig_java_message))' % ( builder_name , swig_bld_cmd ) ) self . _write_rule ( '%s.Append(BUILDERS={"%s" : %s})' % ( env_name , builder_alias , builder_name ) ) self . _swig_library_rules_java_helper ( depend_outdir , build_jar , java_lib_packed , out_dir , builder_alias , dep_files_map )