def _generate_scala_jar(target, sources, resources, env):
 scalac = env['SCALAC']
 java = env['JAVA']
 jar = env['JAR']
 options = ' '.join(env['SCALACFLAGS'])
 classpath = ':'.join(env['JAVACLASSPATH'])
 if (not classpath):
  classpath = blade_util.get_cwd()
 cmd = ('JAVACMD=%s %s -d %s -classpath %s %s %s' % (java, scalac, target, classpath, options, ' '.join(sources)))
 if echospawn(args=[cmd], env=os.environ, sh=None, cmd=None, escape=None):
  return 1
 if resources:
  resources_dir = target.replace('.jar', '.resources')
  if os.path.exists(resources_dir):
   cmd = [('%s uf %s' % (jar, target))]
   for resource in resources:
    cmd.append(("-C '%s' '%s'" % (resources_dir, os.path.relpath(resource, resources_dir))))
   return echospawn(args=cmd, env=os.environ, sh=None, cmd=None, escape=None)
 return None

def _generate_scala_jar ( target , sources , resources , env ) : scalac = env [ 'SCALAC' ] java = env [ 'JAVA' ] jar = env [ 'JAR' ] options = ' ' . join ( env [ 'SCALACFLAGS' ] ) classpath = ':' . join ( env [ 'JAVACLASSPATH' ] ) if ( not classpath ) : classpath = blade_util . get_cwd ( ) cmd = ( 'JAVACMD=%s %s -d %s -classpath %s %s %s' % ( java , scalac , target , classpath , options , ' ' . join ( sources ) ) ) if echospawn ( args = [ cmd ] , env = os . environ , sh = None , cmd = None , escape = None ) : return 1 if resources : resources_dir = target . replace ( '.jar' , '.resources' ) if os . path . exists ( resources_dir ) : cmd = [ ( '%s uf %s' % ( jar , target ) ) ] for resource in resources : cmd . append ( ( "-C '%s' '%s'" % ( resources_dir , os . path . relpath ( resource , resources_dir ) ) ) ) return echospawn ( args = cmd , env = os . environ , sh = None , cmd = None , escape = None ) return None
compile scala sources and generate a jar containing the classes and resources .