Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XCConfig를 설정 및 모듈 링킹 #4

Merged
merged 8 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: iOS CI workflow

on:
push:
branches: [ "feature/*" ]
branches: ["feature/*"]
pull_request:
branches: [ "main" ]
branches: ["main"]
types: [labeled, opened, synchronize, reopened]

jobs:
Expand Down Expand Up @@ -37,6 +37,12 @@ jobs:
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.2"
- name: Create Shared.xcconfig
env:
APPCONFIG: ${{ secrets.XCCONFIG }}
run: |
mkdir XCConfig
echo $APPCONFIG | base64 --decode > ./XCConfig/Shared.xcconfig
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ xcuserdata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

XCConfig/*
# End of https://www.toptal.com/developers/gitignore/api/macos,xcode,swift,swiftpackagemanager
2 changes: 0 additions & 2 deletions APIService/Sources/HomeAPI/HomeEndPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import Foundation
import Network

struct HomeEndPoint: EndPoint {
var baseURL: String

var method: HTTPMethod

var path: String
Expand Down
14 changes: 14 additions & 0 deletions Core/Sources/Network/EndPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// Created by 홍승현 on 1/25/24.
//

import Foundation

// MARK: - EndPoint

/// 네트워킹 작업 정보를 담습니다.
public protocol EndPoint {
/// 공통 base URL
Expand All @@ -24,3 +28,13 @@ public protocol EndPoint {
/// 헤더 값을 설정합니다.
var headers: [String: String] { get }
}

public extension EndPoint {
var baseURL: String {
guard let urlString = Bundle.main.infoDictionary?["BaseURL"] as? String
else {
fatalError("URL 설정이 되어있지 않습니다. XCConfig 파일을 다시 한 번 확인해주세요.")
}
return urlString
}
}
1 change: 0 additions & 1 deletion Core/Sources/Network/NetworkProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public struct NetworkProvider: Networking {
case .plain:
break
case let .body(data):
let body = data.toDictionary
request.httpBody = try JSONEncoder().encode(data)
case let .query(data):
var components = URLComponents(string: url.absoluteString)
Expand Down
1 change: 0 additions & 1 deletion Core/Tests/CoreTests/CoreTests.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@testable import Core
import XCTest

final class CoreTests: XCTestCase {
Expand Down
61 changes: 57 additions & 4 deletions PyeonHaeng-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

/* Begin PBXBuildFile section */
BA0563FB2B61EAD5003D6DC7 /* .gitkeep in Resources */ = {isa = PBXBuildFile; fileRef = BA0563FA2B61EAD5003D6DC7 /* .gitkeep */; };
BA0564062B624646003D6DC7 /* Shared.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = BA0564052B624646003D6DC7 /* Shared.xcconfig */; };
BA0564092B6248EA003D6DC7 /* HomeAPI in Frameworks */ = {isa = PBXBuildFile; productRef = BA0564082B6248EA003D6DC7 /* HomeAPI */; };
BA05640B2B6248EA003D6DC7 /* HomeAPISupport in Frameworks */ = {isa = PBXBuildFile; productRef = BA05640A2B6248EA003D6DC7 /* HomeAPISupport */; };
BA05640D2B6248EA003D6DC7 /* Network in Frameworks */ = {isa = PBXBuildFile; productRef = BA05640C2B6248EA003D6DC7 /* Network */; };
BA28F17C2B6155450052855E /* PyeonHaeng_iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA28F17B2B6155450052855E /* PyeonHaeng_iOSTests.swift */; };
BA28F1852B6155810052855E /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA28F1842B6155810052855E /* OnboardingView.swift */; };
BA28F1882B6155910052855E /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA28F1872B6155910052855E /* HomeView.swift */; };
Expand Down Expand Up @@ -47,6 +51,7 @@
BA0563FA2B61EAD5003D6DC7 /* .gitkeep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitkeep; sourceTree = "<group>"; };
BA0564022B62179A003D6DC7 /* Core */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Core; sourceTree = "<group>"; };
BA0564032B6219D4003D6DC7 /* APIService */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = APIService; sourceTree = "<group>"; };
BA0564052B624646003D6DC7 /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Shared.xcconfig; path = XCConfig/Shared.xcconfig; sourceTree = SOURCE_ROOT; };
BA28F1792B6155450052855E /* PyeonHaeng-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "PyeonHaeng-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
BA28F17B2B6155450052855E /* PyeonHaeng_iOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PyeonHaeng_iOSTests.swift; sourceTree = "<group>"; };
BA28F1842B6155810052855E /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -87,6 +92,9 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
BA05640D2B6248EA003D6DC7 /* Network in Frameworks */,
BA05640B2B6248EA003D6DC7 /* HomeAPISupport in Frameworks */,
BA0564092B6248EA003D6DC7 /* HomeAPI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -101,6 +109,22 @@
path = Components;
sourceTree = "<group>";
};
BA0564042B624629003D6DC7 /* XCConfig */ = {
isa = PBXGroup;
children = (
BA0564052B624646003D6DC7 /* Shared.xcconfig */,
);
name = XCConfig;
path = "PyeonHaeng-iOS/XCConfig";
sourceTree = "<group>";
};
BA0564072B6248EA003D6DC7 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
BA28F1702B6152E90052855E /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -230,9 +254,11 @@
children = (
BA0564032B6219D4003D6DC7 /* APIService */,
BA0564022B62179A003D6DC7 /* Core */,
BAA4D9AA2B5A1795005999F8 /* Products */,
BAA4D9AB2B5A1795005999F8 /* PyeonHaeng-iOS */,
BA28F17A2B6155450052855E /* PyeonHaeng-iOSTests */,
BAA4D9AA2B5A1795005999F8 /* Products */,
BA0564042B624629003D6DC7 /* XCConfig */,
BA0564072B6248EA003D6DC7 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -300,6 +326,11 @@
dependencies = (
);
name = "PyeonHaeng-iOS";
packageProductDependencies = (
BA0564082B6248EA003D6DC7 /* HomeAPI */,
BA05640A2B6248EA003D6DC7 /* HomeAPISupport */,
BA05640C2B6248EA003D6DC7 /* Network */,
);
productName = "PyeonHaeng-iOS";
productReference = BAA4D9A92B5A1795005999F8 /* PyeonHaeng-iOS.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -367,6 +398,7 @@
BA28F1A42B61572A0052855E /* Pretendard-ExtraBold.otf in Resources */,
BA28F1A02B61572A0052855E /* Pretendard-Regular.otf in Resources */,
BAA4D9B12B5A1796005999F8 /* Assets.xcassets in Resources */,
BA0564062B624646003D6DC7 /* Shared.xcconfig in Resources */,
BAF2BEB32B61236100931AF0 /* Localizable.xcstrings in Resources */,
BA28F1A22B61572A0052855E /* Pretendard-Medium.otf in Resources */,
BA0563FB2B61EAD5003D6DC7 /* .gitkeep in Resources */,
Expand Down Expand Up @@ -454,6 +486,7 @@
/* Begin XCBuildConfiguration section */
BA28F1802B6155450052855E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -472,6 +505,7 @@
};
BA28F1812B6155450052855E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -490,6 +524,7 @@
};
BAA4D9B52B5A1796005999F8 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -553,6 +588,7 @@
};
BAA4D9B62B5A1796005999F8 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
Expand Down Expand Up @@ -609,6 +645,7 @@
};
BAA4D9B82B5A1796005999F8 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -641,6 +678,7 @@
};
BAA4D9B92B5A1796005999F8 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = BA0564052B624646003D6DC7 /* Shared.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
Expand Down Expand Up @@ -681,7 +719,7 @@
BA28F1812B6155450052855E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
BAA4D9A42B5A1795005999F8 /* Build configuration list for PBXProject "PyeonHaeng-iOS" */ = {
isa = XCConfigurationList;
Expand All @@ -690,7 +728,7 @@
BAA4D9B62B5A1796005999F8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
BAA4D9B72B5A1796005999F8 /* Build configuration list for PBXNativeTarget "PyeonHaeng-iOS" */ = {
isa = XCConfigurationList;
Expand All @@ -699,9 +737,24 @@
BAA4D9B92B5A1796005999F8 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
BA0564082B6248EA003D6DC7 /* HomeAPI */ = {
isa = XCSwiftPackageProductDependency;
productName = HomeAPI;
};
BA05640A2B6248EA003D6DC7 /* HomeAPISupport */ = {
isa = XCSwiftPackageProductDependency;
productName = HomeAPISupport;
};
BA05640C2B6248EA003D6DC7 /* Network */ = {
isa = XCSwiftPackageProductDependency;
productName = Network;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = BAA4D9A12B5A1795005999F8 /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BAA4D9A82B5A1795005999F8"
BuildableName = "PyeonHaeng-iOS.app"
BlueprintName = "PyeonHaeng-iOS"
ReferencedContainer = "container:PyeonHaeng-iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BA28F1782B6155450052855E"
BuildableName = "PyeonHaeng-iOSTests.xctest"
BlueprintName = "PyeonHaeng-iOSTests"
ReferencedContainer = "container:PyeonHaeng-iOS.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BAA4D9A82B5A1795005999F8"
BuildableName = "PyeonHaeng-iOS.app"
BlueprintName = "PyeonHaeng-iOS"
ReferencedContainer = "container:PyeonHaeng-iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BAA4D9A82B5A1795005999F8"
BuildableName = "PyeonHaeng-iOS.app"
BlueprintName = "PyeonHaeng-iOS"
ReferencedContainer = "container:PyeonHaeng-iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
2 changes: 2 additions & 0 deletions PyeonHaeng-iOS/Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BaseURL</key>
<string>$(BASE_URL)</string>
<key>UIAppFonts</key>
<array>
<string>Pretendard-Thin.otf</string>
Expand Down