-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Gradle Binary Plugin | ||
|
||
This directory contains assignments and examples with the focus on standalone Gradle binary plugins. | ||
|
||
| Module | Description | Resources | | ||
| ------------- |:-------------:|-------------:| | ||
| **[binary-plugin-example](binary-plugin-example)** | Example showing necessary components of binary plugin, utilities that `gradle-java-plugin` plugin offers to ease up plugin binary plugin compilation and packaging. Publishing of plugin to local, private remote Maven repository or Gradle Plugin Portal is also covered. | [Binary Plugin Lecture](https://www.udemy.com/course/gradle-development/learn/lecture/28264772#overview) | |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Binary Plugin Example | ||
|
||
This project serves as a template for Gradle binary plugin, it contains minimal content to compile it. It also contains | ||
source code for following lecture [Gradle Plugin Development - Binary Plugin](https://www.udemy.com/course/gradle-development/learn/lecture/28264772#overview). | ||
|
||
To successfully create a plugin you should: | ||
- Import `java-gradle-plugin` core Gradle plugin | ||
- Create class implementing `Plugin` interface and extending `apply()` method | ||
- Define plugin descriptor in `build.gradle` script file | ||
|
||
First of, this is a standalone project with the JVM structure. | ||
|
||
## Plugin class | ||
|
||
Inside of `src/main/java` directory there is [GreetingPlugin](src/main/java/com/rivancic/gradle/plugin/greeting/GreetingPlugin.java) class implementing Plugin interface. | ||
In order to be able to refer to Gradle API components like Plugin interface you should apply plugin `java-gradle-plugin` | ||
inside `build.gradle` file. | ||
|
||
Plugin will print simple logging statement at the configuration time of the project, | ||
to proof that the plugin is applied. | ||
|
||
## Plugin descriptor | ||
|
||
In order that plugin descriptor will be generated you have to specify plugins inside the | ||
`gradlePlugin{}` block. | ||
|
||
|
||
## Resources | ||
|
||
[Gradle Plugin Development Plugin (Gradle Userguide)](https://docs.gradle.org/current/userguide/java_gradle_plugin.html) | ||
|
||
[Developing Custom Gradle Plugins (Gradle Userguide)](https://docs.gradle.org/current/userguide/java_gradle_plugin.html) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* Core <a href="https://docs.gradle.org/current/userguide/java_gradle_plugin.html">Java Gradle Plugin</a>. It simplifies | ||
* compilation and publishing of Gradle binary plugins. | ||
* | ||
*/ | ||
plugins { | ||
id 'java-gradle-plugin' | ||
} | ||
|
||
group 'com.rivancic' | ||
version '0.1.0' | ||
|
||
/** | ||
* An extension for java-gradle-plugin in which we define all the plugins that this project will create. | ||
* Each plugin should have name, id and an implementationClass defined. | ||
* During the jar task it will be verified that plugin descriptor is correct. implementationClass has to be an existing | ||
* class implementing Plugin interface. | ||
*/ | ||
gradlePlugin { | ||
plugins { | ||
create("greetingPlugin") { | ||
id = "com.rivancic.greeting-plugin" | ||
implementationClass = "com.rivancic.gradle.plugin.greeting.GreetingPlugin" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |