Skip to content

Commit da2255d

Browse files
Iveta Jurčíkováfacebook-github-bot
Iveta Jurčíková
authored andcommitted
Inject KotlinCDLogger implementation into :command_lib using ServiceLoader
Summary: ### Context The Scribe logger was integrated into the Android Build Toolchain to collect data from KotlinCD steps. However, with the recent transition of ABT to open-source, we can no longer include Meta-specific code in the OSS release, as it would cause build failures. ### This Stack This stack aims to use ServiceLoader to inject the correct implementation based on the repository source (OSS or Meta). **Final structure** {F1976250827} ### This diff Implements the logic for using ServiceLoader to inject KotlinCDLogger into the :command_lib library, instead of having it instantiate the implementation directly. Reviewed By: jselbo Differential Revision: D71559745 fbshipit-source-id: 5200621ea734e72b587adbd3c00c5c5c6db27ce1
1 parent 1f93aab commit da2255d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

prelude/toolchains/android/src/com/facebook/buck/jvm/kotlin/cd/workertool/KotlinCDCommand.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import com.facebook.buck.jvm.kotlin.cd.analytics.KotlinCDAnalytics;
2929
import com.facebook.buck.jvm.kotlin.cd.analytics.KotlinCDNoopAnalytics;
3030
import com.facebook.buck.jvm.kotlin.cd.analytics.scribe.KotlinCDScribeAnalytics;
31-
import com.facebook.buck.jvm.kotlin.cd.logger.scribe.LoggerCatKotlinCDScribeLogger;
31+
import com.facebook.buck.jvm.kotlin.cd.logger.KotlinCDLogger;
3232
import com.facebook.buck.jvm.kotlin.cd.workertool.postexecutors.ClassAbiWriter;
3333
import com.facebook.buck.jvm.kotlin.cd.workertool.postexecutors.PostExecutorsFactory;
3434
import com.facebook.buck.jvm.kotlin.cd.workertool.postexecutors.PreviousStateWriter;
@@ -190,7 +190,7 @@ private KotlinCDAnalytics initKotlinCDAnalytics() {
190190
String subtarget = parts.length > 1 ? parts[1] : "library";
191191

192192
return new KotlinCDScribeAnalytics(
193-
LoggerCatKotlinCDScribeLogger.INSTANCE,
193+
KotlinCDLogger.loadImplementation(),
194194
buildUuid,
195195
target,
196196
subtarget,

0 commit comments

Comments
 (0)