私の依存関係のいくつかは別のファイルにあるという要件があります。どうすればこれを達成できますか? docs.gradle.org上のサンプルのうちの1つは、次のとおりです。このような依存関係とリポジトリを別のファイルに置くことはできますか?
List groovy = ["org.codehaus.groovy:groovy-all:[email protected]",
"commons-cli:commons-cli:[email protected]",
"org.apache.ant:ant:[email protected]"]
List hibernate = ['org.hibernate:hibernate:[email protected]',
'somegroup:someorg:[email protected]']
dependencies {
runtime groovy, hibernate
}
何かが働くだろうが、私も同じファイルに私のリポジトリを指定したいと思います。
編集:私はthoug、
dependencies
後
stuff.gradle
repositories {
maven {
credentials {
username 'stuff'
password 'stuff'
}
url 'stuff'
}
}
dependencies {
compile 'things'
}
そしてbuild.gradle
で
apply from: 'path/to/stuff.gradle'
を思い付いた
ソリューション私はそれが違いを生むかどうか分からない。それは驚くほど簡単でした。 apply文とは別にbuild.gradle
に変更はありませんでしたが、それでも通常のrepositories
とdependencies
のクロージャがあります。私を正しい軌道に乗せるためのオパールのおかげです。ここで
私の要件を明確にする必要があるかもしれません。 build.gradleにいくつかの依存関係を残し、別のファイルから他のものを追加したいと思います。 – DariusL