Posts

Showing posts with the label Kotlin

Example getting properties value from settings.gradle.kts

pluginManagement { resolutionStrategy { eachPlugin { // Work around https://github.com/gradle/gradle/issues/1697. if (requested.version == null) { def pluginName = requested.id.name.split('-').collect { it.capitalize() }.join().uncapitalize() def versionPropertyName = (requested.id.id == 'org.jetbrains.kotlin.jvm') ? "kotlinPluginVersion" : "${pluginName}PluginVersion" logger.info("Checking for plugin version property '$versionPropertyName'.") if (gradle.rootProject.hasProperty(versionPropertyName)) { def version = gradle.rootProject.properties[versionPropertyName] logger.info("Setting '${requested.id.id}' plugin version to $version.") useVersion version } else { logger.warn("No version specif

build.gradle with custom repository

Fix missing dependencies from your gradle project (android, maven, etc) with this build.gradle. insert into YOUR_PROJECT_GRADLE/build.gradle // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { maven { url "https://maven.google.com" } jcenter() maven { url "https://jitpack.io" } maven { url "https://dl.bintray.com/android/android-tools" } maven { url "https://plugins.gradle.org/m2/" } maven { url "https://maven.fabric.io/public" } mavenCentral() mavenLocal() } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' } } allprojects { repositories { maven { url "https://maven.google.com" } jcenter() maven { url "https://jitpack.io" } maven { url "https://dl.bintray.com/android/android-tools"