Android gradle version and plugins

Last update: Jun 2, 2022

android-gradle-plugin

Android gradle version and plugins

Version catalogs

Shared catalogs 를 사용한 android version catalogs 입니다.

Usage

settings.gradle.kts에 원격 저장소에 저장된 version catalogs를 생성합니다.

enableFeaturePreview("VERSION_CATALOGS")

dependencyResolutionManagement {
    repositories {
        maven {
            setUrl("https://maven.pkg.github.com/ethanette/android-gradle-plugin")
            credentials {
                username = System.getenv("GITHUB_USERNAME")
                password = System.getenv("GITHUB_ACCESS_TOKEN")
            }
        }
    }

    versionCatalogs {
        create("libs") {
            from("com.github.ethanette:version-catalog:0.1.6")
        }
    }
}

gradle sync 후 다음과 같은 version catalogs에 선언된 라이브러리 사용이 가능합니다. (version-catalog)

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
    alias(libs.plugins.android.application) apply false
    alias(libs.plugins.android.library) apply false
    alias(libs.plugins.jetbrains.kotlinAndroid) apply false
}
dependencies {
    implementation(libs.androidx.core.coreKtx)
    implementation(libs.androidx.compose.ui.ui)
    implementation(libs.androidx.compose.material.material)
    implementation(libs.androidx.compose.ui.uiToolingPreview)
    implementation(libs.androidx.lifecycle.lifecycleRuntimeKtx)
    implementation(libs.androidx.activity.activityCompose)
    testImplementation(libs.junit.junit)
    androidTestImplementation(libs.androidx.test.ext.junit)
    androidTestImplementation(libs.androidx.test.espresso.espressoCore)
    androidTestImplementation(libs.androidx.compose.ui.uiTestJunit4)
    androidTestImplementation(libs.androidx.compose.ui.uiTooling)
}

libs.versions.toml 을 사용하여 version catalogs 를 정의합니다.

libs.versions.toml 파일은 현재 정의된 버전 정보를 확인 할 수 있다.

Gradle Plugin

Custom Gradle Plugins 를 사용한 android custom gradle plugins 입니다.

Usage

settings.gradle.kts에 Gradle Plugin이 저장된 원격 저장소를 설정한다.

pluginManagement {
    repositories {
        maven {
            setUrl("https://maven.pkg.github.com/ethanette/android-gradle-plugin")
            credentials {
                username = System.getenv("GITHUB_USERNAME")
                password = System.getenv("GITHUB_ACCESS_TOKEN")
            }
        }
    }
}

gradle sync 후 프로젝트 build.gradle.kts에 사용하려고 하는 Gradle Plugin을 선언한다.

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
    alias(libs.plugins.ethanette.androidApp) apply false
    alias(libs.plugins.ethanette.compose) apply false
}

gradle sync 후 모듈 build.gradle.kts에 사용하려고 하는 Gradle Plugin을 사용하여 스크립트 설정이 가능합니다.

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
    id(libs.plugins.ethanette.androidApp.get().pluginId)
    id(libs.plugins.ethanette.compose.get().pluginId)
}

android {
    defaultConfig {
        applicationId = "com.bemily.messenger"
        versionName = "1.0.0"
        versionCode = 1
    }

    buildTypes {
        getByName("release") {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
}

dependencies {
    implementation(libs.androidx.core.coreKtx)
    implementation(libs.androidx.lifecycle.lifecycleRuntimeKtx)
    implementation(libs.androidx.activity.activityCompose)
}

GitHub

https://github.com/ethanette/android-gradle-plugin
You might also like...

Gradle plugin which downloads and manages your Android SDK.

 Gradle plugin which downloads and manages your Android SDK.

DEPRECATED This plugin is deprecated and is no longer being developed. Tools and dependencies are automatically downloaded using version 2.2.0 of the

Jul 15, 2022

CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native.

C Klib CKlib is a gradle plugin that will build and package C/C++/Objective-C code for Kotlin/Native. The Problem When you want to access C-etc code f

Jul 14, 2022

🤹 Common Kotlin utilities made for my personal usage, comes with SLF4J utilities, common extensions, common Gradle utilities, and more.

🤹 common-utils Common Kotlin utilities made for my personal usage, comes with SLF4J utilities, common extensions, ansi-colours, common Gradle utiliti

Jan 15, 2022

NukeJangala - Starsector Mod Template using Gradle and IntelliJ

NukeJangala - Starsector Mod Template using Gradle and IntelliJ

Starsector Mod Template using Gradle and IntelliJ v1.2.0 Description This is a t

Jan 4, 2022

NukePlanet - Starsector Mod Template using Gradle and IntelliJ

NukePlanet - Starsector Mod Template using Gradle and IntelliJ

Starsector Mod Template using Gradle and IntelliJ v1.2.0 Description This is a t

Apr 17, 2022

A gradle plugin to optimize built jars through individual file optimizations and increased compression

Machete Machete is a gradle plugin that attempts to optimize the size of output JARs through both individual file optimizations and overall compressio

Jul 5, 2022

[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

[Deprecated] Android Studio IDE support for Android gradle unit tests. Prepared for Robolectric.

#[Deprecated] Google has finally released a proper solution for unit testing. Therefore this plugin will no longer be activlty maintained. android-stu

Nov 6, 2021

A Gradle plugin to support the Groovy language for building Android apps

Groovy language support for Android Deprecated: This plugin has been deprecated in favor of Kotlin which has the full support of JetBrains and Google.

Jul 24, 2022

Add a different ribbon to each of your Android app variants using this gradle plugin. Of course, configure it as you will

Easylauncher gradle plugin for Android Modify the launcher icon of each of your app-variants using simple gradle rules. Add ribbons of any color, over

Jul 30, 2022
Gradle plugin to use git tags as project version names

Version Name Gradle Plugin This plugin adds a kotlin extension function that provides a version name based on the latest git tag. How to use it ?? App

Mar 9, 2022
gradle-android-scala-plugin adds scala language support to official gradle android plugin

gradle-android-scala-plugin gradle-android-scala-plugin adds scala language support to official gradle android plugin. See also sample projects at htt

Aug 16, 2022
Ownership-gradle-plugin - Gradle code ownership verification plugin

Gradle code ownership verification plugin A gradle plugin that will verify owner

Mar 17, 2022
⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the web

Capacitor Firebase ⚡️ Firebase plugins for Capacitor. Supports Android, iOS and the web. Maintainers Maintainer GitHub Social Robin Genz robingenz @ro

Aug 9, 2022
A webserver interface to the same methods and code that Cordova plugins install.

cordova-plugin-webserver Cordova plugin for localhost web server written in Kotlin and Ktor Install plugin cordova plugin add https://github.com/Qbix/

May 5, 2022
My plugins for Aliucord, an android Discord client mod

Ven's Aliucord Plugins Click a Plugin's name to open a more detailed explanation Themer - Download Create and apply custom themes EmojiUtility - Downl

Aug 10, 2022
My (terrible) plugins for Aliucord
My (terrible) plugins for Aliucord

Plugins for Aliucord How to install: Join the Aliucord support server long press on my message in #plugins-list then click "Open PluginDownloader" Man

Aug 6, 2022
Library for testing highlighting in plugins for IDEA in KPHP format.

intellij-kphp-highlighting-test-adapter Library for testing highlighting in plugins for IDEA in KPHP format. Installation Kotlin DSL plugins { id(

Jul 23, 2022
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.

Gradle Play Publisher Gradle Play Publisher is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and

Aug 9, 2022