What does "apply from" actually apply?

Coming off my previous question “Configuring a multi project using an external build script”, I wish to extend that pattern using “apply from” to apply defined properties. I find this doesn’t work. It seems to work for tasks but not for properties.

I want to take the same external file (rpm_defaults.gradle),

println "configuring $project" task hiya << { task -> println 'hiya from rpm_defaults in project ' + project.name}

but modify it so that it also defines some properties:

def myProperty='get off my lawn' println "configuring $project" task hiya << { task -> println 'hiya from rpm_defaults in project ' + project.name}

I want to apply this external file through my parent as before.
Base directory build.gradle:

subprojects {
        apply from: '../../rpm_defaults/rpm_defaults.gradle'
 }

Base directory settings.gradle
include 'p1','p2','p3'

But I find that although the task defined in rpm_defaults.gradle is “injected” (is that the correct word?) into all the children of the parent project, the property I have defined does not, If I attempt to use it I get an error.

How may I define such a property in this external project and access it in child projects?

The def keyword in Groovy simply defines a local scope variable. In this case the scope is that particular build script. You can make the property available to the project by using extra properties.

ext {
    myProperty = 'get off my lawn'
}