Skip to content

Commit

Permalink
Renamed to KMP
Browse files Browse the repository at this point in the history
  • Loading branch information
vitoksmile committed Aug 31, 2023
1 parent f5ec8b0 commit 8acb240
Show file tree
Hide file tree
Showing 29 changed files with 48 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HealthKMM
# HealthKMP

Kotlin Multiplatform Mobile wrapper for HealthKit on iOS and ~~Google Fit and~~ Health Connect on Android.

Expand Down
2 changes: 1 addition & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kotlin {

android {
compileSdk = (findProperty("android.compileSdk") as String).toInt()
namespace = "com.vitoksmile.kmm.health"
namespace = "com.vitoksmile.kmp.health"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import android.app.Application
import com.vitoksmile.kmm.health.koin.attachHealthKMM
import com.vitoksmile.kmp.health.koin.attachHealthKMP
import org.koin.android.ext.koin.androidContext
import org.koin.android.ext.koin.androidLogger
import org.koin.core.context.startKoin
Expand All @@ -14,7 +14,7 @@ class HealthApplication : Application() {
startKoin {
androidContext(this@HealthApplication)
androidLogger()
attachHealthKMM(this@HealthApplication)
attachHealthKMP(this@HealthApplication)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import MainView
import android.os.Bundle
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">HealthKMM</string>
<string name="app_name">HealthKMP</string>
</resources>
7 changes: 4 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ kotlin {
iosSimulatorArm64()

cocoapods {
name = "HealthKMP"
version = "0.0.1"
summary = "Wrapper for HealthKit on iOS and Google Fit and Health Connect on Android."
homepage = "https://github.com/vitoksmile/HealthKMM"
homepage = "https://github.com/vitoksmile/HealthKMP"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "core"
baseName = "HealthKMP"
isStatic = true
}
}
Expand Down Expand Up @@ -66,7 +67,7 @@ kotlin {

android {
compileSdk = (findProperty("android.compileSdk") as String).toInt()
namespace = "com.vitoksmile.kmm.health"
namespace = "com.vitoksmile.kmp.health"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
sourceSets["main"].res.srcDirs("src/androidMain/res")
Expand Down
2 changes: 1 addition & 1 deletion core/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
android:exported="false"
tools:node="merge">
<meta-data
android:name="com.vitoksmile.kmm.health.ApplicationContextHolderInitializer"
android:name="com.vitoksmile.kmp.health.ApplicationContextHolderInitializer"
android:value="androidx.startup" />
</provider>
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("unused")

package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import android.content.Context
import androidx.startup.Initializer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import androidx.health.connect.client.permission.HealthPermission
import androidx.health.connect.client.records.StepsRecord
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import android.content.Context
import androidx.health.connect.client.HealthConnectClient
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

actual class HealthManagerFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import android.content.Context
import android.content.Intent
Expand Down
6 changes: 3 additions & 3 deletions core/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import com.vitoksmile.kmm.health.HealthDataType
import com.vitoksmile.kmm.health.HealthManagerFactory
import com.vitoksmile.kmp.health.HealthDataType
import com.vitoksmile.kmp.health.HealthManagerFactory
import kotlinx.coroutines.launch

@Composable
Expand Down Expand Up @@ -49,7 +49,7 @@ fun App() {
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Text("Hello, this is HealthKMM for ${getPlatformName()}")
Text("Hello, this is HealthKMP for ${getPlatformName()}")

isAvailableResult
.onSuccess { isAvailable ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

enum class HealthDataType {
STEPS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

interface HealthManager {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

expect class HealthManagerFactory() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import platform.HealthKit.HKQuantityType
import platform.HealthKit.HKQuantityTypeIdentifierBodyMass
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("ClassName")

package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.vitoksmile.kmm.health
package com.vitoksmile.kmp.health

actual class HealthManagerFactory {

Expand Down
4 changes: 2 additions & 2 deletions iosApp/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TEAM_ID=
BUNDLE_ID=com.vitoksmile.kmm.health
APP_NAME=HealthKMM
BUNDLE_ID=com.vitoksmile.kmp.health
APP_NAME=HealthKMP
4 changes: 2 additions & 2 deletions iosApp/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
target 'iosApp' do
use_frameworks!
platform :ios, '14.1'
pod 'core', :path => '../core'
pod 'koin', :path => '../koin'
pod 'HealthKMP', :path => '../core'
pod 'HealthKMPKoin', :path => '../koin'
end
10 changes: 5 additions & 5 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
20ACF4E2201EBCFD0F637C2A /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
68E4587840B67DF8CD73E3AE /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = "<group>"; };
7555FF7B242A565900829871 /* HealthKMM.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HealthKMM.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF7B242A565900829871 /* HealthKMP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HealthKMP.app; sourceTree = BUILT_PRODUCTS_DIR; };
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9429AFAC2A68240500E5B251 /* iosApp.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iosApp.entitlements; sourceTree = "<group>"; };
Expand Down Expand Up @@ -70,7 +70,7 @@
7555FF7C242A565900829871 /* Products */ = {
isa = PBXGroup;
children = (
7555FF7B242A565900829871 /* HealthKMM.app */,
7555FF7B242A565900829871 /* HealthKMP.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -123,7 +123,7 @@
);
name = iosApp;
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* HealthKMM.app */;
productReference = 7555FF7B242A565900829871 /* HealthKMP.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -336,7 +336,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
DEVELOPMENT_TEAM = Q4BFS77J38;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
Expand All @@ -361,7 +361,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = "${TEAM_ID}";
DEVELOPMENT_TEAM = Q4BFS77J38;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
Expand Down
2 changes: 1 addition & 1 deletion iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import koin
struct ComposeView: UIViewControllerRepresentable {

init() {
Health_kmm_koinKt.start()
Health_kmp_koinKt.start()
}

func makeUIViewController(context: Context) -> UIViewController {
Expand Down
7 changes: 4 additions & 3 deletions koin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ kotlin {
iosSimulatorArm64()

cocoapods {
name = "HealthKMPKoin"
version = "0.0.1"
summary = "Shared Koin module for wrapper for HealthKit on iOS and Google Fit and Health Connect on Android."
homepage = "https://github.com/vitoksmile/HealthKMM"
homepage = "https://github.com/vitoksmile/HealthKMP"
ios.deploymentTarget = "14.1"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "koin"
baseName = "HealthKMPKoin"
isStatic = true
}
}
Expand Down Expand Up @@ -57,7 +58,7 @@ kotlin {

android {
compileSdk = (findProperty("android.compileSdk") as String).toInt()
namespace = "com.vitoksmile.kmm.health.koin"
namespace = "com.vitoksmile.kmp.health.koin"

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

Expand Down
2 changes: 1 addition & 1 deletion koin/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:exported="false"
tools:node="remove">
<meta-data
android:name="com.vitoksmile.kmm.health.ApplicationContextHolderInitializer"
android:name="com.vitoksmile.kmp.health.ApplicationContextHolderInitializer"
android:value="androidx.startup" />
</provider>
</application>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.vitoksmile.kmm.health.koin
package com.vitoksmile.kmp.health.koin

import android.app.Application
import com.vitoksmile.kmm.health.ApplicationContextHolder
import com.vitoksmile.kmp.health.ApplicationContextHolder
import org.koin.core.KoinApplication

fun KoinApplication.attachHealthKMM(
fun KoinApplication.attachHealthKMP(
application: Application,
) {
ApplicationContextHolder.applicationContext = application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.vitoksmile.kmm.health.koin
package com.vitoksmile.kmp.health.koin

import com.vitoksmile.kmm.health.HealthManagerFactory
import com.vitoksmile.kmp.health.HealthManagerFactory
import org.koin.core.module.Module
import org.koin.dsl.module

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@file:Suppress("unused")

import com.vitoksmile.kmm.health.koin.commonModule
import com.vitoksmile.kmp.health.koin.commonModule
import org.koin.core.context.startKoin

fun start() {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "HealthKMM"
rootProject.name = "HealthKMP"

include(":androidApp")
include(":core")
Expand Down

0 comments on commit 8acb240

Please sign in to comment.