Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
rivancic committed May 29, 2021
1 parent a4b7107 commit ba17338
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions precompiled-plugin/precompiled-script-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Precompiled Script Plugin

Till now all the build logic was contained in the build script. Precompiled script plugin allow you to package whole
Till now all the build logic was contained in the build script. Precompiled script plugin allows you to package whole
build script written in DSL language as in Groovy or Kotlin to package it as a plugin from buildSrc directory.
It will be compiled into class files and packaged into a jar. For all intents and purposes, they are binary plugins and
can be applied by plugin ID, tested and published as binary plugins.

The benefit you will now receive is that you can extract step by step build logic in stand-alone classes inside the
buildSrc directory or add new logic in same way. This can be an intermediate step to rewriting script logic into
The benefit you will now receive is that build logic can be extracted step by step in stand-alone classes inside the
buildSrc directory. In the same way new build logic can be added. This can be an intermediate step at rewriting script logic into
precompiled or stand-alone binary plugin.

In this project we will builds on top of [previous project](../../script-plugin/simple-script-plugin), it moves build
logic into separate module. Plugin will still be defined in a script file. To create a plugin out of build script under buildSrc we
In this project we will build on top of [previous simple script plugin](../../script-plugin/simple-script-plugin) We will transfer build
logic into separate module. Plugin will still be defined in a script file. To create an actual plugin out of build script under buildSrc we
have to add [groovy-gradle-plugin](https://plugins.gradle.org/plugin/dev.gradleplugins.groovy-gradle-plugin) to buildSrc itself.

## Code structure

Script for the plugin has to be located under buildScr/main/groovy or buildSrc/main/kotlin package.
Script for the plugin has to be located under `buildScr/main/groovy` or `buildSrc/main/kotlin` package.
The name of the plugin by which you will be able to reference it will be the same as the filename of the script itself
without the extension. In case that the filename is **precompiled-script-plugin.gradle** Then the
plugin id will be filename without the extension (.gradle).
plugin id will be filename without the extension **.gradle**.

- Filename: precompiled-script-plugin.gradle
- Plugin id: precompiled-script-plugin
Expand All @@ -33,10 +33,10 @@ Gradle script defined in buildSrc will be available to all the build scripts ins

### Project

Applying plugin that is compiled in buildSrc from the script and made available for all the projects.
Project itself is applying plugin that is compiled in buildSrc from the script and made available for all the projects.

### buildSrc

Containing Gradle script that will be available as a plugin. It's compiled with the help of groovy-gradle-plugin.
Content will be compiled and result persisted in internal build folder.
Containing Gradle script that will be compiled as a plugin. This will be done with the help of groovy-gradle-plugin.
Content will be compiled and result persisted in internal build folder as a buildSrc.jar.

0 comments on commit ba17338

Please sign in to comment.