Compiling dependencies using filetree

I’m using code similar to below snippet to load dependencies in specific order

dependencies {
compile fileTree(dir: ‘libs’, include: [‘c.jar’,‘b.jar’,‘a.jar’])
}

Intended order: c -> b -> a
Observed order: a-> b -> c

fileTree seems to sort the jar names automatically which affects order of compilation of jars.

Is there a way to retain intended order of compilation ?

dependencies {
   compile files('libs/c.jar','libs/b.jar','libs/a.jar') 
}
1 Like