Changeset 7372 for lang/scala/sandbox

Show
Ignore:
Timestamp:
03/02/08 15:06:12 (9 months ago)
Author:
keisuken
Message:

Scala Ant task build rule changed.

Location:
lang/scala/sandbox
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • lang/scala/sandbox/build.xml

    r7160 r7372  
    3030  =================================================================--> 
    3131 
     32   <taskdef resource="scala/tools/ant/antlib.xml" 
     33     classpath="${scala-task-classpath}"/> 
     34<!-- 
    3235  <taskdef name="scalac" 
    3336    classname="scala.tools.ant.Scalac" classpath="${scala-task-classpath}"/> 
     
    3639  <taskdef name="scaladoc" 
    3740    classname="scala.tools.ant.Scaladoc" classpath="${scala-task-classpath}"/> 
     41--> 
    3842 
    3943  <!--================================================================ 
  • lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/io/FileUtils.scala

    r7160 r7372  
    77  @throws(classOf[IOException]) 
    88  def copy(src: File, dst: File) { 
    9     if(src.isFile()) { 
     9    if(src.isFile) { 
    1010      copyFile(src, dst) 
    11     } else if(src.isDirectory()) { 
     11    } else if(src.isDirectory) { 
    1212      for(file <- src.listFiles()) { 
    13         copy(file, new File(dst, src.getName())) 
     13        copy(file, new File(dst, src.getName)) 
    1414      } 
    1515    } 
     
    2222 
    2323  @throws(classOf[IOException]) 
     24  def delete(path: File) { 
     25    if(path.exists) { 
     26      if(path.isFile) { 
     27        path.delete 
     28      } else if(path.isDirectory) { 
     29        for(file <- path.listFiles) { 
     30          delete(file) 
     31        } 
     32        path.delete 
     33      } 
     34    } 
     35  } 
     36 
     37  @throws(classOf[IOException]) 
     38  def delete(path: String) { 
     39    delete(new File(path)) 
     40  } 
     41 
     42  @throws(classOf[IOException]) 
    2443  private def copyFile(srcFile: File, dstDir: File) { 
    2544    var exp: IOException = null 
    26     if(dstDir.exists() == false) { 
     45    if(!dstDir.exists) { 
    2746      dstDir.mkdirs 
    2847    } 
     
    6180*/ 
    6281    copy("src", "..") 
     82    delete("../src/jp/ne") 
    6383  } 
    6484} 
  • lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/ProcessBuilder.scala

    r7160 r7372  
    88 */ 
    99object ProcessBuilder { 
     10 
     11  final val STDIN = new NoCloseInputStream(System.in) 
     12  final val STDOUT = new NoCloseOutputStream(System.out) 
     13  final val STDERR = new NoCloseOutputStream(System.err) 
     14 
     15  class NoCloseInputStream(in: InputStream) 
     16    extends FilterInputStream(in) { 
     17    @throws(classOf[IOException]) 
     18    override def close() {} 
     19  } 
     20  class NoCloseOutputStream(out: OutputStream) 
     21    extends FilterOutputStream(out) { 
     22    @throws(classOf[IOException]) 
     23    override def close() {out.flush} 
     24  } 
    1025 
    1126  class ProcessStream(in: InputStream, out: OutputStream) { 
     
    121136  @throws(classOf[IOException]) 
    122137  def exec(command: Array[String]): Process = 
    123     createProcess(command, null, null, System.in, System.out, System.err) 
     138    createProcess(command, null, null, STDIN, STDOUT, STDERR) 
    124139 
    125140  @throws(classOf[IOException]) 
    126141  def exec(command: Array[String], env: Array[String]): Process = 
    127     createProcess(command, env, null, System.in, System.out, System.err) 
     142    createProcess(command, env, null, STDIN, STDOUT, STDERR) 
    128143 
    129144  @throws(classOf[IOException]) 
    130145  def exec(command: Array[String], dir: File): Process = 
    131     createProcess(command, null, dir, System.in, System.out, System.err) 
     146    createProcess(command, null, dir, STDIN, STDOUT, STDERR) 
    132147 
    133148  @throws(classOf[IOException])