GithubHelp home page GithubHelp logo

maxbiu / gradle-project-setup-howto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jjohannes/gradle-project-setup-howto

0.0 0.0 0.0 323 KB

How to structure a growing Gradle project with smart dependency management?

License: Apache License 2.0

Java 25.20% Kotlin 74.80%

gradle-project-setup-howto's Introduction

How to set up a larger Gradle project

This repo shows one possibility to structure a Gradle project when you want:

  • Centralized and maintainable build configuration and custom build logic
  • No dependency hell through smart dependency management with dependency rules and analysis

There are four variations of this available:

The structure though, is good for any kind of project you may build with Gradle (Kotlin, Groovy, Scala, ...)

This is following the same patterns as idiomatic-gradle but is closer to a full setup that also takes the aspect of continuously changing dependencies into account.

Pick one of these similar videos to get a quick overview:

And here is an overview in a Twitter thread:

Project Overview

Different structuring concerns are summarized in commits if you like to explore things one-by-one:

Any kind of project

Any kind of project (except Java Module System)

Android projects

  • Android plugins
    Here, the Application plugins are changed into Android plugins and adjusted to target Android App development using the Android Gradle Plugins.
    • This repo focuses on general project structuring and dependency management with Gradle and does not go into many Android specifics. I recommend to check out https://github.com/android/nowinandroid in addition for that.

Java Module System projects

Kotlin JVM projects

Overview of your Convention Plugins

There is a help task that you can use to get a diagram of the convention plugins defined in the project:

./gradlew :plugins:analysePluginApplicationOrder

The task generates a PlantUML file that you can render, for example, with the PlantUML IntelliJ plugin.

Notes

  • If you have a question, please ask in an issue.
  • The concrete things done in all places (custom tasks, components used in dependencies, additional plugins applied, etc.) are just examples. If you, for example, need to use additional Gradle plugins you can add these in the corresponding place, keeping the suggested structure.
  • This setup uses a platform project to centralize dependency versions. An alternative approach is to use a dependency version catalog. If you prefer to use a catalog, because it is the better fit in your case, you can still follow the setup proposed here (just without the gradle/platform project).

FAQ

More questions or points you would like to discuss? Please open an issue.

gradle-project-setup-howto's People

Contributors

jjohannes 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.