android-gradle-logic

द्वारा livekit

एक्सपर्ट गाइडेंस ऑन सेटिंग अप स्केलेबल ग्रेडल बिल्ड लॉजिक यूज़िंग कन्वेंशन प्लगइन्स एंड वर्जन कैटलॉग्स।

npx skills add https://github.com/livekit/client-sdk-android --skill android-gradle-logic

Android Gradle Build Logic & Convention Plugins

This skill helps you configure a scalable, maintainable build system for Android apps using Gradle Convention Plugins and Version Catalogs, following the "Now in Android" (NiA) architecture.

Goal

Stop copy-pasting code between build.gradle.kts files. Centralize build logic (Compose setup, Kotlin options, Hilt, etc.) in reusable plugins.

Project Structure

Ensure your project has a build-logic directory included in settings.gradle.kts as a composite build.

root/
├── build-logic/
│   ├── convention/
│   │   ├── src/main/kotlin/
│   │   │   └── AndroidApplicationConventionPlugin.kt
│   │   └── build.gradle.kts
│   ├── build.gradle.kts
│   └── settings.gradle.kts
├── gradle/
│   └── libs.versions.toml
├── app/
│   └── build.gradle.kts
└── settings.gradle.kts

Step 1: Configure settings.gradle.kts

Include the build-logic as a plugin management source.

// settings.gradle.kts
pluginManagement {
    includeBuild("build-logic")
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

Step 2: Define Dependencies in libs.versions.toml

Use the Version Catalog for both libraries and plugins.

[versions]
androidGradlePlugin = "8.2.0"
kotlin = "1.9.20"

[libraries]
# ...

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
# Define your own plugins here
nowinandroid-android-application = { id = "nowinandroid.android.application", version = "unspecified" }

Step 3: Create a Convention Plugin

Inside build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt:

import com.android.build.api.dsl.ApplicationExtension
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure

class AndroidApplicationConventionPlugin : Plugin<Project> {
    override fun apply(target: Project) {
        with(target) {
            with(pluginManager) {
                apply("com.android.application")
                apply("org.jetbrains.kotlin.android")
            }

            extensions.configure<ApplicationExtension> {
                defaultConfig.targetSdk = 34
                // Configure common options here
            }
        }
    }
}

Don't forget to register it in build-logic/convention/build.gradle.kts:

gradlePlugin {
    plugins {
        register("androidApplication") {
            id = "nowinandroid.android.application"
            implementationClass = "AndroidApplicationConventionPlugin"
        }
    }
}

Usage

Apply your custom plugin in your modules (e.g., app/build.gradle.kts):

plugins {
    alias(libs.plugins.nowinandroid.android.application)
}

This drastically cleans up module-level build files.

livekit की और Skills

android-coroutines
livekit
एंड्रॉइड पर Kotlin Coroutines को लागू और समीक्षा करें: CoroutineScopes कॉन्फ़िगर करें, Dispatchers प्रबंधित करें, ViewModels से StateFlow/SharedFlow एक्सपोज़ करें, collect के साथ...
official
livekit-agents
livekit
लाइवकिट क्लाउड पर संरचित वर्कफ़्लो, न्यूनतम विलंबता और अनिवार्य परीक्षण कवरेज के साथ वॉयस एआई एजेंट बनाएं। अलग-अलग एपीआई कुंजियों के बिना प्रबंधित बुनियादी ढांचे और एआई मॉडल के लिए लाइवकिट क्लाउड और लाइवकिट इनफ़रेंस का उपयोग करें। संदर्भ को अलग करने और विलंबता कम करने के लिए हैंडऑफ़ (एजेंट-से-एजेंट संक्रमण) और कार्यों (स्कोप्ड संचालन) के आसपास एजें
official
livekit-simulations
livekit
LiveKit वॉयस या चैट एजेंट के लिए लक्षित परीक्षण परिदृश्य उत्पन्न करें और उन्हें सिमुलेशन के रूप में चलाएं — स्थानीय रूप से, एजेंट के अपने कोड और उपयोगकर्ता की इच्छा के आधार पर…
official
gradle-build-performance
livekit
Android/Gradle बिल्ड प्रदर्शन को डीबग और ऑप्टिमाइज़ करें। जब बिल्ड धीमे हों, CI/CD प्रदर्शन की जाँच कर रहे हों, बिल्ड स्कैन का विश्लेषण कर रहे हों, या पहचान कर रहे हों तो उपयोग करें…
official