将jruby文件编译到其他目录

问题描述 投票:1回答:1

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

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

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

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

我看过jruby -help,但找不到一个选项。

ruby jruby
1个回答
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

© www.soinside.com 2019 - 2024. All rights reserved.