Fix build failures from rebrand: restore pbxproj exceptions, fix Kotlin casing, move missed source dirs
- Restore 6 missing PBXFileSystemSynchronizedBuildFileExceptionSet entries and exceptions arrays on 5 root groups (lost during sed rename) - Rename extension WidgetIconView.swift to avoid stringsdata collision (original had different names: MyCribIconView vs CaseraIconView) - Rename CaseraExtension.entitlements → HoneyDueExtension.entitlements - Fix Kotlin object casing: honeyDueShareCodec → HoneyDueShareCodec, honeyDuePackageType → HoneyDuePackageType - Move missed Kotlin source dirs (jsMain, webMain, androidMain/com/casera) to com/tt/honeyDue - Rename remaining Casera widget files to HoneyDue - Rename CaseraTests.swift → HoneyDueTests.swift All 4 projects (Go API, iOS, Android, Web) now compile clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,8 +35,8 @@ import com.tt.honeyDue.network.APILayer
|
||||
import com.tt.honeyDue.sharing.ContractorSharingManager
|
||||
import com.tt.honeyDue.data.DataManager
|
||||
import com.tt.honeyDue.data.PersistenceManager
|
||||
import com.tt.honeyDue.models.honeyDuePackageType
|
||||
import com.tt.honeyDue.models.detecthoneyDuePackageType
|
||||
import com.tt.honeyDue.models.HoneyDuePackageType
|
||||
import com.tt.honeyDue.models.detectHoneyDuePackageType
|
||||
import com.tt.honeyDue.analytics.PostHogAnalytics
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@@ -273,11 +273,11 @@ class MainActivity : ComponentActivity(), SingletonImageLoader.Factory {
|
||||
val jsonString = inputStream.bufferedReader().use { it.readText() }
|
||||
inputStream.close()
|
||||
|
||||
val packageType = detecthoneyDuePackageType(jsonString)
|
||||
val packageType = detectHoneyDuePackageType(jsonString)
|
||||
Log.d("MainActivity", "Detected package type: $packageType")
|
||||
|
||||
when (packageType) {
|
||||
honeyDuePackageType.RESIDENCE -> {
|
||||
HoneyDuePackageType.RESIDENCE -> {
|
||||
Log.d("MainActivity", "Routing to residence import")
|
||||
pendingResidenceImportUri = uri
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.core.content.FileProvider
|
||||
import com.tt.honeyDue.data.DataManager
|
||||
import com.tt.honeyDue.models.honeyDueShareCodec
|
||||
import com.tt.honeyDue.models.HoneyDueShareCodec
|
||||
import com.tt.honeyDue.models.Contractor
|
||||
import com.tt.honeyDue.network.APILayer
|
||||
import com.tt.honeyDue.network.ApiResult
|
||||
@@ -29,8 +29,8 @@ object ContractorSharingManager {
|
||||
fun createShareIntent(context: Context, contractor: Contractor): Intent? {
|
||||
return try {
|
||||
val currentUsername = DataManager.currentUser.value?.username ?: "Unknown"
|
||||
val jsonString = honeyDueShareCodec.encodeContractorPackage(contractor, currentUsername)
|
||||
val fileName = honeyDueShareCodec.safeShareFileName(contractor.name)
|
||||
val jsonString = HoneyDueShareCodec.encodeContractorPackage(contractor, currentUsername)
|
||||
val fileName = HoneyDueShareCodec.safeShareFileName(contractor.name)
|
||||
|
||||
// Create shared directory
|
||||
val shareDir = File(context.cacheDir, "shared")
|
||||
@@ -79,7 +79,7 @@ object ContractorSharingManager {
|
||||
val jsonString = inputStream.bufferedReader().use { it.readText() }
|
||||
inputStream.close()
|
||||
|
||||
val createRequest = honeyDueShareCodec.createContractorImportRequestOrNull(
|
||||
val createRequest = HoneyDueShareCodec.createContractorImportRequestOrNull(
|
||||
jsonContent = jsonString,
|
||||
availableSpecialties = DataManager.contractorSpecialties.value
|
||||
) ?: return@withContext ApiResult.Error("Invalid contractor share package")
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.core.content.FileProvider
|
||||
import com.tt.honeyDue.data.DataManager
|
||||
import com.tt.honeyDue.models.honeyDueShareCodec
|
||||
import com.tt.honeyDue.models.HoneyDueShareCodec
|
||||
import com.tt.honeyDue.models.JoinResidenceResponse
|
||||
import com.tt.honeyDue.models.Residence
|
||||
import com.tt.honeyDue.network.APILayer
|
||||
@@ -38,8 +38,8 @@ object ResidenceSharingManager {
|
||||
when (result) {
|
||||
is ApiResult.Success -> {
|
||||
val sharedResidence = result.data
|
||||
val jsonString = honeyDueShareCodec.encodeSharedResidence(sharedResidence)
|
||||
val fileName = honeyDueShareCodec.safeShareFileName(residence.name)
|
||||
val jsonString = HoneyDueShareCodec.encodeSharedResidence(sharedResidence)
|
||||
val fileName = HoneyDueShareCodec.safeShareFileName(residence.name)
|
||||
|
||||
// Create shared directory
|
||||
val shareDir = File(context.cacheDir, "shared")
|
||||
@@ -95,7 +95,7 @@ object ResidenceSharingManager {
|
||||
val jsonString = inputStream.bufferedReader().use { it.readText() }
|
||||
inputStream.close()
|
||||
|
||||
val shareCode = honeyDueShareCodec.extractResidenceShareCodeOrNull(jsonString)
|
||||
val shareCode = HoneyDueShareCodec.extractResidenceShareCodeOrNull(jsonString)
|
||||
?: return@withContext ApiResult.Error("Invalid residence share package")
|
||||
|
||||
// Call API with share code
|
||||
|
||||
@@ -9,7 +9,7 @@ import kotlinx.serialization.json.Json
|
||||
* This keeps package JSON shape in one place while each platform owns
|
||||
* native share-sheet presentation details.
|
||||
*/
|
||||
object honeyDueShareCodec {
|
||||
object HoneyDueShareCodec {
|
||||
private val json = Json {
|
||||
prettyPrint = true
|
||||
ignoreUnknownKeys = true
|
||||
@@ -11,7 +11,7 @@ import kotlinx.serialization.json.jsonPrimitive
|
||||
/**
|
||||
* Package type identifiers for .honeydue files
|
||||
*/
|
||||
object honeyDuePackageType {
|
||||
object HoneyDuePackageType {
|
||||
const val CONTRACTOR = "contractor"
|
||||
const val RESIDENCE = "residence"
|
||||
}
|
||||
@@ -26,7 +26,7 @@ data class SharedContractor(
|
||||
val version: Int = 1,
|
||||
|
||||
/** Package type discriminator */
|
||||
val type: String = honeyDuePackageType.CONTRACTOR,
|
||||
val type: String = HoneyDuePackageType.CONTRACTOR,
|
||||
|
||||
val name: String,
|
||||
val company: String? = null,
|
||||
@@ -70,7 +70,7 @@ data class SharedResidence(
|
||||
val version: Int = 1,
|
||||
|
||||
/** Package type discriminator */
|
||||
val type: String = honeyDuePackageType.RESIDENCE,
|
||||
val type: String = HoneyDuePackageType.RESIDENCE,
|
||||
|
||||
/** The share code for joining the residence */
|
||||
@SerialName("share_code")
|
||||
@@ -101,11 +101,11 @@ data class SharedResidence(
|
||||
* Detect the type of a .honeydue package from its JSON content.
|
||||
* Returns null if the type cannot be determined.
|
||||
*/
|
||||
fun detecthoneyDuePackageType(jsonContent: String): String? {
|
||||
fun detectHoneyDuePackageType(jsonContent: String): String? {
|
||||
return try {
|
||||
val json = Json { ignoreUnknownKeys = true }
|
||||
val jsonObject = json.decodeFromString<JsonObject>(jsonContent)
|
||||
jsonObject["type"]?.jsonPrimitive?.content ?: honeyDuePackageType.CONTRACTOR // Default for backward compatibility
|
||||
jsonObject["type"]?.jsonPrimitive?.content ?: HoneyDuePackageType.CONTRACTOR // Default for backward compatibility
|
||||
} catch (e: Exception) {
|
||||
null
|
||||
}
|
||||
@@ -118,7 +118,7 @@ fun detecthoneyDuePackageType(jsonContent: String): String? {
|
||||
fun Contractor.toSharedContractor(exportedBy: String? = null): SharedContractor {
|
||||
return SharedContractor(
|
||||
version = 1,
|
||||
type = honeyDuePackageType.CONTRACTOR,
|
||||
type = HoneyDuePackageType.CONTRACTOR,
|
||||
name = name,
|
||||
company = company,
|
||||
phone = phone,
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.tt.honeyDue.platform
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.interop.LocalUIViewController
|
||||
import com.tt.honeyDue.data.DataManager
|
||||
import com.tt.honeyDue.models.honeyDueShareCodec
|
||||
import com.tt.honeyDue.models.HoneyDueShareCodec
|
||||
import com.tt.honeyDue.models.Contractor
|
||||
import kotlinx.cinterop.ExperimentalForeignApi
|
||||
import kotlinx.cinterop.addressOf
|
||||
@@ -18,7 +18,7 @@ actual fun rememberShareContractor(): (Contractor) -> Unit {
|
||||
|
||||
return share@{ contractor: Contractor ->
|
||||
val currentUsername = DataManager.currentUser.value?.username ?: "Unknown"
|
||||
val jsonContent = honeyDueShareCodec.encodeContractorPackage(contractor, currentUsername)
|
||||
val jsonContent = HoneyDueShareCodec.encodeContractorPackage(contractor, currentUsername)
|
||||
val fileUrl = writeShareFile(jsonContent, contractor.name) ?: return@share
|
||||
presentShareSheet(viewController, fileUrl)
|
||||
}
|
||||
@@ -26,7 +26,7 @@ actual fun rememberShareContractor(): (Contractor) -> Unit {
|
||||
|
||||
@OptIn(ExperimentalForeignApi::class)
|
||||
private fun writeShareFile(jsonContent: String, displayName: String): NSURL? {
|
||||
val fileName = honeyDueShareCodec.safeShareFileName(displayName)
|
||||
val fileName = HoneyDueShareCodec.safeShareFileName(displayName)
|
||||
val filePath = NSTemporaryDirectory().plus(fileName)
|
||||
|
||||
val bytes = jsonContent.encodeToByteArray()
|
||||
|
||||
@@ -7,7 +7,7 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberCoroutineScope
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.interop.LocalUIViewController
|
||||
import com.tt.honeyDue.models.honeyDueShareCodec
|
||||
import com.tt.honeyDue.models.HoneyDueShareCodec
|
||||
import com.tt.honeyDue.models.Residence
|
||||
import com.tt.honeyDue.network.APILayer
|
||||
import com.tt.honeyDue.network.ApiResult
|
||||
@@ -31,7 +31,7 @@ actual fun rememberShareResidence(): Pair<ResidenceSharingState, (Residence) ->
|
||||
|
||||
when (val result = APILayer.generateSharePackage(residence.id)) {
|
||||
is ApiResult.Success -> {
|
||||
val jsonContent = honeyDueShareCodec.encodeSharedResidence(result.data)
|
||||
val jsonContent = HoneyDueShareCodec.encodeSharedResidence(result.data)
|
||||
val fileUrl = writeShareFile(jsonContent, residence.name)
|
||||
if (fileUrl == null) {
|
||||
state = ResidenceSharingState(isLoading = false, error = "Failed to create share package")
|
||||
@@ -59,7 +59,7 @@ actual fun rememberShareResidence(): Pair<ResidenceSharingState, (Residence) ->
|
||||
|
||||
@OptIn(ExperimentalForeignApi::class)
|
||||
private fun writeShareFile(jsonContent: String, displayName: String): NSURL? {
|
||||
val fileName = honeyDueShareCodec.safeShareFileName(displayName)
|
||||
val fileName = HoneyDueShareCodec.safeShareFileName(displayName)
|
||||
val filePath = NSTemporaryDirectory().plus(fileName)
|
||||
|
||||
val bytes = jsonContent.encodeToByteArray()
|
||||
|
||||
Reference in New Issue
Block a user