|
1 | | -# lemonkit |
| 1 | +# LemonKit |
| 2 | + |
| 3 | +Use this package to communicate with Lemon's backend. |
| 4 | + |
| 5 | +## Apple Platforms |
| 6 | + |
| 7 | +Just include this Package in your `Package.swift` as a dependency or in your Xcode project |
| 8 | + |
| 9 | +## Android |
| 10 | + |
| 11 | +This Swift Package is compatible with Android thanks to the Skip.tools's [native toolchain](https://skip.tools/docs/modes/#native$0). |
| 12 | + |
| 13 | +In your `build.gradle.kts`, add this to your `repositories`: |
| 14 | + |
| 15 | +``` |
| 16 | +maven { |
| 17 | + url = uri("https://maven.pkg.github.com/theleftbit/LemonKit/") |
| 18 | + credentials { |
| 19 | + username = gprUser |
| 20 | + password = gprKey |
| 21 | + } |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +And this to your `dependencies`: |
| 26 | + |
| 27 | +``` |
| 28 | +debugImplementation(libs.bundles.lemonDebug) |
| 29 | +releaseImplementation(libs.bundles.lemonRelease) |
| 30 | +``` |
| 31 | + |
| 32 | +And in your `gradle/libs.versions.toml` |
| 33 | + |
| 34 | +``` |
| 35 | +lemonkitVersion = "0.1.6" |
| 36 | +
|
| 37 | +# debug artifacts |
| 38 | +lemonkit-debug = { group = "com.theleftbit", name = "lemonkit-debug", version.ref = "lemonkitVersion" } |
| 39 | +skipbridge-debug = { group = "com.theleftbit", name = "skipbridge-debug", version.ref = "lemonkitVersion" } |
| 40 | +skipandroidbridge-debug = { group = "com.theleftbit", name = "skipandroidbridge-debug", version.ref = "lemonkitVersion" } |
| 41 | +skipfoundation-debug = { group = "com.theleftbit", name = "skipfoundation-debug", version.ref = "lemonkitVersion" } |
| 42 | +skipkeychain-debug = { group = "com.theleftbit", name = "skipkeychain-debug", version.ref = "lemonkitVersion" } |
| 43 | +skiplib-debug = { group = "com.theleftbit", name = "skiplib-debug", version.ref = "lemonkitVersion" } |
| 44 | +
|
| 45 | +# release artifacts |
| 46 | +lemonkit-release = { group = "com.theleftbit", name = "lemonkit-release", version.ref = "lemonkitVersion" } |
| 47 | +skipbridge-release = { group = "com.theleftbit", name = "skipbridge-release", version.ref = "lemonkitVersion" } |
| 48 | +skipandroidbridge-release = { group = "com.theleftbit", name = "skipandroidbridge-release", version.ref = "lemonkitVersion" } |
| 49 | +skipfoundation-release = { group = "com.theleftbit", name = "skipfoundation-release", version.ref = "lemonkitVersion" } |
| 50 | +skipkeychain-release = { group = "com.theleftbit", name = "skipkeychain-release", version.ref = "lemonkitVersion" } |
| 51 | +skiplib-release = { group = "com.theleftbit", name = "skiplib-release", version.ref = "lemonkitVersion" } |
| 52 | +
|
| 53 | +[bundles] |
| 54 | +lemonDebug = [ "lemonkit-debug", "skipbridge-debug", "skipandroidbridge-debug", "skipfoundation-debug", "skipkeychain-debug", "skiplib-debug" ] |
| 55 | +lemonRelease = [ "lemonkit-release", "skipbridge-release", "skipandroidbridge-release", "skipfoundation-release", "skipkeychain-release", "skiplib-release"] |
| 56 | +``` |
| 57 | + |
| 58 | +And in your `proguard-rules.pro`: |
| 59 | + |
| 60 | +``` |
| 61 | +##---------------Skip---------- |
| 62 | +-keeppackagenames ** |
| 63 | +-keep class skip.** { *; } |
| 64 | +-keep class tools.skip.** { *; } |
| 65 | +-keep class kotlin.jvm.functions.** {*;} |
| 66 | +-keep class com.sun.jna.** { *; } |
| 67 | +-keep class * implements com.sun.jna.** { *; } |
| 68 | +-dontwarn org.commonmark.** |
| 69 | +``` |
| 70 | + |
| 71 | +**Note:** As you have seen earlier, loading GitHub Packages requires a username and password. We recommend creating a PAT on GitHub with read-only access to your Packages. Then, on your `local.properties` |
| 72 | + |
| 73 | +``` |
| 74 | +gpr.usr=XXX |
| 75 | +gpr.key=ghp_XXX |
| 76 | +``` |
| 77 | + |
| 78 | +Once that is done, you can load them in your `build.gradle` as: |
| 79 | + |
| 80 | +``` |
| 81 | +// Load from local.properties the user's GH PAT token to pull dependencies |
| 82 | +def localProps = new Properties() |
| 83 | +def localPropsFile = rootProject.file('local.properties') |
| 84 | +if (localPropsFile.exists()) { |
| 85 | + localPropsFile.withInputStream { localProps.load(it) } |
| 86 | +} |
| 87 | +
|
| 88 | +def gprUser = localProps.getProperty('gpr.usr') ?: System.getenv('GITHUB_ACTOR') |
| 89 | +def gprKey = localProps.getProperty('gpr.key') ?: System.getenv('GITHUB_TOKEN') |
| 90 | +``` |
0 commit comments