generated from vitoksmile/compose-multiplatform-ios-android-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish core & koin to GitHub packages
- Loading branch information
1 parent
8acb240
commit 15fc908
Showing
25 changed files
with
388 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,63 @@ Note that for Android, the target phone **needs** to have ~~[Google Fit](https:/ | |
|
||
## Data Types | ||
- STEPS | ||
- WEIGHT | ||
- WEIGHT | ||
|
||
|
||
# Using | ||
|
||
You need an access token to install GitHub packages, see [Managing your personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). | ||
|
||
local.properties | ||
``` | ||
[email protected] | ||
GITHUB_TOKEN=xxx | ||
``` | ||
|
||
settings.gradle.kts: | ||
```kotlin | ||
dependencyResolutionManagement { | ||
repositories { | ||
maven { | ||
url = uri("https://maven.pkg.github.com/vitoksmile/HealthKMP") | ||
name = "GitHubPackages" | ||
credentials { | ||
val properties = java.util.Properties() | ||
properties.load(file("local.properties").inputStream()) | ||
username = properties["GITHUB_USERNAME"].toString() | ||
password = properties["GITHUB_TOKEN"].toString() | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
build.gradle: | ||
```kotlin | ||
sourceSets { | ||
val commonMain by getting { | ||
dependencies { | ||
implementation("com.vitoksmile.health-kmp:core:0.0.1") | ||
} | ||
} | ||
} | ||
``` | ||
|
||
If you are using Koin, add to build.gradle: | ||
```kotlin | ||
implementation("com.vitoksmile.health-kmp:koin:0.0.1") | ||
``` | ||
|
||
|
||
## 👷 Project Structure | ||
* <kbd>core</kbd> - module with main source for the HealthKMP library | ||
* <kbd>koin</kbd> - module with extensions for Koin | ||
|
||
* <kbd>sample</kbd> - shared code for sample Compose project | ||
* <kbd>androidApp</kbd> - sample Android projects that use HealthKMP | ||
* <kbd>iosApp</kbd> - sample iOS projects that use HealthKMP | ||
|
||
|
||
## 📜 License | ||
|
||
This project is licensed under the Apache License, Version 2.0 - see the [LICENSE.md](https://github.com/Foso/Ktorfit/blob/master/LICENSE) file for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
androidApp/src/androidMain/kotlin/com/vitoksmile/kmp/health/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package com.vitoksmile.kmp.health | ||
|
||
import MainView | ||
import android.os.Bundle | ||
import androidx.activity.compose.setContent | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.vitoksmile.kmp.health.sample.SampleApp | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
setContent { | ||
MainView() | ||
SampleApp() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<resources> | ||
<string name="app_name">HealthKMP</string> | ||
<string name="app_name">Health</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'HealthKMP' | ||
spec.version = '0.0.1' | ||
spec.homepage = 'https://github.com/vitoksmile/HealthKMP' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = '' | ||
spec.summary = 'Wrapper for HealthKit on iOS and Google Fit and Health Connect on Android.' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/HealthKMP.framework' | ||
spec.libraries = 'c++' | ||
spec.ios.deployment_target = '14.1' | ||
|
||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => ':core', | ||
'PRODUCT_MODULE_NAME' => 'HealthKMP', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build HealthKMP', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
TEAM_ID= | ||
BUNDLE_ID=com.vitoksmile.kmp.health | ||
APP_NAME=HealthKMP | ||
APP_NAME=Health |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'HealthKMPKoin' | ||
spec.version = '0.0.1' | ||
spec.homepage = 'https://github.com/vitoksmile/HealthKMP' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = '' | ||
spec.summary = 'Shared Koin module for wrapper for HealthKit on iOS and Google Fit and Health Connect on Android.' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/HealthKMPKoin.framework' | ||
spec.libraries = 'c++' | ||
spec.ios.deployment_target = '14.1' | ||
|
||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => ':koin', | ||
'PRODUCT_MODULE_NAME' => 'HealthKMPKoin', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build HealthKMPKoin', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
|
||
end |
Oops, something went wrong.