Skip to content

Commit

Permalink
MBS-11239 Remove GradleLoggerPlugin usages (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
sboishtyan authored Dec 2, 2021
1 parent 7cabdf2 commit 937f327
Show file tree
Hide file tree
Showing 198 changed files with 488 additions and 1,051 deletions.
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ include(":subprojects:logger:logger")
include(":subprojects:logger:sentry-logger")
include(":subprojects:logger:elastic-logger")
include(":subprojects:logger:android-logger")
include(":subprojects:logger:slf4j-gradle-logger")

include(":subprojects:delivery:artifactory-app-backup")
include(":subprojects:delivery:cd")
Expand Down
1 change: 0 additions & 1 deletion subprojects/assemble/build-checks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {

dependencies {
implementation(projects.subprojects.gradle.buildFailer)
implementation(projects.subprojects.logger.gradleLogger)
implementation(projects.subprojects.gradle.android)
implementation(projects.subprojects.gradle.impactShared)
implementation(projects.subprojects.assemble.buildMetricsTracker)
Expand Down
10 changes: 2 additions & 8 deletions subprojects/assemble/build-checks/locking/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ com.android.tools:sdk-common:30.0.2=compileClasspath,gradleTestCompileClasspath,
com.android.tools:sdklib:30.0.2=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.android:signflinger:7.0.2=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.android:zipflinger:7.0.2=compileClasspath,gradleTestCompileClasspath,gradleTestCompileOnly,gradleTestCompileOnlyDependenciesMetadata,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,gradleTestRuntimeOnlyDependenciesMetadata,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.fasterxml.jackson.core:jackson-core:2.9.9=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.github.gundy:semver4j:0.16.4=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.google.android:annotations:4.1.1.4=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.google.api.grpc:proto-google-common-protos:1.12.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
Expand All @@ -64,13 +63,10 @@ com.google.truth:truth:1.0=gradleTestCompileClasspath,gradleTestImplementationDe
com.googlecode.java-diff-utils:diffutils:1.3.0=gradleTestCompileClasspath,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.googlecode.json-simple:json-simple:1.1=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.googlecode.juniversalchardet:juniversalchardet:1.0.3=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.okhttp3:logging-interceptor:4.9.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.okhttp3:mockwebserver:4.9.0=gradleTestCompileClasspath,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath
com.squareup.okhttp3:okhttp:4.9.0=gradleTestCompileClasspath,gradleTestCompileOnly,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.okhttp3:okhttp:4.9.0=gradleTestCompileClasspath,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath
com.squareup.okio:okio-metadata:2.8.0=gradleTestImplementationDependenciesMetadata
com.squareup.okio:okio:2.8.0=gradleTestCompileClasspath,gradleTestCompileOnly,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.retrofit2:converter-gson:2.9.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.retrofit2:retrofit:2.9.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup.okio:okio:2.8.0=gradleTestCompileClasspath,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath
com.squareup:javapoet:1.10.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
com.squareup:javawriter:2.5.0=compileClasspath,gradleTestCompileClasspath,gradleTestCompileOnly,gradleTestCompileOnlyDependenciesMetadata,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,gradleTestRuntimeOnlyDependenciesMetadata,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
com.sun.activation:javax.activation:1.2.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
Expand Down Expand Up @@ -101,7 +97,6 @@ io.netty:netty-resolver:4.1.34.Final=gradleTestCompileOnly,gradleTestRuntimeClas
io.netty:netty-transport:4.1.34.Final=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
io.opencensus:opencensus-api:0.21.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
io.opencensus:opencensus-contrib-grpc-metrics:0.21.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
io.sentry:sentry:1.7.23=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
it.unimi.dsi:fastutil:8.4.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
jakarta.activation:jakarta.activation-api:1.2.1=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
jakarta.xml.bind:jakarta.xml.bind-api:2.3.2=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
Expand Down Expand Up @@ -179,7 +174,6 @@ org.ow2.asm:asm-commons:7.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,run
org.ow2.asm:asm-tree:7.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
org.ow2.asm:asm-util:7.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
org.ow2.asm:asm:7.0=compileClasspath,gradleTestCompileClasspath,gradleTestCompileOnly,gradleTestCompileOnlyDependenciesMetadata,gradleTestImplementationDependenciesMetadata,gradleTestRuntimeClasspath,gradleTestRuntimeOnlyDependenciesMetadata,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath
org.slf4j:slf4j-api:1.7.24=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
xerces:xercesImpl:2.12.0=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
xml-apis:xml-apis:1.4.01=gradleTestCompileOnly,gradleTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ internal class BuildChecksTestProjectRunner(
}
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.build-checks")
},
modules = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ internal class ConfigurationCacheCompatibilityTest {
TestProjectGenerator(
name = "rootapp",
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.build-checks")
},
buildGradleExtra = """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ internal class UniqueAppResourcesTest {
fun `success - unique resources`() {
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.impact")
},
modules = listOf(
Expand Down Expand Up @@ -77,7 +76,6 @@ internal class UniqueAppResourcesTest {
}
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.impact")
},
modules = listOf(
Expand Down Expand Up @@ -129,7 +127,6 @@ internal class UniqueAppResourcesTest {
}
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.impact")
},
modules = listOf(
Expand Down Expand Up @@ -182,7 +179,6 @@ internal class UniqueAppResourcesTest {
}
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.impact")
},
modules = listOf(
Expand Down Expand Up @@ -222,7 +218,6 @@ internal class UniqueAppResourcesTest {
fun `fail - invalid resource type in a config`() {
TestProjectGenerator(
plugins = plugins {
id("com.avito.android.gradle-logger")
id("com.avito.android.impact")
},
modules = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import com.avito.android.build_checks.internal.unique_app_res.UniqueAppResources
import com.avito.android.build_checks.internal.unique_r.UniqueRClassesTaskCreator
import com.avito.android.withAndroidApp
import com.avito.kotlin.dsl.isRoot
import com.avito.logger.GradleLoggerPlugin
import com.avito.logger.create
import org.gradle.api.JavaVersion
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -57,9 +55,7 @@ public open class BuildParamCheckPlugin : Plugin<Project> {
val envInfo = BuildEnvironmentInfo(project.providers)

project.afterEvaluate {
val loggerFactory = GradleLoggerPlugin.getLoggerFactory(project).get()
val logger = loggerFactory.create<BuildParamCheckPlugin>()
BuildEnvLogger(project, logger, envInfo).log()
BuildEnvLogger(project, envInfo).log()
val checks = extension.enabledChecks()

checks.filterIsInstance<RequireValidation>()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ package com.avito.android.build_checks.internal
import com.avito.android.AndroidSdk
import com.avito.kotlin.dsl.getBooleanProperty
import com.avito.kotlin.dsl.getOptionalStringProperty
import com.avito.logger.Logger
import com.avito.utils.gradle.buildEnvironment
import org.gradle.api.Project
import org.gradle.api.invocation.Gradle
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion

internal class BuildEnvLogger(
private val project: Project,
private val logger: Logger,
private val envInfo: BuildEnvironmentInfo,
) {

Expand All @@ -22,7 +20,7 @@ internal class BuildEnvLogger(
val kaptMapDiagnosticLocations = project.getBooleanProperty("kaptMapDiagnosticLocations")
val javaIncrementalCompilation = project.getBooleanProperty("javaIncrementalCompilation")

logger.info(
project.logger.info(
"""Config information for project: ${project.displayName}:
BuildEnvironment: ${project.buildEnvironment}
${startParametersDescription(project.gradle)}
Expand Down
3 changes: 0 additions & 3 deletions subprojects/assemble/build-metrics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ plugins {
dependencies {
implementation(projects.subprojects.common.math)
implementation(projects.subprojects.gradle.buildEnvironment)
implementation(projects.subprojects.logger.gradleLogger)
implementation(projects.subprojects.assemble.gradleProfile)
implementation(projects.subprojects.assemble.criticalPath.api)
implementation(projects.subprojects.assemble.buildMetricsTracker)
Expand All @@ -22,15 +21,13 @@ dependencies {
testImplementation(libs.mockitoKotlin)
testImplementation(libs.mockitoJUnitJupiter)
testImplementation(testFixtures(projects.subprojects.common.graphite))
testImplementation(testFixtures(projects.subprojects.logger.logger))
testImplementation(testFixtures(projects.subprojects.common.statsd))
testImplementation(testFixtures(projects.subprojects.gradle.buildEnvironment))

gradleTestImplementation(projects.subprojects.common.junitUtils)
gradleTestImplementation(projects.subprojects.common.testOkhttp)
gradleTestImplementation(projects.subprojects.gradle.testProject)
gradleTestImplementation(projects.subprojects.gradle.git)
gradleTestImplementation(testFixtures(projects.subprojects.logger.logger))
}

gradlePlugin {
Expand Down
Loading

0 comments on commit 937f327

Please sign in to comment.