I want to create a standalone Gradle plugin project as described in the Gradle documentation. I would like to use IntelliJ with code completion for Groovy and Gradle. Since there is no specialized wizard to create a Gradle plugin project I have to do it manually.
I already managed to add the Groovy SDK (binary) in the IDE via: File / Other Settings / Default Project Structure as shown in the screenshot.
To start with I created a new Gradle project which also contains the Gradle wrapper. I then create a Groovy script named MyExamplePlugin.groovy
following the project structure of the sdk-manager-plugin; please note me if this project does not follow the desired setup.
.
├── MyExamplePlugin.iml
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── plugin
│ └── src
│ └── main
│ ├── groovy
│ │ └── com
│ │ └── example
│ │ └── MyExamplePlugin.groovy
│ └── resources
│ └── META-INF
│ └── gradle-plugins
│ └── myexample.properties
└── settings.gradle
Then I start implementing the class:
import org.gradle.api.Plugin
import org.gradle.api.Project
class MyExamplePlugin implements Plugin<Project> {
// ...
}
The problem is that org.gradle.api.*
cannot be found.