-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: android target #2
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A few comments but hopefully we can get this in
private var _Context: WeakReference<Context>? = null | ||
internal val ContextRef: Context get() { | ||
return _Context?.get() ?: throw AppDirsException("In android target, please call Application#attachAppDirs() first!") | ||
} | ||
|
||
fun Application.attachAppDirs() { | ||
_Context = WeakReference(this) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! This is the main thing I was worried about when thinking of how to implement a Android target. This seems like a good solution
@@ -28,6 +25,14 @@ kotlin { | |||
linuxArm64() | |||
mingwX64() | |||
|
|||
androidTarget { | |||
publishLibraryVariants("release") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, the reason for adding this line is a bug from gradle-maven-publish-plugin
@Syer10 Can you merge this nice PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix the actions myself
Thanks! Its included in the latest release. |
Hello, first of all thank you for your great work on Kotlin-Multiplatform-AppDirs.
Currently AppDir has completed all desktop targets. It would be great if the android target could be added. I have completed the Android target in my fork, so I created this PR.
Thank you!