BuildSrc Layout + Custom Component

I’m planning to make a few plugins to assist my build using buildSrc in a standalone project. And struggling to string together some of the examples.

Below is the project setup and source. Please help explain what I’m doing wrong, and why moving a working plugin to buildSrc is no longer being applied to my project/model. The example customComponent is from the build.gradle file in /samples/customModel/componentType moved to MyPlugin.groovy

build.gradle
import comp.plugins.MyPlugin
apply plugin : MyPlugin
apply plugin : ‘c’
model {
components {
main (NativeExecutableSpec) {
sources {
c {
lib library: “myLib”, linkage: ‘static’
}
}
}
myLib (NativeLibrarySpec) {
}
myComp(ImageComponent) {
}
}
}

buildSrc/build.gradle
apply plugin : ‘groovy’
subprojects {
apply plugin : ‘groovy’

dependencies {
    compile gradleApi()
    compile localGroovy()
}
rootProject.dependencies {
    runtime project(path)
    //runtime subprojects.findAll { it.getTasksByName("jar", false) }
    //runtime subprojects.collect { project(it.path) }
}

}
dependencies {
runtime subprojects.findAll { it.getTasksByName(“jar”, false) }
runtime subprojects.collect { project(it.path) }
}
/*
allprojects { project ->
project.buildDir = buildDir
}
*/
tree -A:
├── build.gradle
├── buildSrc
│ ├── build.gradle
│ ├── customComponent
│ │ └── src
│ │ └── main
│ │ ├── groovy
│ │ │ └── comp
│ │ │ └── plugins
│ │ │ └── MyPlugin.groovy
│ │ └── resources
│ │ └── META-INF
│ │ └── gradle-plugins
│ │ └── comp.properties
│ └── settings.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── README.md
├── settings.gradle
└── src

MyPlugin.groovy is a single groovy file with classes/interfaces copy/pasted from aforementioned sample.

Build error:
A problem occurred configuring root project ‘TestPlugin’.

Exception thrown while executing model rule: components { … } @ build.gradle line 7, column 2
No such property: ImageComponent for class: org.gradle.model.ModelMap