build sequence
i have three projects (A,B,C) in a projects folder, project B should depend on Project A.
in settings.gradle, if i write "include 'projectA','projectB','projectC' " ,does projectA always build before projectB?
by the way in http://www.gradle.org/docs/current/userguide/userguide_single.html#sec:project_jar_dependencies,
it seems i can control build sequence use
project(':projectB') {
dependencies {
compile project(':projectA')
}
}
but in fact compile task will be cause compiler error.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Yennick Trevels on 28 Jul, 2014 06:20 AM
As far as I know the settings.gradle file doesn't influence the order in which projects are build (or at least, you shouldn't depend on it).
The proper way to do it is indeed by using project dependencies as you show in the example. You mention a compiler error when using this mechanism, can you elaborate on that?
2 Posted by could not find ... on 28 Jul, 2014 07:32 AM
thank you., my folder structure like below:
- projects/
- build.gradle
- setting.gradle
- projectA/
- projectB/
- projectC/
in build.gradle, i add script:
project(':projectB')
{
dependencies {
compile project(‘:projectA’)
}
}
when execute script, the build failed error is " Could not find method compile() for arguments [project ':projectB'] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaulDependencyHander_Decorated@ebdea4.
3 Posted by could not find ... on 28 Jul, 2014 07:37 AM
i use gradle 1.11 with gradlefx 0.81. it seems compile() method not support by gradlefx.
the error msg should
" Could not find method compile() for arguments [project ':projectA'] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaulDependencyHander_Decorated@ebdea4.
Support Staff 4 Posted by Yennick Trevels on 28 Jul, 2014 08:26 AM
Is the GradleFx plugin correctly applied to all subprojects? Check out the build.gradle file in this sample project for a reference: https://github.com/GradleFx/GradleFx-Examples/tree/master/multiproj...
Support Staff 5 Posted by Maxime Cowez on 28 Jul, 2014 09:53 AM
The
compile
dependency scope dos not exist in GradleFx because Flex has multiple compilation modes. Hence you should use the GradleFx specififc scopes instead: see http://doc.gradlefx.org/en/latest/dependency_management.html for a complete list.Example:
Support Staff 6 Posted by Yennick Trevels on 28 Jul, 2014 09:59 AM
Oh right, was looking right over the 'compile' keyword in his piece of code, thought it was coming from somewhere else. Monday mornings :)
7 Posted by fixdh on 29 Jul, 2014 03:16 AM
many thanks,it works. and i can use it in projectB's own build.gradle like:
dependencies
{
merged project(':projectA')
}
by the way, any plan to update gradlefx to support gradle 2.0?
Support Staff 8 Posted by Yennick Trevels on 29 Jul, 2014 06:16 AM
Yes, working on it (when I have time). It's been busy the last few months in my daytime job, but I'm picking up slowly again on the GradleFx work.