From 5e0b842795d5080ba0e2180728cb8c671c78fd81 Mon Sep 17 00:00:00 2001 From: cpacm Date: Fri, 17 Nov 2023 16:01:38 +0800 Subject: [PATCH] Fix/warn (#22) * v3.5.2 * now log.warn control by LOG_ENABLED * saas plugin params include enableRn --- .../kotlin/com/growingio/android/plugin/util/LogUtils.kt | 6 ++++-- autotracker-gradle-plugin/build.gradle.kts | 4 ++-- .../com/growingio/android/plugin/SaasAutoTrackerPlugin.kt | 1 + .../android/plugin/visitor/SaasAutoTrackerFactory.kt | 3 +++ .../kotlin/com/growingio/android/plugin/util/FilterUtils.kt | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/autotracker-gradle-plugin/agp-wrapper/src/main/kotlin/com/growingio/android/plugin/util/LogUtils.kt b/autotracker-gradle-plugin/agp-wrapper/src/main/kotlin/com/growingio/android/plugin/util/LogUtils.kt index df06e9b..9874db5 100644 --- a/autotracker-gradle-plugin/agp-wrapper/src/main/kotlin/com/growingio/android/plugin/util/LogUtils.kt +++ b/autotracker-gradle-plugin/agp-wrapper/src/main/kotlin/com/growingio/android/plugin/util/LogUtils.kt @@ -31,8 +31,10 @@ fun info(message: String) { } fun w(message: String, cause: Throwable? = null) { - System.err.println("[GIO.warn] $message") - cause?.printStackTrace(System.err) + if (LOG_ENABLE) { + System.err.println("[GIO.warn] $message") + cause?.printStackTrace(System.err) + } } fun e(message: String, cause: Throwable? = null) { diff --git a/autotracker-gradle-plugin/build.gradle.kts b/autotracker-gradle-plugin/build.gradle.kts index 9c6aa63..9156fdc 100644 --- a/autotracker-gradle-plugin/build.gradle.kts +++ b/autotracker-gradle-plugin/build.gradle.kts @@ -3,8 +3,8 @@ buildscript { set("kotlin_version", "1.8.20") set("agp_version", "8.1.0") set("low_agp_version", "4.2.2") - set("releaseVersion", "3.5.2") - set("releaseVersionCode", 30502) + set("releaseVersion", "3.5.3") + set("releaseVersionCode", 30503) set("saasVersion", "2.10.0") set("saasVersionCode", "21000") diff --git a/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/SaasAutoTrackerPlugin.kt b/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/SaasAutoTrackerPlugin.kt index bb09ce3..e7b712b 100644 --- a/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/SaasAutoTrackerPlugin.kt +++ b/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/SaasAutoTrackerPlugin.kt @@ -81,6 +81,7 @@ class SaasAutoTrackerPlugin @Inject constructor(val instantiator: Instantiator) params.excludePackages.set(gioExtension.excludePackages ?: arrayOf()) params.includePackages.set(gioExtension.includePackages ?: arrayOf()) params.injectClasses.set(gioExtension.injectClasses ?: arrayOf()) + params.enableRn.set(gioExtension.enableRn) } androidComponent.setAsmFramesComputationMode(FramesComputationMode.COMPUTE_FRAMES_FOR_INSTRUMENTED_METHODS) } diff --git a/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/visitor/SaasAutoTrackerFactory.kt b/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/visitor/SaasAutoTrackerFactory.kt index 37ebcfe..794a915 100644 --- a/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/visitor/SaasAutoTrackerFactory.kt +++ b/autotracker-gradle-plugin/saas-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/visitor/SaasAutoTrackerFactory.kt @@ -103,4 +103,7 @@ internal interface AutoTrackerParams : InstrumentationParameters { @get:Input val includePackages: Property> + @get:Input + val enableRn: Property + } diff --git a/autotracker-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/util/FilterUtils.kt b/autotracker-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/util/FilterUtils.kt index 386c1af..c8cbf42 100644 --- a/autotracker-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/util/FilterUtils.kt +++ b/autotracker-gradle-plugin/src/main/kotlin/com/growingio/android/plugin/util/FilterUtils.kt @@ -142,5 +142,5 @@ fun initInjectClass(extension: AutoTrackerExtension) { } } } - HookClassesConfig.initDefaultInjector(null) + HookClassesConfig.initDefaultInjector(DEFAULT_INJECT_CLASS) }