diff --git a/.github/workflows/adhoc.yml b/.github/workflows/adhoc.yml index 6233aefe1f..baca7fb705 100644 --- a/.github/workflows/adhoc.yml +++ b/.github/workflows/adhoc.yml @@ -10,6 +10,14 @@ on: description: "Asana task URL" required: false type: string + build-type: + description: "Build Configuration" + type: choice + required: true + default: 'Alpha' + options: + - Alpha + - Release jobs: make-adhoc: @@ -41,10 +49,15 @@ jobs: APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} run: | + lane_to_use="adhoc" + if [[ "${{ github.event.inputs.build-type }}" == "Release" ]]; then + lane_to_use = "release_adhoc" + fi + if [[ -n "${{ github.event.inputs.suffix }}" ]]; then - bundle exec fastlane adhoc suffix:${{ github.event.inputs.suffix }} + bundle exec fastlane ${lane_to_use} suffix:${{ github.event.inputs.suffix }} else - bundle exec fastlane adhoc + bundle exec fastlane ${lane_to_use} fi - name: Set filenames diff --git a/DuckDuckGo.xcodeproj/project.pbxproj b/DuckDuckGo.xcodeproj/project.pbxproj index 679f2e09ed..3cc0305712 100644 --- a/DuckDuckGo.xcodeproj/project.pbxproj +++ b/DuckDuckGo.xcodeproj/project.pbxproj @@ -576,6 +576,7 @@ 98A16C2D28A11D6200A6C003 /* BrowserServicesKit in Frameworks */ = {isa = PBXBuildFile; productRef = 98A16C2C28A11D6200A6C003 /* BrowserServicesKit */; }; 98A50962294B48A400D10880 /* Bookmarks in Frameworks */ = {isa = PBXBuildFile; productRef = 98A50961294B48A400D10880 /* Bookmarks */; }; 98A54A8422AFCB2D00E541F4 /* Instruments.instrpkg in Sources */ = {isa = PBXBuildFile; fileRef = 98A54A8322AFCB2D00E541F4 /* Instruments.instrpkg */; }; + 98A860EF2C4682E00077FE4D /* BookmarksDebugViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A860EE2C4682E00077FE4D /* BookmarksDebugViewController.swift */; }; 98AA92B32456FBE100ED4B9E /* SearchFieldContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AA92B22456FBE100ED4B9E /* SearchFieldContainerView.swift */; }; 98AAF8E4292EB46000DBDF06 /* BookmarksMigrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AAF8E3292EB46000DBDF06 /* BookmarksMigrationTests.swift */; }; 98B000532915C46E0034BCA0 /* LegacyBookmarksStoreMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98B000522915C46E0034BCA0 /* LegacyBookmarksStoreMigration.swift */; }; @@ -2199,6 +2200,7 @@ 989B337422D7EF2100437824 /* EmptyCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyCollectionReusableView.swift; sourceTree = ""; }; 98A54A8122AFCB2C00E541F4 /* Instruments.instrdst */ = {isa = PBXFileReference; explicitFileType = com.apple.instruments.instrdst; includeInIndex = 0; path = Instruments.instrdst; sourceTree = BUILT_PRODUCTS_DIR; }; 98A54A8322AFCB2D00E541F4 /* Instruments.instrpkg */ = {isa = PBXFileReference; lastKnownFileType = "com.apple.instruments.package-definition"; path = Instruments.instrpkg; sourceTree = ""; }; + 98A860EE2C4682E00077FE4D /* BookmarksDebugViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksDebugViewController.swift; sourceTree = ""; }; 98AA92B22456FBE100ED4B9E /* SearchFieldContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchFieldContainerView.swift; sourceTree = ""; }; 98AAF8E3292EB46000DBDF06 /* BookmarksMigrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksMigrationTests.swift; sourceTree = ""; }; 98AC5D8B251EAC07009B7979 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -3936,6 +3938,7 @@ EE72CA842A862D000043B5B3 /* NetworkProtectionDebugViewController.swift */, CBFCB30D2B2CD47800253E9E /* ConfigurationURLDebugViewController.swift */, 851624C62B96389D002D5CD7 /* HistoryDebugViewController.swift */, + 98A860EE2C4682E00077FE4D /* BookmarksDebugViewController.swift */, ); name = Debug; sourceTree = ""; @@ -6963,6 +6966,7 @@ 31C70B5B2804C61000FB6AD1 /* SaveAutofillLoginManager.swift in Sources */, 982123502B6D233E00F08C57 /* UserSession.swift in Sources */, 85449EFD23FDA71F00512AAF /* KeyboardSettings.swift in Sources */, + 98A860EF2C4682E00077FE4D /* BookmarksDebugViewController.swift in Sources */, 980891A222369ADB00313A70 /* FeedbackUserText.swift in Sources */, 1DEAADFF2BA7832F00E25A97 /* EmailProtectionView.swift in Sources */, 988F3DD3237DE8D900AEE34C /* ForgetDataAlert.swift in Sources */, diff --git a/DuckDuckGo/BookmarksDebugViewController.swift b/DuckDuckGo/BookmarksDebugViewController.swift new file mode 100644 index 0000000000..66cfe15e51 --- /dev/null +++ b/DuckDuckGo/BookmarksDebugViewController.swift @@ -0,0 +1,96 @@ +// +// BookmarksDebugViewController.swift +// DuckDuckGo +// +// Copyright © 2024 DuckDuckGo. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import UIKit +import SwiftUI +import Core +import Combine +import Persistence +import Bookmarks +import CoreData + +class BookmarksDebugViewController: UIHostingController { + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder, rootView: BookmarksDebugRootView()) + } + +} + +struct BookmarksDebugRootView: View { + + @ObservedObject var model = BookmarksDebugViewModel() + + var body: some View { + List(model.bookmarks, id: \.id) { entry in + VStack(alignment: .leading) { + Text(entry.title ?? "empty!") + .font(.system(size: 16)) + Text("Is unified fav: " + (entry.isFavorite(on: .unified) ? "true" : "false") ) + .font(.system(size: 12)) + Text("Is mobile fav: " + (entry.isFavorite(on: .mobile) ? "true" : "false") ) + .font(.system(size: 12)) + Text("Is desktop fav: " + (entry.isFavorite(on: .desktop) ? "true" : "false") ) + .font(.system(size: 12)) + ForEach(model.bookmarkAttributes, id: \.self) { attr in + Text(entry.formattedValue(for: attr)) + .font(.system(size: 12)) + } + + } + } + .navigationTitle("\(model.bookmarks.count) Bookmarks") + } + +} + +extension BookmarkEntity { + + func formattedValue(for key: String) -> String { + key + ": \'" + String(describing: value(forKey: key)) + "'" + } +} + +class BookmarksDebugViewModel: ObservableObject { + + @Published var bookmarks = [BookmarkEntity]() + let bookmarkAttributes: [String] + + let database: CoreDataDatabase + let context: NSManagedObjectContext + + init() { + database = BookmarksDatabase.make() + database.loadStore() + + context = database.makeContext(concurrencyType: .mainQueueConcurrencyType) + bookmarkAttributes = Array(BookmarkEntity.entity(in: context).attributesByName.keys) + + fetch() + } + + func fetch() { + + let fetchRequest = BookmarkEntity.fetchRequest() + fetchRequest.sortDescriptors = [NSSortDescriptor(key: #keyPath(BookmarkEntity.title), + ascending: false)] + fetchRequest.returnsObjectsAsFaults = false + bookmarks = (try? context.fetch(fetchRequest)) ?? [] + } +} diff --git a/DuckDuckGo/Debug.storyboard b/DuckDuckGo/Debug.storyboard index 9d62963206..2ae12b72f9 100644 --- a/DuckDuckGo/Debug.storyboard +++ b/DuckDuckGo/Debug.storyboard @@ -143,7 +143,7 @@ - - + - + + + + + + + + + + + + @@ -177,7 +194,7 @@ - + @@ -197,7 +214,7 @@ - + @@ -217,7 +234,7 @@ - + @@ -229,7 +246,7 @@ - + @@ -241,7 +258,7 @@ - + @@ -250,7 +267,7 @@ - + @@ -259,7 +276,7 @@ - + @@ -268,7 +285,7 @@ - + @@ -277,7 +294,7 @@ - + @@ -286,7 +303,7 @@ - + @@ -295,7 +312,7 @@ - + @@ -304,7 +321,7 @@ - + @@ -313,7 +330,7 @@ - + @@ -322,7 +339,7 @@ - + @@ -878,17 +895,17 @@ - + - + - + - + @@ -946,6 +963,22 @@ + + + + + + + + + + + + + + + + diff --git a/fastlane/Matchfile b/fastlane/Matchfile index eb39fd637c..022ff22969 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -26,6 +26,12 @@ for_lane :adhoc do template_name "Default Web Browser iOS (Dist)" end +for_lane :release_adhoc do + type "adhoc" + force_for_new_devices true + template_name "Default Web Browser iOS (Dist)" +end + for_lane :alpha_adhoc do type "adhoc" app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"]