Shared generic utilities for appKODE Gradle plugins.
Published to Maven Central.
implementation("ru.kode.android:gradle-plugin-commons:1.0.0")Shared logging abstraction for plugins, independent of any specific logging backend.
PluginLogger— logging interface (info/warn/error, etc.).DefaultPluginLogger— default implementation.LoggerService— GradleBuildServicethat shares one logger across tasks/plugins in a build.pluginLoggerFromLog/pluginLoggerFromLogger— factories for wrapping a simple lambda or a GradleLogger.
Register it via Project.getOrRegisterLoggerService().
buildBasicAuthInterceptor— OkHttp interceptor for Basic Auth requests.addProxyIfAvailable(onOkHttpClient.Builder) /ProxyAuthenticator— HTTP and HTTPS proxy support, auto-detected from environment variables and system properties.buildLoggingInterceptor— HTTP logging interceptor wired to aPluginLogger.Call<Unit>.executeNoResult()— RetrofitCallextension for fire-and-forget requests.SecretRedaction— masks tokens/credentials before they hit logs.
MergeStrategy/CollectionStrategy— merge vs. replace semantics for scalar and collection properties.CommonConfigMergeable<T>— contract for config types that can inherit from a common config.inheritFrom/inheritNamedFrom— implements acommon { }+buildVariant("x") { }DSL pattern for plugin extensions, mirroring AGP'sdefaultConfig+ product flavors.
GradleApiExtensions—common/buildVariantextension functions onNamedDomainObjectContainer.configureGroovy— lets consumers configure types via a GroovyClosure.PluginSetupExtensions.applyWithOptionalAndroid— runs a block only when the Android Gradle Plugin is applied.
PluginConfigurableExtension— base class for extensions with a common + per-variant configuration shape.PluginDomainObjectContainer— domain object container backing that shape.BasicAuthConfig/BasicAuthCredentials— reusable Basic Auth configuration model.
StringExtensions—capitalized,ellipsizeAt,mask,replaceLast.ServiceNaming.serviceName— deterministic, per-project build service names.
- JVM 17 toolchain.
- A Gradle plugin project.
- Kotlin 2.4.0.
- AGP 9.2.1 as
compileOnly— consumers supply AGP at their own version.
./gradlew build
./gradlew test
./gradlew ktlintCheck detektPushing a tag triggers .github/workflows/release.yml, which publishes to Maven Central via the vanniktech publishAndReleaseToMavenCentral plugin with a signed release. See CHANGELOG.md for version history.