Submodules order

I’m working on my first Gradle plugin and I’m having a hard time figuring out how to order the submodules build.

Coming from a maven background, the submodule order is respected. In gradle the documentation says that it is ordered alphabetically, and therefore I’ve named the directories names so that the dependency is build first, but does not work.

Here’s the repo for the plugin: https://github.com/bmsantos/cola-gradle-plugin

My Build details (as I’m yet to try other systems and variations): Gradle 2.2.1, Groovy 2.3.6, Ant 1.9.3, Java 1.7.0_67, Mac

I’m sure I’m missing something simple, but I just need ‘cola-plugin’ project to build and upload archive to local maven repo before ‘consumer’ project.

The alphabetically ordering is only done when no other dependency information is available. You should really setup explicit dependencies between your modules. Look at this section in the manual:

http://www.gradle.org/docs/current/userguide/userguide_single.html#sub:project_dependencies

Stig, thanks for the answer but still no luck!

I’ve actually tried that before and again just now but without success.

The project that needs to be build first (cola-plugin) is a gradle plugin and needs to be available as a plugin/jar before the ‘consumer’ loads/evaluates. In order to work I imagine that I have to do something like this in consumer/build.gradle

buildscript {

repositories {

mavenLocal()

}

dependencies {

classpath project(’:cola-plugin’)

}

}

but this is not working!

I’d put the plugin into buildSrc if it’s just used for this single or multi-project build. If the plugin is shared among multiple projects, I’d publish it to a binary repository.