Skip to content

Commit

Permalink
🔐 Set up XCConfig for baseURL and update .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteHyun committed Jan 25, 2024
1 parent 2f474cb commit 7dee2ea
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 3 deletions.
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
}
}
55 changes: 54 additions & 1 deletion 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 @@ -702,6 +740,21 @@
defaultConfigurationName = Release;
};
/* 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 */;
}
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

0 comments on commit 7dee2ea

Please sign in to comment.