Skip to content

Commit db1ca43

Browse files
committed
[Feat] #47 - Add environment
1 parent 3885c27 commit db1ca43

File tree

6 files changed

+73
-0
lines changed

6 files changed

+73
-0
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ iOSInjectionProject/
112112

113113
# Custom
114114
.DS_Store
115+
Heim/DataModule/config/*

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Heim/DataModule/config"]
2+
path = Heim/DataModule/config
3+
url = [email protected]:clxxrlove/iOS05-Heim-config.git

Diff for: Heim/DataModule/DataModule.xcodeproj/project.pbxproj

+18
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
4093ABAE2CDB9CC300F7E060 /* Domain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B307B4C32CD9B77C001C5040 /* Domain.framework */; };
1111
4093ABAF2CDB9CC300F7E060 /* Domain.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B307B4C32CD9B77C001C5040 /* Domain.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1212
B307B46D2CD9B50B001C5040 /* DataModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B307B4622CD9B50B001C5040 /* DataModule.framework */; };
13+
B33AC1B32CEE16DC005CDE18 /* ApiConfiguration.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */; };
1314
/* End PBXBuildFile section */
1415

1516
/* Begin PBXContainerItemProxy section */
@@ -40,6 +41,7 @@
4041
B307B4622CD9B50B001C5040 /* DataModule.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DataModule.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4142
B307B46C2CD9B50B001C5040 /* DataModuleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DataModuleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
4243
B307B4C32CD9B77C001C5040 /* Domain.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Domain.framework; sourceTree = BUILT_PRODUCTS_DIR; };
44+
B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ApiConfiguration.xcconfig; sourceTree = "<group>"; };
4345
/* End PBXFileReference section */
4446

4547
/* Begin PBXFileSystemSynchronizedRootGroup section */
@@ -78,6 +80,7 @@
7880
B307B4582CD9B50B001C5040 = {
7981
isa = PBXGroup;
8082
children = (
83+
B33AC1B22CEE16DC005CDE18 /* config */,
8184
B307B4642CD9B50B001C5040 /* DataModule */,
8285
B307B4702CD9B50B001C5040 /* DataModuleTests */,
8386
B307B4C22CD9B77C001C5040 /* Frameworks */,
@@ -102,6 +105,14 @@
102105
name = Frameworks;
103106
sourceTree = "<group>";
104107
};
108+
B33AC1B22CEE16DC005CDE18 /* config */ = {
109+
isa = PBXGroup;
110+
children = (
111+
B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */,
112+
);
113+
path = config;
114+
sourceTree = "<group>";
115+
};
105116
/* End PBXGroup section */
106117

107118
/* Begin PBXHeadersBuildPhase section */
@@ -210,6 +221,7 @@
210221
isa = PBXResourcesBuildPhase;
211222
buildActionMask = 2147483647;
212223
files = (
224+
B33AC1B32CEE16DC005CDE18 /* ApiConfiguration.xcconfig in Resources */,
213225
);
214226
runOnlyForDeploymentPostprocessing = 0;
215227
};
@@ -271,6 +283,7 @@
271283
/* Begin XCBuildConfiguration section */
272284
B307B4762CD9B50B001C5040 /* Debug */ = {
273285
isa = XCBuildConfiguration;
286+
baseConfigurationReference = B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */;
274287
buildSettings = {
275288
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
276289
CLANG_ENABLE_MODULES = YES;
@@ -284,6 +297,7 @@
284297
ENABLE_MODULE_VERIFIER = YES;
285298
ENABLE_USER_SCRIPT_SANDBOXING = NO;
286299
GENERATE_INFOPLIST_FILE = YES;
300+
INFOPLIST_FILE = DataModule/Info.plist;
287301
INFOPLIST_KEY_NSHumanReadableCopyright = "";
288302
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
289303
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
@@ -312,6 +326,7 @@
312326
};
313327
B307B4772CD9B50B001C5040 /* Release */ = {
314328
isa = XCBuildConfiguration;
329+
baseConfigurationReference = B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */;
315330
buildSettings = {
316331
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
317332
CLANG_ENABLE_MODULES = YES;
@@ -325,6 +340,7 @@
325340
ENABLE_MODULE_VERIFIER = YES;
326341
ENABLE_USER_SCRIPT_SANDBOXING = NO;
327342
GENERATE_INFOPLIST_FILE = YES;
343+
INFOPLIST_FILE = DataModule/Info.plist;
328344
INFOPLIST_KEY_NSHumanReadableCopyright = "";
329345
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
330346
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
@@ -352,6 +368,7 @@
352368
};
353369
B307B4782CD9B50B001C5040 /* Debug */ = {
354370
isa = XCBuildConfiguration;
371+
baseConfigurationReference = B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */;
355372
buildSettings = {
356373
ALWAYS_SEARCH_USER_PATHS = NO;
357374
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
@@ -418,6 +435,7 @@
418435
};
419436
B307B4792CD9B50B001C5040 /* Release */ = {
420437
isa = XCBuildConfiguration;
438+
baseConfigurationReference = B33AC1B12CEE16DC005CDE18 /* ApiConfiguration.xcconfig */;
421439
buildSettings = {
422440
ALWAYS_SEARCH_USER_PATHS = NO;
423441
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//
2+
// SpotifyEnvironment.swift
3+
// DataModule
4+
//
5+
// Created by 정지용 on 11/13/24.
6+
//
7+
8+
import Foundation
9+
10+
enum SpotifyEnvironment {
11+
private static let frameworkBundle = Bundle(identifier: "kr.codesquad.boostcamp9.Heim.DataModule")
12+
13+
static let clientId = {
14+
guard let frameworkBundle,
15+
let clientId = frameworkBundle.infoDictionary?["SPOTIFY_CLIENT_ID"] as? String else {
16+
fatalError("Can't load environment: SPOTIFY_CLIENT_ID")
17+
}
18+
return clientId
19+
}()
20+
21+
static let oauthBaseURL = {
22+
guard let frameworkBundle,
23+
let oauthBaseURL = frameworkBundle.infoDictionary?["SPOTIFY_OAUTH_BASE_URL"] as? String else {
24+
fatalError("Can't load environment: SPOTIFY_OAUTH_BASE_URL")
25+
}
26+
return oauthBaseURL
27+
}()
28+
29+
static let apiBaseURL = {
30+
guard let frameworkBundle,
31+
let apiBaseURL = frameworkBundle.infoDictionary?["SPOTIFY_API_BASE_URL"] as? String else {
32+
fatalError("Can't load environment: SPOTIFY_API_BASE_URL")
33+
}
34+
return apiBaseURL
35+
}()
36+
37+
static let redirectURI: String = "Heim://spotifyLogin"
38+
static let accessTokenAttributeKey: String = "a3f24f4a11fd0135627ddd8ab9f40cbe"
39+
static let refreshTokenAttributeKey: String = "65f9c2d174ff38ead38339d7dec2389c"
40+
}

Diff for: Heim/DataModule/DataModule/Info.plist

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SPOTIFY_API_BASE_URL</key>
6+
<string>${SPOTIFY_API_BASE_URL}</string>
7+
<key>SPOTIFY_CLIENT_ID</key>
8+
<string>${SPOTIFY_CLIENT_ID}</string>
9+
</dict>
10+
</plist>

Diff for: Heim/DataModule/config

Submodule config added at 4a1232e

0 commit comments

Comments
 (0)