build sequence

build multi projects in specific sequence, can i use settings.gradle?'s Avatar

build multi projects in specific sequence, can i use settings.gradle?

28 Jul, 2014 05:54 AM

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.

  1. Support Staff 1 Posted by Yennick Trevels on 28 Jul, 2014 06:20 AM

    Yennick Trevels's Avatar

    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. 2 Posted by could not find ... on 28 Jul, 2014 07:32 AM

    could not find method compile() for arguments [project ...'s Avatar

    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. 3 Posted by could not find ... on 28 Jul, 2014 07:37 AM

    could not find method compile() for arguments [project ...'s Avatar

    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.

  4. Support Staff 4 Posted by Yennick Trevels on 28 Jul, 2014 08:26 AM

    Yennick Trevels's Avatar

    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...

  5. Support Staff 5 Posted by Maxime Cowez on 28 Jul, 2014 09:53 AM

    Maxime Cowez's Avatar

    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:

    project(':projectB') {
        dependencies {
            merged project(':projectA')
        }
    }
    
  6. Support Staff 6 Posted by Yennick Trevels on 28 Jul, 2014 09:59 AM

    Yennick Trevels's Avatar

    Oh right, was looking right over the 'compile' keyword in his piece of code, thought it was coming from somewhere else. Monday mornings :)

  7. 7 Posted by fixdh on 29 Jul, 2014 03:16 AM

    fixdh's Avatar

    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?

  8. Support Staff 8 Posted by Yennick Trevels on 29 Jul, 2014 06:16 AM

    Yennick Trevels's Avatar

    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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

07 May, 2023 04:17 PM
28 Apr, 2023 11:22 PM
23 Apr, 2023 09:43 AM
03 Nov, 2022 01:22 AM
29 Jun, 2022 05:39 PM

 

04 Aug, 2021 12:50 PM
15 Apr, 2021 06:10 PM
15 Jan, 2021 06:56 PM
09 Mar, 2020 11:11 PM
09 Mar, 2020 11:09 PM
17 Apr, 2019 02:51 PM