Skip to content

Commit

Permalink
zz
Browse files Browse the repository at this point in the history
  • Loading branch information
taetae98coding committed Nov 8, 2024
1 parent b7440b7 commit 07d1ddc
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 90 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,5 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- name: Build iOS
run: xcodebuild -project Diary/Diary.xcodeproj -scheme CI -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.0'
9 changes: 0 additions & 9 deletions .github/workflows/check_code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,4 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- run: ./gradlew :spotlessCheck
9 changes: 0 additions & 9 deletions .github/workflows/dependency_guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,5 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- name: Build ${{ matrix.command }}
run: ${{ matrix.command }}
27 changes: 0 additions & 27 deletions .github/workflows/firebase_app_distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- name: Build APK
run: ./gradlew :app:platform:android:assembleRealRelease

Expand Down Expand Up @@ -76,15 +67,6 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_DISTRIBUTION_CERTIFICATE }}
Expand Down Expand Up @@ -152,15 +134,6 @@ jobs:
echo android.real.key.alias=${{ secrets.ANDROID_REAL_KEY_ALIAS }} >> local.properties
echo android.real.key.password=${{ secrets.ANDROID_REAL_KEY_PASSWORD }} >> local.properties
- name: Set xcconfig
run: |
echo DIARY_API_URL = ${{ secrets.DIARY_DEV_API_BASE_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_DEV_API_URL_APPLE }} >> Diary/dev.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_DEV_API_KEY }} >> Diary/dev.xcconfig
echo DIARY_API_URL = ${{ secrets.DIARY_REAL_API_BASE_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_URL = ${{ secrets.HOLIDAY_REAL_API_URL_APPLE }} >> Diary/real.xcconfig
echo HOLIDAY_API_KEY = ${{ secrets.HOLIDAY_REAL_API_KEY }} >> Diary/real.xcconfig
- name: Download ipa
uses: actions/download-artifact@v4
with:
Expand Down
26 changes: 4 additions & 22 deletions Diary/Diary.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
objectVersion = 77;
objects = {

/* Begin PBXBuildFile section */
3D604D262CCFF7B500D1CC30 /* dev.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3D604D252CCFF7B500D1CC30 /* dev.xcconfig */; };
3D604D282CCFF83200D1CC30 /* real.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3D604D272CCFF83200D1CC30 /* real.xcconfig */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
3D604D252CCFF7B500D1CC30 /* dev.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = dev.xcconfig; sourceTree = "<group>"; };
3D604D272CCFF83200D1CC30 /* real.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = real.xcconfig; sourceTree = "<group>"; };
3DDC71F62CCD5903001193A2 /* Diary.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Diary.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -52,8 +45,6 @@
3DDC71ED2CCD5903001193A2 = {
isa = PBXGroup;
children = (
3D604D272CCFF83200D1CC30 /* real.xcconfig */,
3D604D252CCFF7B500D1CC30 /* dev.xcconfig */,
3DDC71F82CCD5903001193A2 /* Diary */,
3DDC71F72CCD5903001193A2 /* Products */,
);
Expand All @@ -74,7 +65,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 3DDC72042CCD5905001193A2 /* Build configuration list for PBXNativeTarget "Diary" */;
buildPhases = (
3DDC72072CCD5943001193A2 /* ShellScript */,
3DDC72072CCD5943001193A2 /* Run Script */,
3DDC71F22CCD5903001193A2 /* Sources */,
3DDC71F32CCD5903001193A2 /* Frameworks */,
3DDC71F42CCD5903001193A2 /* Resources */,
Expand Down Expand Up @@ -133,15 +124,13 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3D604D282CCFF83200D1CC30 /* real.xcconfig in Resources */,
3D604D262CCFF7B500D1CC30 /* dev.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
3DDC72072CCD5943001193A2 /* ShellScript */ = {
3DDC72072CCD5943001193A2 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -150,13 +139,14 @@
);
inputPaths = (
);
name = "Run Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"$SRCROOT/..\"\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode\n";
shellScript = "cd \"$SRCROOT/..\"\n\n\ncase \"${CONFIGURATION}\" in\n \"DevDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"DevRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=dev ;;\n \"RealDebug\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n \"RealRelease\" )\n./gradlew :app:platform:ios:embedAndSignAppleFrameworkForXcode -Pbuildkonfig.flavor=real ;;\n*)\n;;\nesac\n";
};
/* End PBXShellScriptBuildPhase section */

Expand All @@ -173,7 +163,6 @@
/* Begin XCBuildConfiguration section */
3D709E182CDB092800F8132A /* RealDebug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D272CCFF83200D1CC30 /* real.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -237,7 +226,6 @@
};
3D709E192CDB092800F8132A /* RealDebug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D272CCFF83200D1CC30 /* real.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -272,7 +260,6 @@
};
3D709E1A2CDB093800F8132A /* RealRelease */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D272CCFF83200D1CC30 /* real.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -329,7 +316,6 @@
};
3D709E1B2CDB093800F8132A /* RealRelease */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D272CCFF83200D1CC30 /* real.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -369,7 +355,6 @@
};
3D709E1C2CDB096E00F8132A /* DevDebug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D252CCFF7B500D1CC30 /* dev.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -433,7 +418,6 @@
};
3D709E1D2CDB096E00F8132A /* DevDebug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D252CCFF7B500D1CC30 /* dev.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -468,7 +452,6 @@
};
3D709E1E2CDB097D00F8132A /* DevRelease */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D252CCFF7B500D1CC30 /* dev.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -525,7 +508,6 @@
};
3D709E1F2CDB097D00F8132A /* DevRelease */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3D604D252CCFF7B500D1CC30 /* dev.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down
6 changes: 0 additions & 6 deletions Diary/Diary/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>Diary Api Url</key>
<string>$(DIARY_API_URL)</string>
<key>Holiday Api Key</key>
<string>$(HOLIDAY_API_KEY)</string>
<key>Holiday Api Url</key>
<string>$(HOLIDAY_API_URL)</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private fun Message(
uiState.isLoginFinish -> onLoginFinish()
uiState.isExistEmail -> state.showMessage(existEmailMessage)
uiState.isNetworkError -> state.showMessage(networkErrorMessage)
uiState.isUnknownError -> state.showMessage(unknownErrorMessage)
uiState.isUnknownError -> state.showMessage(uiState.message)
}

uiState.onMessageShow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ internal class JoinViewModel(
when (throwable) {
is ExistEmailException -> _uiState.update { it.copy(isProgress = false, isExistEmail = true) }
is NetworkException -> _uiState.update { it.copy(isProgress = false, isNetworkError = true) }
else -> _uiState.update { it.copy(isProgress = false, isUnknownError = true) }
else -> _uiState.update { it.copy(isProgress = false, isUnknownError = true, message = it.toString()) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ internal data class JoinUiState(
val isExistEmail: Boolean = false,
val isNetworkError: Boolean = false,
val isUnknownError: Boolean = false,
val message: String = "",
val onMessageShow: () -> Unit = {},
) {
val hasMessage = isLoginFinish || isExistEmail || isNetworkError || isUnknownError
Expand Down
27 changes: 27 additions & 0 deletions app/platform/ios/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

import com.codingfeline.buildkonfig.compiler.FieldSpec
import ext.getLocalProperty

private val localProperties = requireNotNull(project.getLocalProperty())

plugins {
id("diary.kotlin.multiplatform")
id("diary.compose")
alias(libs.plugins.buildkonfig)
}

kotlin {
Expand Down Expand Up @@ -42,3 +49,23 @@ kotlin {
}
}
}

buildkonfig {
packageName = Build.NAMESPACE

defaultConfigs {}

defaultConfigs("dev") {
buildConfigField(FieldSpec.Type.STRING, "FLAVOR", "dev")
buildConfigField(FieldSpec.Type.STRING, "DIARY_API_URL", localProperties.getProperty("diary.dev.api.base.url"))
buildConfigField(FieldSpec.Type.STRING, "HOLIDAY_API_URL", localProperties.getProperty("holiday.dev.api.url"))
buildConfigField(FieldSpec.Type.STRING, "HOLIDAY_API_KEY", localProperties.getProperty("holiday.dev.api.key"))
}

defaultConfigs("real") {
buildConfigField(FieldSpec.Type.STRING, "FLAVOR", "real")
buildConfigField(FieldSpec.Type.STRING, "DIARY_API_URL", localProperties.getProperty("diary.real.api.base.url"))
buildConfigField(FieldSpec.Type.STRING, "HOLIDAY_API_URL", localProperties.getProperty("holiday.real.api.url"))
buildConfigField(FieldSpec.Type.STRING, "HOLIDAY_API_KEY", localProperties.getProperty("holiday.real.api.key"))
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package io.github.taetae98coding.diary

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.ui.window.ComposeUIViewController
import androidx.lifecycle.compose.LifecycleResumeEffect
import androidx.lifecycle.compose.LifecycleStartEffect
import io.github.taetae98coding.diary.app.App
import io.github.taetae98coding.diary.core.coroutines.AppLifecycleOwner
import platform.UIKit.UIViewController

public fun compose(): UIViewController {
return ComposeUIViewController {
App()
Column {
Text(text = BuildKonfig.DIARY_API_URL)
Text(text = BuildKonfig.HOLIDAY_API_URL)
Text(text = BuildKonfig.HOLIDAY_API_KEY)
}

LifecycleStartEffect(keys = arrayOf(AppLifecycleOwner)) {
AppLifecycleOwner.start()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package io.github.taetae98coding.diary.initializer

import io.github.taetae98coding.diary.BuildKonfig
import io.github.taetae98coding.diary.core.diary.service.DiaryServiceModule
import io.github.taetae98coding.diary.core.holiday.service.HolidayServiceModule
import org.koin.core.KoinApplication
import org.koin.core.context.startKoin
import org.koin.core.module.Module
import org.koin.core.qualifier.StringQualifier
import org.koin.dsl.module
import platform.Foundation.NSBundle

internal expect val appModule: Module
internal expect val accountDataStoreModule: Module
Expand All @@ -31,13 +31,13 @@ public fun initKoin(): KoinApplication {

private fun diaryServiceModule(): Module {
return module {
single<String>(qualifier = StringQualifier(DiaryServiceModule.DIARY_API_URL)) { NSBundle.mainBundle.objectForInfoDictionaryKey("Diary Api Url") as String }
single(qualifier = StringQualifier(DiaryServiceModule.DIARY_API_URL)) { BuildKonfig.DIARY_API_URL }
}
}

private fun holidayServiceModule(): Module {
return module {
single<String>(qualifier = StringQualifier(HolidayServiceModule.HOLIDAY_API_URL)) { NSBundle.mainBundle.objectForInfoDictionaryKey("Holiday Api Url") as String }
single<String>(qualifier = StringQualifier(HolidayServiceModule.HOLIDAY_API_KEY)) { NSBundle.mainBundle.objectForInfoDictionaryKey("Holiday Api Key") as String }
single(qualifier = StringQualifier(HolidayServiceModule.HOLIDAY_API_URL)) { BuildKonfig.HOLIDAY_API_URL }
single(qualifier = StringQualifier(HolidayServiceModule.HOLIDAY_API_KEY)) { BuildKonfig.HOLIDAY_API_KEY }
}
}

0 comments on commit 07d1ddc

Please sign in to comment.