Skip to content

Remove JVM specific API usage in common code #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2025

Conversation

dewantawsif
Copy link
Contributor

Adding non-JVM targets will result in compilation failure

@dewantawsif dewantawsif requested a review from pyricau as a code owner July 21, 2025 18:54
Copy link
Contributor

@japplin japplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes!

@pyricau pyricau merged commit 1c1cac7 into square:main Jul 23, 2025
1 check passed
"It is recommended to report your use-case of internal API to logcat issue tracker, " +
"so stable API could be provided instead"
)
annotation class InternalLogcatApi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this? Why was the internal keyword not enough?

@@ -63,9 +66,9 @@ inline fun Any.logcat(
}
val loggers = LogcatLogger.loggers.filter { it.isLoggable(priority) }
if (loggers.isNotEmpty()) {
val tagOrCaller = tag ?: outerClassSimpleNameInternalOnlyDoNotUseKThxBye()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name outerClassSimpleNameInternalOnlyDoNotUseKThxBye() was picked so that Java code, which can see these methods, would not attempt to use it. Why rename?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the assumption that the InternalLogcatApi annotation will work on Java side. Turns out it doesn't

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Hmm it does work on Android Studio

@dewantawsif dewantawsif deleted the chore/kmp branch July 23, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants