From f7308515460ff0c8f86876eda83a26532efc6420 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sat, 12 Oct 2019 11:43:57 -0500 Subject: [PATCH 1/2] New strategy for asset overrides. Fixes popup warnings --- .gitignore | 4 ++++ Loop.xcodeproj/project.pbxproj | 14 ++++++++------ Loop/DerivedAssets.xcassets/Contents.json | 6 ++++++ Scripts/build-derived-assets.sh | 5 ++--- Scripts/build-derived-watch-assets.sh | 10 ++++------ WatchApp/DerivedAssets.xcassets/Contents.json | 6 ++++++ 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 Loop/DerivedAssets.xcassets/Contents.json create mode 100644 WatchApp/DerivedAssets.xcassets/Contents.json diff --git a/.gitignore b/.gitignore index d8ac3c4b53..25319f7984 100644 --- a/.gitignore +++ b/.gitignore @@ -70,3 +70,7 @@ RemoteSettings.plist # Framework development Loop.xcworkspace + +# Avoid checking in built assets +Loop/DerivedAssets.xcassets/ +WatchApp/DerivedAssets.xcassets/ diff --git a/Loop.xcodeproj/project.pbxproj b/Loop.xcodeproj/project.pbxproj index 642937a34e..04e468f81f 100644 --- a/Loop.xcodeproj/project.pbxproj +++ b/Loop.xcodeproj/project.pbxproj @@ -378,10 +378,11 @@ C17824A61E1AF91F00D9D25C /* BolusRecommendation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17824A41E1AD4D100D9D25C /* BolusRecommendation.swift */; }; C1814B86225E507C008D2D8E /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1814B85225E507C008D2D8E /* Sequence.swift */; }; C18C8C511D5A351900E043FB /* NightscoutDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */; }; + C1A3EED2235233E1007672E3 /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1A3EED1235233E1007672E3 /* DerivedAssets.xcassets */; }; + C1A3EED423523551007672E3 /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1A3EED323523551007672E3 /* DerivedAssets.xcassets */; }; C1C0BE2A224C0FA000C03B4D /* SwiftCharts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4346D1EF1C781BEA00ABAFE3 /* SwiftCharts.framework */; }; C1C6591C1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json in Resources */ = {isa = PBXBuildFile; fileRef = C1C6591B1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json */; }; C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F0F1DE3D0270022FC89 /* InfoPlist.strings */; }; - C1D1405F22FB7ADF00DA6242 /* DerivedWatchAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1D1405E22FB7ADF00DA6242 /* DerivedWatchAssets.xcassets */; }; C1D289B522F90A52003FFBD9 /* BasalDeliveryState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1D289B422F90A52003FFBD9 /* BasalDeliveryState.swift */; }; C1E2773E224177C000354103 /* ClockKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1E2773D224177C000354103 /* ClockKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; C1E2774822433D7A00354103 /* MKRingProgressView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1E2774722433D7A00354103 /* MKRingProgressView.framework */; }; @@ -1033,9 +1034,9 @@ C18A491422FCC22900FDA733 /* build-derived-watch-assets.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-derived-watch-assets.sh"; sourceTree = ""; }; C18A491522FCC22900FDA733 /* copy-plugins.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "copy-plugins.sh"; sourceTree = ""; }; C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NightscoutDataManager.swift; sourceTree = ""; }; + C1A3EED1235233E1007672E3 /* DerivedAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = DerivedAssets.xcassets; sourceTree = ""; }; + C1A3EED323523551007672E3 /* DerivedAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = DerivedAssets.xcassets; sourceTree = ""; }; C1C6591B1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = recommend_temp_basal_dropping_then_rising.json; sourceTree = ""; }; - C1D1405822FB69CC00DA6242 /* DerivedAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = DerivedAssets.xcassets; sourceTree = BUILT_PRODUCTS_DIR; }; - C1D1405E22FB7ADF00DA6242 /* DerivedWatchAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = DerivedWatchAssets.xcassets; sourceTree = BUILT_PRODUCTS_DIR; }; C1D197FE232CF92D0096D646 /* capture-build-details.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "capture-build-details.sh"; sourceTree = ""; }; C1D289B422F90A52003FFBD9 /* BasalDeliveryState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BasalDeliveryState.swift; sourceTree = ""; }; C1E2773D224177C000354103 /* ClockKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ClockKit.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/ClockKit.framework; sourceTree = DEVELOPER_DIR; }; @@ -1289,7 +1290,7 @@ 43F5C2D41B92A4A6003EB13D /* Info.plist */, 43776F8F1B8022E90074EA36 /* AppDelegate.swift */, 43776F981B8022E90074EA36 /* DefaultAssets.xcassets */, - C1D1405822FB69CC00DA6242 /* DerivedAssets.xcassets */, + C1A3EED1235233E1007672E3 /* DerivedAssets.xcassets */, 43776F9A1B8022E90074EA36 /* LaunchScreen.storyboard */, 43776F951B8022E90074EA36 /* Main.storyboard */, 43E344A01B9E144300C85C07 /* Extensions */, @@ -1324,7 +1325,7 @@ isa = PBXGroup; children = ( 894F71E11FFEC4D8007D365C /* DefaultAssets.xcassets */, - C1D1405E22FB7ADF00DA6242 /* DerivedWatchAssets.xcassets */, + C1A3EED323523551007672E3 /* DerivedAssets.xcassets */, C1C73F0F1DE3D0270022FC89 /* InfoPlist.strings */, 43F5C2D61B92A4DC003EB13D /* Info.plist */, 43A943741B926B7B0051FA24 /* Interface.storyboard */, @@ -2230,6 +2231,7 @@ C13255D6223E7BE2008AF50C /* BolusProgressTableViewCell.xib in Resources */, 43FCBBC21E51710B00343C1B /* LaunchScreen.storyboard in Resources */, 7D70764F1FE06EE1004AC8EA /* InfoPlist.strings in Resources */, + C1A3EED2235233E1007672E3 /* DerivedAssets.xcassets in Resources */, 7D7076631FE06EE4004AC8EA /* Localizable.strings in Resources */, 43776F971B8022E90074EA36 /* Main.storyboard in Resources */, C1265BEE231BF7F700652B84 /* DefaultAssets.xcassets in Resources */, @@ -2240,9 +2242,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C1D1405F22FB7ADF00DA6242 /* DerivedWatchAssets.xcassets in Resources */, C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */, 43A943761B926B7B0051FA24 /* Interface.storyboard in Resources */, + C1A3EED423523551007672E3 /* DerivedAssets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Loop/DerivedAssets.xcassets/Contents.json b/Loop/DerivedAssets.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/Loop/DerivedAssets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Scripts/build-derived-assets.sh b/Scripts/build-derived-assets.sh index cd0f985003..33e82d8cf3 100755 --- a/Scripts/build-derived-assets.sh +++ b/Scripts/build-derived-assets.sh @@ -8,10 +8,9 @@ echo "Building DerivedAssets.xcassets" -output="${BUILT_PRODUCTS_DIR}/DerivedAssets.xcassets" -cp -a "${PROJECT_DIR}/Loop/DefaultAssets.xcassets/." "$output" +output="${PROJECT_DIR}/Loop/DerivedAssets.xcassets" -override="${PROJECT_DIR}/../AssetOverrides.xcassets/." +override="${PROJECT_DIR}/../AdditionalAssets.xcassets/." if [ -d $override ]; then echo "Adding asset overrides to DerivedAssets.xcassets" diff --git a/Scripts/build-derived-watch-assets.sh b/Scripts/build-derived-watch-assets.sh index 217b2fc252..b1ca63156b 100755 --- a/Scripts/build-derived-watch-assets.sh +++ b/Scripts/build-derived-watch-assets.sh @@ -5,15 +5,13 @@ # # Copyright © 2019 LoopKit Authors. All rights reserved. -echo "Building WatchDerivedAssets.xcassets" +echo "Building DerivedAssets.xcassets for Watch App" -watch_output="${BUILT_PRODUCTS_DIR}/DerivedWatchAssets.xcassets" -cp -a "${PROJECT_DIR}/WatchApp/DefaultAssets.xcassets/." "$watch_output" +watch_output="${PROJECT_DIR}/WatchApp/DerivedAssets.xcassets" - -watch_override="${PROJECT_DIR}/../WatchAssetOverrides.xcassets/." +watch_override="${PROJECT_DIR}/../AdditionalWatchAssets.xcassets/." if [ -d $watch_override ]; then - echo "Adding asset overrides to DerivedWatchAssets.xcassets" + echo "Adding asset overrides to WatchApp/DerivedAssets.xcassets" cp -a "$watch_override" "$watch_output" fi diff --git a/WatchApp/DerivedAssets.xcassets/Contents.json b/WatchApp/DerivedAssets.xcassets/Contents.json new file mode 100644 index 0000000000..da4a164c91 --- /dev/null +++ b/WatchApp/DerivedAssets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file From 4e5d38a91c51800ac602741fcdf9bc1db3614176 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 13 Oct 2019 08:37:44 -0500 Subject: [PATCH 2/2] Add DefaultAssets.xcassets back to WatchApp target --- Loop.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Loop.xcodeproj/project.pbxproj b/Loop.xcodeproj/project.pbxproj index 04e468f81f..d37871dcfb 100644 --- a/Loop.xcodeproj/project.pbxproj +++ b/Loop.xcodeproj/project.pbxproj @@ -380,6 +380,7 @@ C18C8C511D5A351900E043FB /* NightscoutDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C18C8C501D5A351900E043FB /* NightscoutDataManager.swift */; }; C1A3EED2235233E1007672E3 /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1A3EED1235233E1007672E3 /* DerivedAssets.xcassets */; }; C1A3EED423523551007672E3 /* DerivedAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C1A3EED323523551007672E3 /* DerivedAssets.xcassets */; }; + C1A3EED523535FFF007672E3 /* DefaultAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 894F71E11FFEC4D8007D365C /* DefaultAssets.xcassets */; }; C1C0BE2A224C0FA000C03B4D /* SwiftCharts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4346D1EF1C781BEA00ABAFE3 /* SwiftCharts.framework */; }; C1C6591C1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json in Resources */ = {isa = PBXBuildFile; fileRef = C1C6591B1E1B1FDA0025CC58 /* recommend_temp_basal_dropping_then_rising.json */; }; C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C1C73F0F1DE3D0270022FC89 /* InfoPlist.strings */; }; @@ -2244,6 +2245,7 @@ files = ( C1C73F0D1DE3D0270022FC89 /* InfoPlist.strings in Resources */, 43A943761B926B7B0051FA24 /* Interface.storyboard in Resources */, + C1A3EED523535FFF007672E3 /* DefaultAssets.xcassets in Resources */, C1A3EED423523551007672E3 /* DerivedAssets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0;