Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
woin2ee committed Aug 4, 2024
2 parents cd15b67 + f1d10db commit b380434
Show file tree
Hide file tree
Showing 38 changed files with 163 additions and 153 deletions.
106 changes: 46 additions & 60 deletions Project.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ExternalDependencyPlugin
import MicroFeaturePlugin
import ProjectDescription
import ProjectDescriptionHelpers

Expand All @@ -17,28 +18,12 @@ func commonTargets() -> [Target] {
appendSchemeTo: &schemes
),

// MARK: Utility

Target.makeCommonFramework(
name: Module.utility,
scripts: [
// 공동 작업자의 githook path 자동 세팅을 위함
.pre(
path: "Scripts/set_githooks_path.sh",
name: "Set githooks path",
basedOnDependencyAnalysis: false
),
],
hasTests: true,
appendSchemeTo: &schemes
),

// MARK: Domain

Target.makeCommonFramework(
name: Module.domain.core,
dependencies: [
.target(name: Module.utility),
.target(utilityFeature.source),
.external(name: .foundationPlus),
.external(name: .swinject),
.external(name: .swinjectExtension),
Expand Down Expand Up @@ -191,39 +176,39 @@ func commonTargets() -> [Target] {
func iOSTargets() -> [Target] {
[
Target.target(
name: "\(PROJECT_NAME)UITests",
name: "\(env.projectName)UITests",
destinations: [.iPhone],
product: .uiTests,
bundleId: "\(BASIC_BUNDLE_ID)UITests",
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
sources: "Tests/\(PROJECT_NAME)UITests/**",
bundleId: "\(env.baseBundleID)UITests",
deploymentTargets: .iOS(env.minimumIOSVersion),
sources: "Tests/\(env.projectName)UITests/**",
dependencies: [
.target(name: "\(PROJECT_NAME)Dev"),
.target(name: "\(env.projectName)Dev"),
.target(name: Module.iOSSupport),
.target(name: Module.utility),
.target(utilityFeature.source),
.target(name: Module.testsSupport),
]
),
Target.target(
name: "SnapshotGenerator",
destinations: .iOS,
product: .uiTests,
bundleId: "\(BASIC_BUNDLE_ID).SnapshotGenerator",
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
bundleId: "\(env.baseBundleID).SnapshotGenerator",
deploymentTargets: .iOS(env.minimumIOSVersion),
sources: "Tests/SnapshotGenerator/**",
dependencies: [
.target(name: "\(PROJECT_NAME)Dev"),
.target(name: "\(env.projectName)Dev"),
.target(name: Module.iOSSupport),
.target(name: Module.utility),
.target(utilityFeature.source),
.target(name: Module.testsSupport),
]
),
Target.target(
name: "IOSSceneIntegrationTests",
destinations: .iOS,
product: .unitTests,
bundleId: "\(BASIC_BUNDLE_ID).IOSSceneIntegrationTests",
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
bundleId: "\(env.baseBundleID).IOSSceneIntegrationTests",
deploymentTargets: .iOS(env.minimumIOSVersion),
sources: "Tests/IOSSceneIntegrationTests/**",
dependencies: [
.target(name: Module.iOSScene.wordChecking),
Expand All @@ -241,7 +226,7 @@ func iOSTargets() -> [Target] {
Target.makeIOSFramework(
name: Module.iOSSupport,
dependencies: [
.target(name: Module.utility),
.target(utilityFeature.source),
.target(name: Module.domain.googleDrive),
.target(name: Module.domain.localNotification),
.target(name: Module.domain.userSettings),
Expand Down Expand Up @@ -290,7 +275,7 @@ func iOSTargets() -> [Target] {
name: "IOSScene_WordCheckingExample",
destinations: .iOS,
product: .app,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSExampleInfoPlist)),
dependencies: [
.target(name: Module.iOSScene.wordChecking),
Expand Down Expand Up @@ -322,7 +307,7 @@ func iOSTargets() -> [Target] {
name: "\(Module.iOSScene.wordList)Example",
destinations: .iOS,
product: .app,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSExampleInfoPlist)),
dependencies: [
.target(name: Module.iOSScene.wordList),
Expand Down Expand Up @@ -351,7 +336,7 @@ func iOSTargets() -> [Target] {
name: "\(Module.iOSScene.wordDetail)Example",
destinations: .iOS,
product: .app,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSExampleInfoPlist)),
dependencies: [
.target(name: Module.iOSScene.wordDetail),
Expand Down Expand Up @@ -396,7 +381,7 @@ func iOSTargets() -> [Target] {
name: "IOSScene_UserSettingsExample",
destinations: .iOS,
product: .app,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSExampleInfoPlist)),
dependencies: [
.target(name: Module.iOSScene.userSettings),
Expand All @@ -413,7 +398,7 @@ func iOSTargets() -> [Target] {
name: "TestingApp",
destinations: .iOS,
product: .app,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSExampleInfoPlist)),
dependencies: [
.target(name: Module.iOSSupport),
Expand All @@ -427,7 +412,7 @@ func iOSTargets() -> [Target] {
name: Module.iOSDriver,
destinations: [.iPhone, .iPad],
product: .framework,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
dependencies: [
.target(name: Module.container),
.target(name: Module.iOSSupport),
Expand All @@ -443,7 +428,7 @@ func iOSTargets() -> [Target] {
name: Module.iPhoneDriver,
destinations: [.iPhone],
product: .framework,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
dependencies: [
.target(name: Module.container),
.target(name: Module.iOSDriver),
Expand All @@ -455,7 +440,7 @@ func iOSTargets() -> [Target] {
name: Module.iPadDriver,
destinations: [.iPad],
product: .framework,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
deploymentTargets: .iOS(env.minimumIOSVersion),
dependencies: [
.target(name: Module.container),
.target(name: Module.iOSDriver),
Expand All @@ -464,11 +449,11 @@ func iOSTargets() -> [Target] {
appendSchemeTo: &schemes
),
Target.makeTargets(
name: PROJECT_NAME,
name: env.projectName,
destinations: [.iPhone, .iPad],
product: .app,
bundleID: BASIC_BUNDLE_ID,
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
bundleID: env.baseBundleID,
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSInfoPlist)),
dependencies: [
.target(name: Module.iPhoneDriver),
Expand All @@ -489,11 +474,11 @@ func iOSTargets() -> [Target] {
appendSchemeTo: &schemes
),
Target.makeTargets(
name: "\(PROJECT_NAME)Dev",
name: "\(env.projectName)Dev",
destinations: [.iPhone, .iPad],
product: .app,
bundleID: "\(BASIC_BUNDLE_ID)Dev",
deploymentTargets: .iOS(MINIMUM_IOS_VERSION),
bundleID: "\(env.baseBundleID)Dev",
deploymentTargets: .iOS(env.minimumIOSVersion),
infoPlist: .file(path: .path(Constant.Path.iOSInfoPlist)),
dependencies: [
.target(name: Module.iPhoneDriver),
Expand All @@ -518,11 +503,11 @@ func iOSTargets() -> [Target] {
}

let macAppTargets = Target.makeTargets(
name: "\(PROJECT_NAME)Mac",
name: "\(env.projectName)Mac",
destinations: [.mac],
product: .app,
bundleID: "\(BASIC_BUNDLE_ID)Mac",
deploymentTargets: .macOS(MINIMUM_MACOS_VERSION),
bundleID: "\(env.baseBundleID)Mac",
deploymentTargets: .macOS(env.minimumMacOSVersion),
infoPlist: .file(path: .path(Constant.Path.macInfoPlist)),
entitlements: .file(path: .path(Constant.Path.macEntitlements)),
dependencies: [
Expand All @@ -549,13 +534,14 @@ let allTargets: [Target] = [
macAppTargets
]
.flatMap { $0 }
+ utilityFeature.resolveModules()

// MARK: - Project

let project: Project = .init(
name: PROJECT_NAME,
organizationName: ORGANIZATION,
options: .options(automaticSchemesOptions: .disabled),
name: env.projectName,
organizationName: env.organization,
options: .options(),
packages: [
.package(url: "https://github.com/google/google-api-objectivec-client-for-rest.git", .exact("3.5.4")),
.package(url: "https://github.com/google/GoogleSignIn-iOS.git", .exact("6.2.4")),
Expand All @@ -571,32 +557,32 @@ let project: Project = .init(
targets: allTargets,
schemes: schemes + [
.scheme(
name: PROJECT_NAME,
buildAction: .buildAction(targets: ["\(PROJECT_NAME)"]),
name: env.projectName,
buildAction: .buildAction(targets: ["\(env.projectName)"]),
runAction: .runAction(
configuration: .release,
attachDebugger: false,
executable: "\(PROJECT_NAME)"
executable: "\(env.projectName)"
),
profileAction: .profileAction(executable: "\(PROJECT_NAME)")
profileAction: .profileAction(executable: "\(env.projectName)")
),
.scheme(
name: "\(PROJECT_NAME)Dev",
runAction: .runAction(executable: "\(PROJECT_NAME)Dev")
name: "\(env.projectName)Dev",
runAction: .runAction(executable: "\(env.projectName)Dev")
),
.scheme(
name: "\(PROJECT_NAME)Dev_InMemoryDB",
name: "\(env.projectName)Dev_InMemoryDB",
runAction: .runAction(
executable: "\(PROJECT_NAME)Dev",
executable: "\(env.projectName)Dev",
arguments: .arguments(launchArguments: [
.launchArgument(name: "-useInMemoryDatabase", isEnabled: true)
])
)
),
.scheme(
name: "\(PROJECT_NAME)Dev_SampleDB",
name: "\(env.projectName)Dev_SampleDB",
runAction: .runAction(
executable: "\(PROJECT_NAME)Dev",
executable: "\(env.projectName)Dev",
arguments: .arguments(launchArguments: [
.launchArgument(name: "-sampledDatabase", isEnabled: true)
])
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
Add frequently forgotten words and memorize them!

https://apps.apple.com/kr/app/id6465133881

## Screenshots

<img src='https://github.com/user-attachments/assets/43bb9855-1165-4a54-b314-be4224274258' width=260/>

<img src='https://github.com/user-attachments/assets/81093b70-462c-4cc9-b9f0-14bd6307aa8e' width=260/>

<img src='https://github.com/user-attachments/assets/9fb5761e-5af7-47dc-af2e-e6347b22e1cf' width=260/>

![iPad Pro (12 9-inch) (4th generation)-02-quick-add_framed](https://github.com/user-attachments/assets/cd2b1bb2-3848-4bf9-a28d-420051eb126e)
16 changes: 16 additions & 0 deletions Resources/IOSScene/WordList/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@
}
}
},
"edit_list" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Edit list"
}
},
"ko" : {
"stringUnit" : {
"state" : "translated",
"value" : "목록 수정"
}
}
}
},
"editWord" : {
"localizations" : {
"en" : {
Expand Down
24 changes: 17 additions & 7 deletions Sources/Domain/GoogleDrive/Service/DefaultGoogleDriveService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import GoogleAPIClientForRESTCore
import GoogleAPIClientForREST_Drive
import RxSwift
import RxSwiftSugar
import Utility
import UtilitySource

public final class DefaultGoogleDriveService: GoogleDriveService {

Expand Down Expand Up @@ -154,22 +154,27 @@ public final class DefaultGoogleDriveService: GoogleDriveService {
}

return .create { observer in
Task {
let task = Task {
try Task.checkCancellation()
let backupFileList = try await self.fetchBackupFileList(backupFileName: backupFileName.rawValue)

guard let backupFileID = backupFileList.files?.first?.identifier else {
observer(.failure(GoogleDriveServiceError.noFileInDrive))
return
}

let dataObject = try await GoogleDriveAPI(authentication: currentUser.authentication).files.get(forFileID: backupFileID)
try Task.checkCancellation()
let api = GoogleDriveAPI(authentication: currentUser.authentication)
let dataObject = try await api.files.get(forFileID: backupFileID)

observer(.success(BackupFile(name: backupFileName, data: dataObject.data)))
} catch: {
observer(.failure($0))
}

return Disposables.create()
return Disposables.create {
task.cancel()
}
}
}

Expand All @@ -179,25 +184,30 @@ public final class DefaultGoogleDriveService: GoogleDriveService {
}

return .create { observer in
Task {
let task = Task {
try Task.checkCancellation()
let backupFileList = try await self.fetchBackupFileList(backupFileName: backupFileName.rawValue)

guard let backupFiles = backupFileList.files else {
observer(.success(()))
return
}

try Task.checkCancellation()
let api = GoogleDriveAPI(authentication: currentUser.authentication)
try await backupFiles.compactMap(\.identifier)
.asyncForEach {
try await GoogleDriveAPI(authentication: currentUser.authentication).files.delete(byFileID: $0)
try await api.files.delete(byFileID: $0)
}

observer(.success(()))
} catch: {
observer(.failure($0))
}

return Disposables.create()
return Disposables.create {
task.cancel()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ExtendedUserDefaults
import Foundation
import Swinject
import Utility
import UtilitySource

public final class DomainUserSettingsAssemblyDev: Assembly {

Expand Down
Loading

0 comments on commit b380434

Please sign in to comment.