Gradm (Gradle dependencies manager) is a new way to manage dependencies easier and more efficient.

Related tags

Gradle plugin Gradm
Overview

Gradm

Maven Central

Gradm (Gradle dependencies manager) is a new way to manage dependencies easier and more efficient.

Why Gradm?

The Gradle version catalogs is an excellent move for us. But it also brings a lot of problems, and becomes more and more painful:

  • The Generated code is fully Java. Usable, and that's it. Not good for reading.
  • No official dependencies update support.
  • Terrible restrictions, like naming: gradle/gradle#18208, gradle/gradle#18201.
  • And more...?

Gradm was born for the above problems. It has an excellent ability of dependencies management and versions update.

Getting Started

In settings.gradle.kts, add the following:

" } } plugins { id("me.omico.gradm") }">
pluginManagement {
    repositories {
        mavenCentral()
    }
    plugins {
        id("me.omico.gradm") version ""
    }
}

plugins {
    id("me.omico.gradm")
}

Create a file named gradm.yml in your root project directory, and add the following:

gradm:
  rule-version: 1 # Gradm rule version, currently has no effect on this
  format: true # default is false, if you haven't specify
  indent: 4 # default is 2, won't take effect if format is false

versions:
  something: "1.0.0" # create your own version

repositories:
  - id: google
    url: https://maven.google.com/
  - id: your-repo # your own repo id
    url: https://repo.example.com/ # your repo url

dependencies:
  - name: Libs # create your own dependency name
    repository: google # from repositories' id
    libraries:
      - # for final use, libs.company.artifact
        module: my.company.lib:artifact # create your own library
        alias: company.artifact # create your own alias, optional
        # You can use either specific version like "1.0.0" or use version variables.
        # It will use the latest version, if you don't specify version.
        # version: "1.0.0"
        version: ${versions.something}
      - # This style is also acceptable
        # note: if your enable format, it will be override by the "module" style above
        group: my.company.lib
        artifact: artifact2
        version: "1.0.0"
        alias: company.artifact2

For more information, please see the example project.

License

Copyright 2022 Omico

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Gradle Plugin for publishing artifacts to Sonatype and Nexus

Introduction Due to Sonatype's strict validation rules, the publishing requirement must be satisfied by every artifact which wants to be published to

Gradle plugin that parses version updates and assigns them to groups of people.

Notifier Gradle Plugin This gradle plugin serves the need of automating how dependencies are handles in a project. More specifically, it functions usi

How to write Gradle plugins - answers to common questions and alternative implementation solutions
How to write Gradle plugins - answers to common questions and alternative implementation solutions

Gradle Plugins: Why? How? There is some misunderstanding and confusion about the concept of Plugins in Gradle. This is unfortunate, as it is one of th

A Gradle plugin enforcing pre-commit and commit-msg Git hooks configuration

A Gradle plugin enforcing pre-commit and commit-msg Git hooks configuration. Conventional-commits-ready.

Klinker is a gradle plugin making it possible to link kotlin native executables with custom linkers and options.

Klinker is a gradle plugin making it possible to link kotlin native executables with custom linkers and options. It does this by creating a static library for kotlin compilation, then generates a c+kotlin wrapper that calls into kotlin to start the app, finally using the specified compiler to compile and link the c code and kotlin library into a binary.

Gradle plugin to check, if rest-controllers are used by clients and clients have suitable rest-interfaces

Verify-Feign Gradle Plugin This plugin will help you to verify all rest-clients and -controllers in a multimodule spring project. It will check, if al

The core Gradle plugin and associated logic used for Slack's Android app

slack-gradle-plugin This repository contains the core Gradle plugin and associated logic used for Slack's Android app. This repo is effectively read-o

Kmp4free - A Gradle Plugin that allows seamless switching between Kotlin JVM and the Kotlin Multiplatform Plugins
Kmp4free - A Gradle Plugin that allows seamless switching between Kotlin JVM and the Kotlin Multiplatform Plugins

🆓 kmp4free Allows you to toggle between Kotlin JVM Plugin - Kotlin Multiplatform with a Gradle Property kmp4free=true. This Gradle Plugin was built

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically
A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically

A simple gradle plugin that lets you create a download asset from zeplin and convert them to vector drawables automatically elephant project using 100% Kotlin and be up and running in a few seconds.

Comments
  • Gradm 2.x

    Gradm 2.x

    May be changed at any time

    Accomplished

    More compact format for config (#7)

    This new format will take advantage of IDEs' language check to prevent duplicate definitions. Also, this will remove more restrictions on aliases.

    repositories:
      google:
        url: https://maven.google.com/
      mavenCentral:
        url: https://repo1.maven.org/maven2/
    
    dependencies:
      mavenCentral:
        com.google.accompanist:
          accompanist-insets:
            alias: accompanist.insets
            version: ${versions.accompanist}
          accompanist-insets-ui:
            alias: accompanist.insetsUi
            version: ${versions.accompanist}
          accompanist-permissions:
            alias: accompanist.permissions
            version: ${versions.accompanist}
          accompanist-swiperefresh:
            alias: accompanist.swipeRefresh
            version: ${versions.accompanist}
          accompanist-systemuicontroller:
            alias: accompanist.systemUiController
            version: ${versions.accompanist}
        com.squareup.okhttp3:
          logging-interceptor:
            alias: okhttp3.interceptor.logging
            version: ${versions.okhttp}
          okhttp3:
            alias: okhttp3
            version: ${versions.okhttp}
          okhttp-dnsoverhttps:
            alias: okhttp3.dnsOverHttps
            version: ${versions.okhttp}
    
    opened by Omico 1
  • No longer required copy Gradle wrapper

    No longer required copy Gradle wrapper

    Besides, there has a mistake in the copyGradleWrapperToGradmFolder(). gradmProjectPaths should be GradmProjectPaths(path = path.resolve(".gradm").resolve("generated-dependencies")).

    opened by Omico 0
  • Remove more restrictions on versions

    Remove more restrictions on versions

    Currently, the below code will throw an error.

    versions:
      retrofit.converter.kotlinx.serialization: "0.8.0" // error here
    

    You can use the code below as a workaround.

    versions:
      retrofit.converter:
        kotlinx.serialization: "0.8.0" // work as we expect
    
    opened by Omico 0
  • Support Bill of Materials (BOM)

    Support Bill of Materials (BOM)

    Currently, our configuration for BOM in build.gradle.kts will be like this:

    dependencies {
        compileOnly(platform(okhttp.bom))
        compileOnly(okhttp)
        compileOnly(okhttp.dnsOverHttps)
        compileOnly(okhttp.interceptor.logging)
    }
    

    This looks a bit ugly. We could take advantage of kotlinpoet! And it can be like this:

    dependencies {
        compileOnly(okhttp.bom)
        compileOnly(okhttp)
        compileOnly(okhttp.dnsOverHttps)
        compileOnly(okhttp.interceptor.logging)
    }
    

    I thought I could make it in the beginning. But the version of kotlinpoet that supports context receivers starts at 1.12.0, and its bundle Kotlin version is 1.7.0. This suddenly makes Gradle unhappy. Thus, I'm unhappy too. :(

    Such a "dependencies hell" again! People are always facing and being fxxked by the "dependencies hell." Now we could only stare at this branch (bom) and pray Gradle will update its bundled Kotlin to 1.7.x soon, which is impossible. :(

    enhancement 
    opened by Omico 0
Releases(3.0.0)
  • 3.0.0(Jan 3, 2023)

    What's Changed

    • Introduce Gradm 3 by @Omico in https://github.com/Omico/Gradm/pull/43

    Full Changelog: https://github.com/Omico/Gradm/compare/2.6.0...3.0.0

    Source code(tar.gz)
    Source code(zip)
  • 2.6.0(Nov 30, 2022)

    What's Changed

    • Gradle 7.6 and other dependencies by @Omico in https://github.com/Omico/Gradm/commit/deded50569ead55404eacd3c66fe8bdf74163c40
    • Update default configuration format style by @Omico in https://github.com/Omico/Gradm/pull/41
    • Support generate dependency class for BOM by @Omico in https://github.com/Omico/Gradm/pull/42

    Full Changelog: https://github.com/Omico/Gradm/compare/2.5.0...2.6.0

    Source code(tar.gz)
    Source code(zip)
  • 2.5.0(Sep 11, 2022)

    What's Changed

    • Improve build logic mode by @Omico in https://github.com/Omico/Gradm/pull/38
    • codegen: Delete Gradle settings script if switching to another mode by @Omico in https://github.com/Omico/Gradm/pull/39
    • build-logic: Add initialization stage by @Omico in https://github.com/Omico/Gradm/pull/40

    Full Changelog: https://github.com/Omico/Gradm/compare/2.4.0...2.5.0

    Source code(tar.gz)
    Source code(zip)
  • 2.4.0(Aug 13, 2022)

    What's Changed

    • Use new publishing by @Omico in https://github.com/Omico/Gradm/pull/35
    • Add integration testing by @Omico in https://github.com/Omico/Gradm/pull/36
    • Support composite builds, aka build-logic mode by @Omico in https://github.com/Omico/Gradm/pull/37

    Full Changelog: https://github.com/Omico/Gradm/compare/2.3.0...2.4.0

    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Aug 6, 2022)

    What's Changed

    • Improve printing log by @Omico in https://github.com/Omico/Gradm/pull/23
    • Refactor the logic of updating dependencies by @Omico in https://github.com/Omico/Gradm/pull/24
    • Introduce Gradle dependencies analysis by @Omico in https://github.com/Omico/Gradm/pull/25
    • Introduce new Gradm path API by @Omico in https://github.com/Omico/Gradm/pull/27
    • No longer required copy Gradle wrapper by @Omico in https://github.com/Omico/Gradm/pull/28
    • Optimize the generation logic by @Omico in https://github.com/Omico/Gradm/pull/29
    • Support buildSrc by @Omico in https://github.com/Omico/Gradm/pull/30
    • runtime: Fix format style by @Omico in https://github.com/Omico/Gradm/pull/32
    • Support manually disable Gradm by @Omico in https://github.com/Omico/Gradm/pull/33
    • Use a new workaround method to remove imports when configuring Gradm in Settings by @Omico in https://github.com/Omico/Gradm/pull/34

    Full Changelog: https://github.com/Omico/Gradm/compare/2.2.0...2.3.0

    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Jul 19, 2022)

    What's Changed

    • integration: github: Allow partial match by @Omico in https://github.com/Omico/Gradm/pull/14
    • Support for generating no updates dependencies by @Omico in https://github.com/Omico/Gradm/pull/15
    • Avoid Gradle warning for generated dependencies project by @Omico in https://github.com/Omico/Gradm/pull/16
    • Remove more restrictions on versions by @Omico in https://github.com/Omico/Gradm/pull/17
    • Supports unseparated independent alias by @Omico in https://github.com/Omico/Gradm/pull/18
    • runtime: Don't show the updates folder when there are no updates available by @Omico in https://github.com/Omico/Gradm/pull/19
    • Support for dependencies with no specific version by @Omico in https://github.com/Omico/Gradm/pull/20
    • runtime: Support check plugins updates by @Omico in https://github.com/Omico/Gradm/pull/22

    Full Changelog: https://github.com/Omico/Gradm/compare/2.1.0...2.2.0

    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Jul 15, 2022)

    What's Changed

    • Remove more restrictions on versions by @Omico in https://github.com/Omico/Gradm/pull/10
    • Support custom build.gradle.kts for generated dependencies by @Omico in https://github.com/Omico/Gradm/pull/12
    • Support Gradle plugins by @Omico in https://github.com/Omico/Gradm/pull/13

    Full Changelog: https://github.com/Omico/Gradm/compare/2.0.0...2.1.0

    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(Jun 4, 2022)

    What's Changed

    • Introduce a more compact format for config by @Omico in https://github.com/Omico/Gradm/pull/7

    Full Changelog: https://github.com/Omico/Gradm/compare/1.7.0...2.0.0

    Source code(tar.gz)
    Source code(zip)
  • 1.7.0(May 20, 2022)

    What's Changed

    • Configure Gradm in Kotlin script by @Omico in https://github.com/Omico/Gradm/pull/5

    Full Changelog: https://github.com/Omico/Gradm/compare/1.6.0...1.7.0

    Source code(tar.gz)
    Source code(zip)
  • 1.6.0(May 11, 2022)

  • 1.5.0(Apr 1, 2022)

  • 1.4.0(Mar 30, 2022)

    What's Changed

    • Bootstrapping by @Omico in https://github.com/Omico/Gradm/pull/2

    Full Changelog: https://github.com/Omico/Gradm/compare/1.3.0...1.4.0

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Mar 29, 2022)

    What's Changed

    • Introduce Gradm integration API (experimental)
    • Improve 'why' in README.md by @RinOrz in https://github.com/Omico/Gradm/pull/1

    New Contributors

    • @RinOrz made their first contribution in https://github.com/Omico/Gradm/pull/1

    Full Changelog: https://github.com/Omico/Gradm/compare/1.2.0...1.3.0

    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Mar 27, 2022)

  • 1.1.0(Mar 23, 2022)

Owner
null
Graphfity is a Gradle Plugin which creates a dependency node diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module application

Graphfity creates a dependency nodes diagram graph about your internal modules dependencies, specially useful if you are developing a multi-module app

Iván Carrasco 27 Dec 20, 2022
Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Gradle plugin for adds support for integrating Carthage dependencies into a KMM project

Wire Swiss GmbH 34 Sep 27, 2022
EasyVersion is a Gradle plugin that manage your app or library version.

EasyVersion EasyVersion is a Gradle plugin that manage your app or library version. Before Downloading Create easy_version.json in your root project d

Kosh Sergani 8 Nov 26, 2022
Gradle plugin that generates a Swift Package Manager manifest and an XCFramework to distribute a Kotlin Multiplatform library for Apple platforms.

Multiplatform Swift Package This is a Gradle plugin for Kotlin Multiplatform projects that generates an XCFramework for your native Apple targets and

Georg Dresler 262 Jan 5, 2023
Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects

Gradle plugin to ease Kotlin IR plugin development and usage in multimodule gradle projects. Former: kotlin-ir-plugin-adapter-gradle

null 2 Mar 8, 2022
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project

plugin-yml is a simple Gradle plugin that generates the plugin.yml plugin description file for Bukkit plugins, bungee.yml for Bungee plugins or nukkit.yml for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project name, version or description) and additional properties can be added using a simple DSL.

Plexus 0 Apr 10, 2022
Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms.

CompleteKotlin Gradle Plugin to enable auto-completion and symbol resolution for all Kotlin/Native platforms. What this plugin provides This zero-conf

Louis CAD 235 Jan 3, 2023
Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it

decomposer Gradle Plugin that allows you to decompile bytecode compiled with Jetpack Compose Compiler Plugin into Java and check it How to use Run bui

Takahiro Menju 56 Nov 18, 2022
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.

Change Tracker Plugin A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes

Ismael Di Vita 110 Dec 19, 2022
Android Gradle Plugin -- Auto Check big image and compress image in building.

McImage I will continue to update, please rest assured to use 中文文档 Android优雅的打包时自动化获取全部res资源 McImage is a Non-invasive plugin for compress all res in

smallSohoSolo 1.1k Dec 28, 2022