Apply from behaves differently


I am trying out one of the newer snapshot builds and there is a difference between how the "apply from: " is working. Basically I want to move out some common changes to the model out to seperate file, specifically native prebuilt libraries:

model {
  repositories {
    libs(PrebuiltLibraries) {
      some-common-prebuilt-lib {
        binaries.withType(StaticLibraryBinary) {
          staticLibraryFile = file("${project.rootDir}/<path-to-lib>/<libname>.a")

This is then applied to in build.gradle file:

apply plugin: 'cpp'
apply plugin: 'c'
apply from: "<path-common-prebuilt-libs>"

This worked with build and is not working with

I am aware that the snapshot builds may contain breaking changes I just wanted to double check if this intentional and if it is what would be the correct way to seperate out common build elements.

Regards, Ante

Hi Ante,

I tried to recreate your problem with that snapshot and it seems to work. Do you know what sort of error you were getting?

I had to remove the ‘-’ in your prebuilt library name and I defined one NativeExecutableSpec with a dependency on the prebuilt lib.

Did you have any prebuilt libraries in the main build.gradle?

Hi Sterling,

I did have prebuilt libs in the main build.gradle, but I tried it out again today and it seems to work now. So it must be a mistake on my end then.

Regards, Ante