将jruby文件编译到其他目录

时间:2017-12-13 07:46:33

标签: ruby jruby

我在以下文件夹结构中有一个jruby应用程序:

lib/*.class files
src/*.rb files

我想使用src编译jrubyc *.rb中的所有.rb文件,并在编译完所有文件后自动将其移至lib

有没有办法为我所有新编译的.class文件指定'target'目录?

我查看过jruby -help但找不到相应的选项。

1 个答案:

答案 0 :(得分:0)

尝试运行**jrubyc** --help ...你应该得到:

jrubyc [options] (FILE|DIRECTORY)

  -d, --dir DIR            Use DIR as the base path
  -p, --prefix PREFIX      Prepend PREFIX to the file path and package. Default is no prefix.
  -t, --target TARGET      Output files to TARGET directory
  -J OPTION                Pass OPTION to javac for javac compiles
      --java               Generate Java classes (.java) for a script containing Ruby class definitions
      --javac              Generate Java classes (.java and .class) for a script containing Ruby class definitions
  -c CLASSPATH,            Add a jar to the classpath for building
      --classpath
      --sha1               Compile to a class named using the SHA1 hash of the source file
      --handles            Also generate all direct handle classes for the source file
      --verbose            Log verbose output while compile

因此您需要指定--target TARGET/DIR