Skip to content

Commit

Permalink
Merge branch 'release/0.31.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Jan 13, 2023
2 parents cd5c1b7 + 24d849d commit 5f6abb1
Show file tree
Hide file tree
Showing 355 changed files with 4,997 additions and 3,515 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ If at any point it isn't actively being worked on/ready for review/otherwise mov

**Steps to test this PR**:
1.
1.

**Testing checklist**:

* [ ] Test with Release configuration
* [ ] Test proper deallocation of tabs
* [ ] Make sure committed submodule changes are desired
* [ ] Make sure configuration is changed only in xcconfig files, not in the Xcode project file directly

---
###### Internal references:
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gitsubmodule" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
51 changes: 51 additions & 0 deletions .swiftlint.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# swiftlint config applied for Tests

disabled_rules:
- no_space_in_method_call
- multiple_closures_with_trailing_closure
- block_based_kvo
- compiler_protocol_init
- unused_setter_value
- line_length
- type_name
- force_cast
- force_try
- function_body_length
- cyclomatic_complexity
- identifier_name
- implicit_getter

opt_in_rules:
- file_header

# Rule Config
file_length:
warning: 1800
error: 2000
type_body_length:
warning: 1000
error: 1500
nesting:
type_level: 4
large_tuple:
warning: 6
error: 10
file_header:
required_pattern: |
\/\/
\/\/ .*?\.swift
\/\/
\/\/ Copyright © \d{4} 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\.
\/\/
11 changes: 8 additions & 3 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
disabled_rules:
- trailing_whitespace
- no_space_in_method_call
- multiple_closures_with_trailing_closure
- block_based_kvo
- compiler_protocol_init
- unused_setter_value
- line_length
- type_name
- implicit_getter
- function_parameter_count

opt_in_rules:
- file_header

custom_rules:
explicit_non_final_class:
included: ".*\\.swift"
excluded: ".*Tests\\.swift"
name: "Implicitly non-final class"
regex: "^\\s*(class) (?!func|var)"
capture_group: 0
Expand All @@ -35,6 +35,9 @@ type_body_length:
error: 500
nesting:
type_level: 2
large_tuple:
warning: 4
error: 5
file_header:
required_pattern: |
\/\/
Expand All @@ -58,4 +61,6 @@ file_header:
# General Config
excluded:
- DuckDuckGo/Common/Localizables/UserText.swift

- Unit Tests
- Integration Tests
- UI Tests
45 changes: 45 additions & 0 deletions Configuration/App/AppTargetsBase.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright © 2022 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.
//

#include "../Common.xcconfig"

ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon
ASSETCATALOG_COMPILER_APPICON_NAME[config=Debug] = Icon - Debug
ASSETCATALOG_COMPILER_APPICON_NAME[config=CI] = Icon - Debug
ASSETCATALOG_COMPILER_APPICON_NAME[config=Review] = Icon - Review

ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = GlobalAccentColor

CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES

CURRENT_PROJECT_VERSION = $(MARKETING_VERSION)

ENABLE_HARDENED_RUNTIME = YES

PRODUCT_BUNDLE_IDENTIFIER[sdk=*] = $(BUNDLE_IDENTIFIER_PREFIX)
PRODUCT_BUNDLE_IDENTIFIER[config=Debug][sdk=*] = $(BUNDLE_IDENTIFIER_PREFIX).debug
PRODUCT_BUNDLE_IDENTIFIER[config=CI][sdk=*] = $(BUNDLE_IDENTIFIER_PREFIX).debug
PRODUCT_BUNDLE_IDENTIFIER[config=Review][sdk=*] = $(BUNDLE_IDENTIFIER_PREFIX).review

INFOPLIST_FILE = DuckDuckGo/Info.plist

LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks

PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
PRODUCT_NAME = $(PRODUCT_NAME_PREFIX)
PRODUCT_NAME[config=Review] = $(PRODUCT_NAME_PREFIX) Review

SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/DuckDuckGo/Bridging.h
36 changes: 36 additions & 0 deletions Configuration/App/DuckDuckGo.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright © 2022 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.
//

#include "AppTargetsBase.xcconfig"

BUNDLE_IDENTIFIER_PREFIX = com.duckduckgo.macos.browser

CODE_SIGN_ENTITLEMENTS = DuckDuckGo/DuckDuckGo.entitlements
CODE_SIGN_ENTITLEMENTS[config=CI] = DuckDuckGo/DuckDuckGoCI.entitlements

CODE_SIGN_STYLE[sdk=*] = Manual
CODE_SIGN_STYLE[config=Debug][sdk=*] = Automatic

CODE_SIGN_IDENTITY[sdk=macosx*] = Developer ID Application
CODE_SIGN_IDENTITY[config=Debug][sdk=macosx*] = Apple Development
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

PRODUCT_NAME_PREFIX = DuckDuckGo

PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] =
PROVISIONING_PROFILE_SPECIFIER[config=Release][sdk=macosx*] = MacOS Browser
PROVISIONING_PROFILE_SPECIFIER[config=Review][sdk=macosx*] = MacOS Browser Product Review

#include? "../../LocalOverrides.xcconfig"
36 changes: 36 additions & 0 deletions Configuration/Common.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright © 2022 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.
//

#include "Version.xcconfig"

COMBINE_HIDPI_IMAGES = YES

DEVELOPMENT_TEAM = HKE973VLUW
DEVELOPMENT_TEAM[config=CI][sdk=*] =

FEATURE_FLAGS = FEEDBACK

GCC_PREPROCESSOR_DEFINITIONS[config=CI][arch=*][sdk=*] = DEBUG=1 CI=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Debug][arch=*][sdk=*] = DEBUG=1 $(inherited)
GCC_PREPROCESSOR_DEFINITIONS[config=Review][arch=*][sdk=*] = REVIEW=1 $(inherited)

MACOSX_DEPLOYMENT_TARGET = 10.15

SWIFT_ACTIVE_COMPILATION_CONDITIONS[arch=*][sdk=*] = $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=CI][arch=*][sdk=*] = DEBUG CI $(FEATURE_FLAGS)
SWIFT_ACTIVE_COMPILATION_CONDITIONS[config=Debug][arch=*][sdk=*] = DEBUG $(FEATURE_FLAGS)

SWIFT_VERSION = 5.0

87 changes: 87 additions & 0 deletions Configuration/Global.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// Copyright © 2022 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.
//

ALWAYS_SEARCH_USER_PATHS = NO
CLANG_ANALYZER_NONNULL = YES
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE
CLANG_CXX_LANGUAGE_STANDARD = gnu++14
CLANG_CXX_LIBRARY = libc++
CLANG_ENABLE_MODULES = YES
CLANG_ENABLE_OBJC_ARC = YES
CLANG_ENABLE_OBJC_WEAK = YES
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES
CLANG_WARN_BOOL_CONVERSION = YES
CLANG_WARN_COMMA = YES
CLANG_WARN_CONSTANT_CONVERSION = YES
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR
CLANG_WARN_DOCUMENTATION_COMMENTS = YES
CLANG_WARN_EMPTY_BODY = YES
CLANG_WARN_ENUM_CONVERSION = YES
CLANG_WARN_INFINITE_RECURSION = YES
CLANG_WARN_INT_CONVERSION = YES
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES
CLANG_WARN_STRICT_PROTOTYPES = YES
CLANG_WARN_SUSPICIOUS_MOVE = YES
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
CLANG_WARN_UNREACHABLE_CODE = YES
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
COPY_PHASE_STRIP = NO

DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
DEBUG_INFORMATION_FORMAT[config=CI][arch=*][sdk=*] = dwarf
DEBUG_INFORMATION_FORMAT[config=Debug][arch=*][sdk=*] = dwarf

ENABLE_NS_ASSERTIONS = NO
ENABLE_NS_ASSERTIONS[config=CI][arch=*][sdk=*] = YES
ENABLE_NS_ASSERTIONS[config=Debug][arch=*][sdk=*] = YES

ENABLE_STRICT_OBJC_MSGSEND = YES
ENABLE_TESTABILITY = YES
GCC_C_LANGUAGE_STANDARD = gnu11
GCC_DYNAMIC_NO_PIC = NO
GCC_NO_COMMON_BLOCKS = YES
GCC_OPTIMIZATION_LEVEL = 0
GCC_WARN_64_TO_32_BIT_CONVERSION = YES
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR
GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES

MTL_ENABLE_DEBUG_INFO = NO
MTL_ENABLE_DEBUG_INFO[config=CI][arch=*][sdk=*] = INCLUDE_SOURCE
MTL_ENABLE_DEBUG_INFO[config=Debug][arch=*][sdk=*] = INCLUDE_SOURCE

MTL_FAST_MATH = YES

ONLY_ACTIVE_ARCH = NO
ONLY_ACTIVE_ARCH[config=Debug][arch=*][sdk=*] = YES
ONLY_ACTIVE_ARCH[config=CI][arch=*][sdk=*] = YES

SDKROOT = macosx

SWIFT_OPTIMIZATION_LEVEL = -O
SWIFT_OPTIMIZATION_LEVEL[config=CI][arch=*][sdk=*] = -Onone
SWIFT_OPTIMIZATION_LEVEL[config=Debug][arch=*][sdk=*] = -Onone

SWIFT_COMPILATION_MODE = wholemodule
SWIFT_COMPILATION_MODE[config=CI][arch=*][sdk=*] =
SWIFT_COMPILATION_MODE[config=Debug][arch=*][sdk=*] =
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
// limitations under the License.
//

#include? "Version.xcconfig"
#include "TestsTargetsBase.xcconfig"

MACOSX_DEPLOYMENT_TARGET = 11.1

INFOPLIST_FILE = Integration Tests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.Integration-Tests

32 changes: 32 additions & 0 deletions Configuration/Tests/TestsTargetsBase.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright © 2022 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.
//

#include "../Common.xcconfig"

BUNDLE_LOADER=$(TEST_HOST)

CODE_SIGN_STYLE = Automatic
CODE_SIGN_IDENTITY[config=CI][sdk=macosx*] =

DEAD_CODE_STRIPPING = YES

INFOPLIST_FILE = DuckDuckGo/Info.plist

LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks

PRODUCT_MODULE_NAME = $(TARGET_NAME:c99extidentifier)
PRODUCT_NAME = $(TARGET_NAME)

TEST_HOST=$(BUILT_PRODUCTS_DIR)/DuckDuckGo.app/Contents/MacOS/DuckDuckGo
23 changes: 23 additions & 0 deletions Configuration/Tests/UnitTests.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright © 2022 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.
//

#include "TestsTargetsBase.xcconfig"

ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES

INFOPLIST_FILE = Unit Tests/Info.plist
PRODUCT_BUNDLE_IDENTIFIER = com.duckduckgo.macos.browser.DuckDuckGoTests

SWIFT_OBJC_BRIDGING_HEADER = $(SRCROOT)/Unit Tests/Common/TestsBridging.h
Loading

0 comments on commit 5f6abb1

Please sign in to comment.