Skip to content

Commit

Permalink
Configuration cache preparations (#711)
Browse files Browse the repository at this point in the history
* working configuration cache for project (disabled for now)

* remove unused dependencies declarations

* update nebula plugin, fixing nebula-plugins/nebula-project-plugin#67
  • Loading branch information
dsvoronin authored Jan 18, 2021
1 parent 552e10b commit 35563bd
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 28 deletions.
6 changes: 2 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinBasePluginWrapper
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

buildscript {
buildscript {
dependencies {
classpath("com.avito.android:buildscript")
}
dependencies {
classpath("com.avito.android:buildscript")
}
}

Expand Down
1 change: 0 additions & 1 deletion buildscript/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ group = "com.avito.android"
repositories {
jcenter()
}

6 changes: 2 additions & 4 deletions buildscript/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object Dependencies {
const val mockito = "3.3.3"
const val detekt = "1.10.0"
const val coroutines = "1.3.7"
val androidGradlePlugin: String = System.getProperty("androidGradlePluginVersion")
const val androidGradlePlugin: String = "4.1.1"
}

const val kotlinXCli = "org.jetbrains.kotlinx:kotlinx-cli:0.2.1"
Expand Down Expand Up @@ -58,8 +58,6 @@ object Dependencies {
const val commonsLang = "org.apache.commons:commons-lang3:3.8.1"
const val antPattern = "io.github.azagniotov:ant-style-path-matcher:1.0.0"
const val dockerClient = "de.gesellix:docker-client:2019-11-26T12-39-35"
const val detektParser = "io.gitlab.arturbosch.detekt:detekt-parser:${Versions.detekt}"
const val detektCli = "io.gitlab.arturbosch.detekt:detekt-cli:${Versions.detekt}"

// https://r8.googlesource.com/r8/
// 1.6.x <-> AGP 3.6.x
Expand All @@ -75,7 +73,7 @@ object Dependencies {
const val freeReflection = "me.weishu:free_reflection:2.2.0"

object Gradle {
val androidPlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
const val androidPlugin = "com.android.tools.build:gradle:${Versions.androidGradlePlugin}"
const val kotlinPlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin"

object Avito {
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx4g -XX:+UseGCOverheadLimit -XX:GCTimeLimit=10 -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
# TODO AGP blocker, fixed in 4.2.+
# Plugin 'com.android.internal.library': registration of listener on 'TaskExecutionGraph.addTaskExecutionListener' is unsupported
org.gradle.unsafe.configuration-cache=false
# mandatory from AGP 3.6
android.useAndroidX=true
# Current stable version to be used in this project
infraVersion=2021.1.7
systemProp.kotlinVersion=1.4.21
systemProp.androidGradlePluginVersion=4.1.1
avito.build=local
avito.git.state=local
# Without it failed on studio sync when ci=true. It happens because studio makes eager configuration of each register task.
Expand Down
6 changes: 2 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ pluginManagement {

val artifactoryUrl: String? by settings
val infraVersion: String by settings
val kotlinVersion: String by System.getProperties()
val androidGradlePluginVersion: String by System.getProperties()

repositories {
exclusiveContent {
Expand Down Expand Up @@ -120,10 +118,10 @@ pluginManagement {
val pluginId = requested.id.id
when {
pluginId.startsWith("com.android.") ->
useModule("com.android.tools.build:gradle:$androidGradlePluginVersion")
useModule("com.android.tools.build:gradle:4.1.1")

pluginId.startsWith("org.jetbrains.kotlin.") ->
useVersion(kotlinVersion)
useVersion("1.4.21")

pluginId.startsWith("com.avito.android") ->
useModule("com.avito.android:${pluginId.removePrefix("com.avito.android.")}:$infraVersion")
Expand Down
11 changes: 8 additions & 3 deletions subprojects/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@ kotlin.code.style=official
org.gradle.jvmargs=-Xmx4g -XX:+UseGCOverheadLimit -XX:GCTimeLimit=10 -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.caching=true
# TODO AGP blocker, fixed in 4.2.+
# Plugin 'com.android.internal.library': registration of listener on 'TaskExecutionGraph.addTaskExecutionListener' is unsupported
# AGP tasks would not be cacheable
org.gradle.unsafe.configuration-cache=false
# TODO last two errors here: https://youtrack.jetbrains.com/issue/KT-43605
# should be ok to use it because properties are `java.rmi.server.hostname` and `kotlin.environment.keepalive`
# which should not change on local machine
org.gradle.unsafe.configuration-cache-problems=fail
# Mandatory from AGP 3.6
android.useAndroidX=true
# The next version of all artifacts
# Scheme: year.<version>
projectVersion=2021.2
# TODO: MBS-9285 - https://github.com/gradle/gradle/issues/12660
systemProp.kotlinVersion=1.4.21
systemProp.androidGradlePluginVersion=4.1.1
# Disable console output https://github.com/autonomousapps/dependency-analysis-android-gradle-plugin/issues/202
systemProp.dependency.analysis.silent=true
17 changes: 7 additions & 10 deletions subprojects/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ include(":ci:k8s-deployments-cleaner")

pluginManagement {

val kotlinVersion: String by System.getProperties()
val androidGradlePluginVersion: String by System.getProperties()

repositories {
exclusiveContent {
forRepository {
Expand All @@ -133,8 +130,8 @@ pluginManagement {
includeGroup("com.gradle")
includeGroup("com.gradle.enterprise")
includeGroup("org.jetbrains.kotlin.jvm")
includeGroupByRegex("nebula\\..*")
includeGroup("com.jfrog.bintray")
includeGroup("nebula.integtest")
includeGroup("io.gitlab.arturbosch.detekt")
includeGroup("com.autonomousapps.dependency-analysis")
}
Expand All @@ -149,22 +146,21 @@ pluginManagement {
}
}

plugins {
id("nebula.integtest") version "7.0.7"
}

resolutionStrategy {
eachPlugin {
val pluginId = requested.id.id
when {
pluginId.startsWith("com.android.") ->
useModule("com.android.tools.build:gradle:$androidGradlePluginVersion")
useModule("com.android.tools.build:gradle:4.1.1")

pluginId.startsWith("org.jetbrains.kotlin.") ->
useVersion(kotlinVersion)
useVersion("1.4.21")

pluginId == "com.autonomousapps.dependency-analysis" ->
useVersion("0.55.0")

pluginId == "nebula.integtest" ->
useVersion("8.0.0")
}
}
}
Expand Down Expand Up @@ -192,6 +188,7 @@ dependencyResolutionManagement {
includeModuleByRegex("com\\.google\\.android.*", ".*")
includeGroupByRegex("androidx\\..*")
includeGroup("com.google.test.platform")
includeGroup("com.google.testing.platform")
}
}
}
Expand Down

0 comments on commit 35563bd

Please sign in to comment.