Git Product home page Git Product logo

gradledemo's Introduction

kotlin-gradle-plugin-template ๐Ÿ˜

Use this template Pre Merge Checks License Language

A simple Github template that lets you create a Gradle Plugin ๐Ÿ˜ project using 100% Kotlin and be up and running in a few seconds.

This template is focused on delivering a project with static analysis and continuous integration already in place.

How to use ๐Ÿ‘ฃ

Just click on Use this template button to create a new repo starting from this template.

Once created don't forget to update the:

Features ๐ŸŽจ

  • 100% Kotlin-only template.
  • Plugin build setup with composite build.
  • 100% Gradle Kotlin DSL setup.
  • Dependency versions managed via buildSrc.
  • CI Setup with GitHub Actions.
  • Kotlin Static Analysis via ktlint and detekt.
  • Publishing-ready to Gradle Portal.
  • Issues Template (bug report + feature request)
  • Pull Request Template.

Composite Build ๐Ÿ“ฆ

This template is using a Gradle composite build to build, test and publish the plugin. This means that you don't need to run Gradle twice to test the changes on your Gradle plugin (no more publishToMavenLocal tricks or so).

The included build is inside the plugin-build folder.

preMerge task

A preMerge task on the top level build is already provided in the template. This allows you to run all the check tasks both in the top level and in the included build.

You can easily invoke it with:

./gradlew preMerge

If you need to invoke a task inside the included build with:

./gradlew -p plugin-build <task-name>

Dependency substitution

Please note that the project relies on module name/group in order for dependency substitution to work properly. If you change only the plugin ID everything will work as expected. If you change module name/group, things might break and you probably have to specify a substitution rule.

Publishing ๐Ÿš€

This template is ready to let you publish to Gradle Portal.

The Publish Plugin to Portal Github Action will take care of the publishing whenever you push a tag.

Please note that you need to configure two secrets: GRADLE_PUBLISH_KEY and GRADLE_PUBLISH_SECRET with the credetials you can get from your profile on the Gradle Portal.

100% Kotlin ๐Ÿ…บ

This template is designed to use Kotlin everywhere. The build files are written using Gradle Kotlin DSL as well as the Plugin DSL to setup the build.

Dependencies are centralized inside the Dependencies.kt file in the buildSrc folder. Please note that there is another Dependencies.kt inside the included build to keep the versions isolated.

Moreover, a minimalistic Gradle Plugin is already provided in Kotlin to let you easily start developing your own around it.

Static Analysis ๐Ÿ”

This template is using ktlint with the ktlint-gradle plugin to format your code. To reformat all the source code as well as the buildscript you can run the ktlintFormat gradle task.

This template is also using detekt to analyze the source code, with the configuration that is stored in the detekt.yml file (the file has been generated with the detektGenerateConfig task).

CI โš™๏ธ

This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.

There are currently the following workflows available:

Contributing ๐Ÿค

Feel free to open a issue or submit a pull request for any bugs/improvements.

License ๐Ÿ“„

This template is licensed under the MIT License - see the License file for details. Please note that the generated template is offering to start with a MIT license but you can change it to whatever you wish, as long as you attribute under the MIT terms that you're using the template.

gradledemo's People

Contributors

zhouzhitencent avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.