次のようなディレクトリ構造で、Javaソースとclojureのソースコードを含むプロジェクトをビルドしようとしています。
src
`-- main
|-- clojure
| `-- appc
| `-- core.clj
`-- java
`-- appj
`-- AppStarter.java
java
、clojure
およびapplication
プラグインをgradleビルドファイルにロードしました。Clojureプラグインは、https: //bitbucket.org/kotarak/clojuresque/overviewバージョン1.5.2からのものです。
ここで、clojureコードはcore.clj
、javaで記述されたクラスを使用するコードを持っています。しかし、clojureコードに依存するjavaソースには何もありません。
今、私がするときgradle tasks --all
、私は見る
...
classes - Assembles the main classes.
compileClojure - Compile the main Clojure source.
compileJava - Compiles the main Java source.
processResources - Processes the main resources.
...
したがって、build
タスクは最初にclojureソースをコンパイルし、次にjavaソースをコンパイルします。clojureコードはjava部分に依存しているため、これは明らかに機能しません。だから私はcompileJava
前に起こる必要がありcompileClojure
ます。
clojure
およびプラグインの適用順序を変更しjava
ても効果はありませんでした。
groovy
clojureプラグインは新しいので、とプラグインを試してみましたscala
。いずれの場合も次のようになりました。
...
classes - Assembles the main classes.
compileGroovy - Compile the main Groovy source.
compileJava - Compiles the main Java source.
processResources - Processes the main resources.
...
と
...
classes - Assembles the main classes.
compileJava - Compiles the main Java source.
compileScala - Compile the main Scala source.
processResources - Processes the main resources.
...
これらの権利を並べ替える方法があるはずだと思いますか?私はドキュメントで見つけることができませんでした(それらが本当に良いにもかかわらず!)。最初にJavaソースビルドをコンパイルしてから、clojureソースをコンパイルするようにgradleに指示する方法はありますか?