NOTE: You can open this sample in an link:{userManualPath}/gradle_ides.html#gradle_ides[IDE that supports Gradle].

This sample shows how _convention plugins_ can be shared and applied to both the production code and the build logic code in _buildSrc_.

Let's use the following project structure:
====
[.multi-language-sample]
=====
.Project structure
[source, kotlin]
----
├── application
│   ├── src
│   │   └── main
│   └── build.gradle.kts
├── build-conventions
│   ├── src
│   │   ...
│   ├── build.gradle.kts
│   └── settings.gradle.kts
├── buildSrc
│   ├── src
│   │   ...
│   └── build.gradle.kts
├── list
│   ├── src
│   │   ...
│   └── build.gradle.kts
├── utilities
│   ├── src
│   │   ...
│   └── build.gradle.kts
└── settings.gradle.kts
----
=====
[.multi-language-sample]
=====
.Project structure
[source, groovy]
----
├── application
│   ├── src
│   │   └── main
│   └── build.gradle
├── build-conventions
│   ├── src
│   │   ...
│   ├── build.gradle
│   └── settings.gradle
├── buildSrc
│   ├── src
│   │   ...
│   └── build.gradle
├── list
│   ├── src
│   │   ...
│   └── build.gradle
├── utilities
│   ├── src
│   │   ...
│   └── build.gradle
└── settings.gradle
----
=====
====

The build is configured as follows:
====
include::sample[dir="kotlin",files="settings.gradle.kts[]"]
include::sample[dir="groovy",files="settings.gradle[]"]
====

The shared _convention plugin_ `myproject.java-conventions` is implemented in an _included build_ called `build-conventions`.
The build is then included in the root project's _settings_ file as seen in the above snippet.
For more details about included builds, see link:{userManualPath}/composite_builds.html[Composing Builds] chapter.

The `myproject.java-conventions` plugin is then applied to the `buildSrc` build:
====
include::sample[dir="kotlin",files="buildSrc/build.gradle.kts[tags=plugins]"]
include::sample[dir="groovy",files="buildSrc/build.gradle[tags=plugins]"]
====

It is also applied in the subprojects of the root project:
====
include::sample[dir="kotlin",files="application/build.gradle.kts[tags=plugins];utilities/build.gradle.kts[tags=plugins];list/build.gradle.kts[tags=plugins]"]
include::sample[dir="groovy",files="application/build.gradle[tags=plugins];utilities/build.gradle[tags=plugins];list/build.gradle[tags=plugins]"]
====

For more details on authoring custom Gradle plugins, consult the link:{userManualPath}/custom_plugins.html[user manual].
