From 89fc08061ae6f80c03acc22b6ea7b7453dfc9cfd Mon Sep 17 00:00:00 2001 From: Yusuke Hosonuma Date: Tue, 18 Aug 2020 11:55:59 +0900 Subject: [PATCH] fix: build error on Mac --- LifeGameApp.xcodeproj/project.pbxproj | 18 +++++++++--------- Podfile | 1 + Podfile.lock | 2 +- Shared/Environment/SettingEnvironment.swift | 6 ++++-- Shared/Model/UserDefaultSetting.swift | 2 +- {iOS/Model => Shared/Util}/AppLogger.swift | 0 iOS/Screen/MainGame/BoardContainerView.swift | 4 ++++ 7 files changed, 20 insertions(+), 13 deletions(-) rename {iOS/Model => Shared/Util}/AppLogger.swift (100%) diff --git a/LifeGameApp.xcodeproj/project.pbxproj b/LifeGameApp.xcodeproj/project.pbxproj index 277a0fd..4484e15 100644 --- a/LifeGameApp.xcodeproj/project.pbxproj +++ b/LifeGameApp.xcodeproj/project.pbxproj @@ -93,9 +93,9 @@ E574356D24E9767900BB27CA /* SignInOutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E574356C24E9767900BB27CA /* SignInOutView.swift */; }; E574356E24E9767900BB27CA /* SignInOutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E574356C24E9767900BB27CA /* SignInOutView.swift */; }; E574357024E97CF900BB27CA /* BoardSelectHistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E574356F24E97CF900BB27CA /* BoardSelectHistoryView.swift */; }; - E574357124E97CF900BB27CA /* BoardSelectHistoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E574356F24E97CF900BB27CA /* BoardSelectHistoryView.swift */; }; E580AA6D24E12F34007C60F1 /* BoardPresetFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = E580AA6C24E12F34007C60F1 /* BoardPresetFile.swift */; }; E580AAB824E14759007C60F1 /* LifeGameFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = E580AAB724E14759007C60F1 /* LifeGameFileManager.swift */; }; + E58AB3A224EB77AA00339348 /* AppLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5C8D5C024E8E503005DB0FC /* AppLogger.swift */; }; E58CC55D24CB99D600048A0A /* LifeGame in Frameworks */ = {isa = PBXBuildFile; productRef = E58CC55C24CB99D600048A0A /* LifeGame */; }; E58D5F0D24E7698A000A0345 /* NWPathMonitor+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = E58D5F0C24E7698A000A0345 /* NWPathMonitor+Publisher.swift */; }; E58D5F0E24E7698A000A0345 /* NWPathMonitor+Publisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = E58D5F0C24E7698A000A0345 /* NWPathMonitor+Publisher.swift */; }; @@ -470,6 +470,7 @@ E571536424D51B5B003B4C9E /* Util */ = { isa = PBXGroup; children = ( + E5C8D5C024E8E503005DB0FC /* AppLogger.swift */, E5E50A2424E52C5300CD64B6 /* GraphicsImageRenderer.swift */, E571536524D51B73003B4C9E /* UserDefaultConvertible.swift */, E571536824D51B9F003B4C9E /* UserDefault.swift */, @@ -581,7 +582,6 @@ isa = PBXGroup; children = ( E5C8D5BE24E8D49C005DB0FC /* UIImageWrapper.swift */, - E5C8D5C024E8E503005DB0FC /* AppLogger.swift */, ); path = Model; sourceTree = ""; @@ -1151,6 +1151,7 @@ E580AAB824E14759007C60F1 /* LifeGameFileManager.swift in Sources */, E58F427124E6C6FF0062E2FF /* BoardContainerView.swift in Sources */, E55F7AA624DD0C1000DBC175 /* MacRootView.swift in Sources */, + E58AB3A224EB77AA00339348 /* AppLogger.swift in Sources */, E572C8DD24DAE72C0030B192 /* BoardSizeMenu.swift in Sources */, E55F7AAA24DD101900DBC175 /* PresetListView.swift in Sources */, E53DFF7B24DC09BC00DC8F4F /* FirestoreBoardRepository.swift in Sources */, @@ -1158,7 +1159,6 @@ E571536724D51B73003B4C9E /* UserDefaultConvertible.swift in Sources */, E507482024CD4E45003811B5 /* HCenter.swift in Sources */, E58F427224E6C71F0062E2FF /* BoardRenderImage.swift in Sources */, - E574357124E97CF900BB27CA /* BoardSelectHistoryView.swift in Sources */, E518213424CC2E5300ABD16B /* Color+.swift in Sources */, E518213124CC27CC00ABD16B /* SettingEnvironment.swift in Sources */, E526A07524EAB08400D76ECD /* BoardItem.swift in Sources */, @@ -1400,7 +1400,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = AA4808E2DBA26DB7C461E341 /* Pods-LifeGameApp (iOS).debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iOS/Resources/LifeGameApp.entitlements; @@ -1426,7 +1426,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 462FD68D509C302C01C06A52 /* Pods-LifeGameApp (iOS).release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = iOS/Resources/LifeGameApp.entitlements; @@ -1456,10 +1456,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = macOS/Resources/macOS.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_ASSET_PATHS = "Shared/Preview\\ Conent"; + DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = P437HSA6PY; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; @@ -1483,10 +1483,10 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = macOS/Resources/macOS.entitlements; - CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_ASSET_PATHS = "Shared/Preview\\ Conent"; + DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = P437HSA6PY; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; diff --git a/Podfile b/Podfile index 064d856..3087bcd 100644 --- a/Podfile +++ b/Podfile @@ -22,6 +22,7 @@ target 'LifeGameApp (macOS)' do use_frameworks! pod 'Firebase/Core' + pod 'Firebase/Auth' pod 'Firebase/Firestore' pod 'FirebaseFirestoreSwift' end diff --git a/Podfile.lock b/Podfile.lock index 8bf90f6..e2aa5ff 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -394,6 +394,6 @@ SPEC CHECKSUMS: nanopb: c43f40fadfe79e8b8db116583945847910cbabc9 PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6 -PODFILE CHECKSUM: 845561c03f87fe70d412532662313bd2d50f51dc +PODFILE CHECKSUM: b0807015dd305d5886351026ed31ec73b41f2b67 COCOAPODS: 1.9.3 diff --git a/Shared/Environment/SettingEnvironment.swift b/Shared/Environment/SettingEnvironment.swift index 481becd..eb7910b 100644 --- a/Shared/Environment/SettingEnvironment.swift +++ b/Shared/Environment/SettingEnvironment.swift @@ -41,10 +41,12 @@ final class SettingEnvironment: ObservableObject { // FIXME: 背景画像が復元されない。 #warning("FIXME: 背景画像が起動時に復元されない(読み取れない)不具合あり。アプリ側のバグの可能性が高く感じるが、現時点ではOS側のバグも考慮。(beta4)") + #if os(iOS) AppLogger.imageLoadBug.notice("[Start] loading background image.") let image = UserDefaultSetting.shared.backgroundImage.image backgroundImage = image AppLogger.imageLoadBug.notice("[End] loading background image: \(image == nil ? "nil" : "found!", privacy: .public)") + #endif #if os(iOS) boardSelectDisplayStyle = UserDefaultSetting.shared.boardSelectDisplayStyle @@ -76,13 +78,13 @@ final class SettingEnvironment: ObservableObject { .dropFirst() .assign(to: \.zoomLevel, on: UserDefaultSetting.shared) .store(in: &cancellables) + + #if os(iOS) $backgroundImage .dropFirst() .map(UIImageWrapper.init) .assign(to: \.backgroundImage, on: UserDefaultSetting.shared) .store(in: &cancellables) - - #if os(iOS) $boardSelectDisplayStyle .dropFirst() .assign(to: \.boardSelectDisplayStyle, on: UserDefaultSetting.shared) diff --git a/Shared/Model/UserDefaultSetting.swift b/Shared/Model/UserDefaultSetting.swift index 43571cb..69b3fe0 100644 --- a/Shared/Model/UserDefaultSetting.swift +++ b/Shared/Model/UserDefaultSetting.swift @@ -28,10 +28,10 @@ final class UserDefaultSetting { @UserDefault(key: "zoomLevel", defaultValue: DefaultZoomLevel) var zoomLevel: Int + #if os(iOS) @UserDefault(key: "backgroundImage", defaultValue: UIImageWrapper(nil)) var backgroundImage: UIImageWrapper - #if os(iOS) @UserDefault(key: "boardSelectDisplayStyle", defaultValue: DefaultBoardSelectDisplayStyle) var boardSelectDisplayStyle: BoardSelectStyle diff --git a/iOS/Model/AppLogger.swift b/Shared/Util/AppLogger.swift similarity index 100% rename from iOS/Model/AppLogger.swift rename to Shared/Util/AppLogger.swift diff --git a/iOS/Screen/MainGame/BoardContainerView.swift b/iOS/Screen/MainGame/BoardContainerView.swift index 15e6055..ef6ee82 100644 --- a/iOS/Screen/MainGame/BoardContainerView.swift +++ b/iOS/Screen/MainGame/BoardContainerView.swift @@ -34,9 +34,12 @@ struct BoardContainerView: View { // MARK: Views var body: some View { + #if os(iOS) AppLogger.imageLoadBug.notice("BoardContainerView.body: \(setting.backgroundImage == nil ? "nil" : "found!", privacy: .public)") + #endif return GeometryReader { geometry in ZStack { + #if os(iOS) if let image = setting.backgroundImage { Image(image: image) .resizable() @@ -44,6 +47,7 @@ struct BoardContainerView: View { .opacity(0.7) .frame(width: geometry.size.width, height: geometry.size.height) } + #endif BoardRenderImage( board: viewModel.board.board, cellRenderSize: cellRenderSize,