Summary: The decodeObjectCheck in ProfileTests was unused
Reviewed By: joesus
Differential Revision: D39778958
fbshipit-source-id: 7b7b539548d94f8078fb552455271a0ac16e11b1
Summary: Updated `xcodeVersion` from **13.3** to **14.0** in `xcodegen_project_common.yml` so that the `LastUpgradeCheck` gets set to **1440** so that Xcode doesn't ask to update to recommended settings.
Reviewed By: samodom
Differential Revision: D39708211
fbshipit-source-id: 0a4c135451dd5a9c64b7bc42a934d6869778eb72
Summary:
More context here:
https://github.com/realm/SwiftLint/issues/4015
The full warning is:
```
warning build: Run script build phase 'Run Swiftlint' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```
The fix is to uncheck "Based on dependency analysis" for the run script build phase.
This adds a "alwaysOutOfDate = 1;" setting to the Xcode pbxproj file
This setting is turned on by using "basedOnDependencyAnalysis: false" in xcodegen
Reviewed By: samodom
Differential Revision: D39678897
fbshipit-source-id: 90ed96cab52c3e2a0be3082dc94884a773faa1c6
Summary:
The IPHONEOS_DEPLOYMENT_TARGET and TVOS_DEPLOYMENT_TARGET are now 12.0
The main code change update was to use the "requiringSecureCoding" version of the `NSKeyedArchiver.archivedData(withRootObject:requiringSecureCoding:)` method.
Reviewed By: samodom
Differential Revision: D39670757
fbshipit-source-id: c98c47d4bef591c96bed33391b0393920a50ebfe
Summary: Xcode compatibility version is changed to 11 in TestTools every time "generate-projects.sh" is run. Changing it once and for all to avoid its generation every time.
Reviewed By: samodom
Differential Revision: D38867127
fbshipit-source-id: 6101ba28d13461399da5d0b35499c020da607f97
Summary: Adds additional method to notification delivering protocol to mirror what is in Foundation’s Notification interface.
Reviewed By: josueBrizuelaXD
Differential Revision: D37653609
fbshipit-source-id: a1d2f6bd25d3749317fe5c7635773b85bdc40f6d
Summary: Moves the helper to test tools so that it can be used in GamingServicesKit tests.
Reviewed By: josueBrizuelaXD
Differential Revision: D37648330
fbshipit-source-id: b135bcc2b56989c49b00b38d0632dd5f2b47856c
Summary: The NSURLSessionDataTask and NSURLSession bases for these protocols create a risk of conflict if we make any of the referenced symbols more abstract
Reviewed By: joesus
Differential Revision: D37358714
fbshipit-source-id: 4d88162f2f212702612a1eebe1f157a6d9a08154
Summary: The NSBundle basis for this protocol creates a risk of conflict if we make any of the referenced symbols more abstract
Reviewed By: joesus
Differential Revision: D37358716
fbshipit-source-id: 2ca5885075e89bddbab664a1e6b785772577f6cd
Summary: This protocol isn't strictly necessary and will cause issues with symbol ambiguity in Swift.
Reviewed By: shuxinzhang
Differential Revision: D36887434
fbshipit-source-id: b26d3f446a7c38c0c2360c8609dd505e3b64ec02
Summary: This protocol isn't strictly necessary and is causing issues with symbol ambiguity in Swift.
Reviewed By: shuxinzhang
Differential Revision: D36887435
fbshipit-source-id: f876d53e3b055d55051921e9c5190d8f33c010ee
Summary:
* Make `AuthenticationToken` use `current` as the Swift name for `currentAuthenticationToken`
* Declare `AccessToken` conformance to `AccessTokenSetting`
* Declare `AuthenticationToken` conformance to `AuthenticationTokenProviding` and `AuthenticationTokenSetting`
* Make `AuthenticationTokenProviding` and `AuthenticationTokenSetting` use `current` as the Swift name for `currentAuthenticationToken`
* Declare `Profile` conformance to `ProfileProviding`
Reviewed By: josueBrizuelaXD
Differential Revision: D36706552
fbshipit-source-id: 714e02483c23cb1dbff001cb27c2cb59e9e1626b
Summary: We were using the wrong Swift name for the current access token when accessing it via the provider abstraction.
Reviewed By: jawwad
Differential Revision: D35806611
fbshipit-source-id: fdf857e5343b913bed36f84d46ef5c2af62470c5
Summary:
This diff also ads a TestUtils.encodeAndDecode(_:) method to reduce some boilerplate in tests and make it silghtly easier to do the rest of these tasks.
I couldn't use XCTUnwrap in TestUtils since I can't import XCTest because its in the TestTools project and not in a test target. So I decided to just return an optional and have the caller unwrap it.
Reviewed By: wx0165927473, samodom
Differential Revision: D35320238
fbshipit-source-id: 53c5f1a96b32e71eb8efc48a5a24a7920d2487a4
Summary:
Updated `xcodeVersion` from **13.2** to **13.3** in `xcodegen_project_common.yml` so that the `LastUpgradeCheck` gets set to **1330** so that Xcode doesn't ask to update to recommended settings.
Did it manually for the `FBSDKTVOSKit` project since that project file isn't generated with xcodegen.
Reviewed By: samodom
Differential Revision: D35147732
fbshipit-source-id: 3dbd970e846d45439b60df6bcefecc9db56fdbdf
Summary:
- In the build phase this is shown as a "Show environment variables in build log" option that can be unchecked
- This in turn adds the following line to the pbxproj file "showEnvVarsInLog = 0"
- With xcodegen this option is disabled by setting "showEnvVars: false"
This gets rid of the lines that say "export ENV_VAR_NAME..."
This change reduces the number of lines in the build output from ~6000 to ~3000
```
xcodebuild clean build -workspace FacebookSDK.xcworkspace -scheme BuildAllKits-Dynamic > ~/Desktop/xcodebuild_log_before.txt
// Made this change
xcodebuild clean build -workspace FacebookSDK.xcworkspace -scheme BuildAllKits-Dynamic > ~/Desktop/xcodebuild_log_after.txt
$ wc -l ~/Desktop/xcodebuild_log_before.txt
6232 /Users/jawwad/Desktop/xcodebuild_log_before.txt
$ wc -l ~/Desktop/xcodebuild_log_after.txt
3123 /Users/jawwad/Desktop/xcodebuild_log_after.txt
```
Reviewed By: samodom
Differential Revision: D35067834
fbshipit-source-id: c1a42a053a4a31e4646e9d766f00b970e776472d
Summary: This allows for stubbing behavior and maintains the spy-like behavior already available.
Differential Revision: D34899787
fbshipit-source-id: 84b6f77c1bf27c1a1879510ec8b0e5efc5b44681
Summary:
## See the following [Proposal](https://fburl.com/gdoc/z90ch5in)
## Problem
We want to add support for universal links.
In order to do that, developers who have app events integration (AEM) will be required to add a call to the `openURL:` on the SDK delegate class from `application(_:continue:restorationHandler:)` in the short term.
We would like to simplify things for app developers since extracting the webpage URL from NSUserActivity may cause confusion and errors for deep linking.
## Solution
The better way is to just introduce a method with a similar signature to `application(_:continue:restorationHandler:)` in the SDK delegate.
Developers could simply invoke that method in order to have the universal link processed.
By doing that, we will to make FB SDK more accessible to developers.
## Testing
See the test plan section
Reviewed By: samodom
Differential Revision: D34786435
fbshipit-source-id: 289fea5ecc9e106fe0c9fcc94bf2a65b0c07c0ab
Summary: Also enabled the `trailingCommas` rule in SwiftFormat so that these will be corrected when running swiftformat
Reviewed By: samodom
Differential Revision: D34253615
fbshipit-source-id: 7c450fdd8a15070a8445c9380ab5ba33c2952cdc
Summary:
There were only 2 instances in which I had to add a disable comment for prefer_final_classes due to subclassing
Used the following to add the final keyword (Adds final to any class that doesn't have final or open before it and doesn't have func after it)
```
find . -name '*.swift' | xargs perl -pi -e 's/(?<!final )(?<!open )(class (?!func).*\{)/final \1/g'
```
Reviewed By: samodom
Differential Revision: D34119233
fbshipit-source-id: 963d64fefc1686095d0bfe18ac7cb9677606f4e6
Summary:
* Conformance to protocol in multiple places by InternalUtility was failing to compile (from Swift conversion of ShareDialog)
* Corrected name (and file name) to reflect internal use
Reviewed By: jawwad
Differential Revision: D33923076
fbshipit-source-id: 8517accfd70ab39b3837c03c32fff97996628807
Summary:
Added a custom rule named `swiftlint_disable_without_this_or_next` to discourage bare usage of "swiftlint:disable"
If you really need to use a global disable, you can add the following line before it to disable its flagging
```
// swiftlint:disable:next swiftlint_disable_without_this_or_next
```
Yes, you'd need to disable flagging of your swiftlint:disable with a swiftlint:disable:next.
There are 2 rules that are exempt from being flagged when disabled globally: implicitly_unwrapped_optional and force_unwrapping
i.e. the following disables won't be flagged
```
// swiftlint:disable implicitly_unwrapped_optional
// swiftlint:disable force_unwrapping
```
Reviewed By: samodom
Differential Revision: D33809590
fbshipit-source-id: f2b6d656b6ea8a4c5f4e20ddd16790cb9d650473
Summary: Set it to 56 which is our current maximum variable length. (Setting to 55 shows 2 warnings)
Reviewed By: samodom
Differential Revision: D33808397
fbshipit-source-id: c162362a20d11426fa024bd79f1bc8563d19e01f
Summary:
This is to prevent the following error that was seen in D33750740 (8044535803)
```
objc attribute used without importing module 'Foundation'
```
Found the files with:
```
git ls-files '*.swift' | xargs ack -l 'objc' | xargs ack -L 'import (Foundation|XCTest)'
```
Note: In D33783526 (4610b07bda) a custom SwiftLint rule was added to detect this but it only works if there aren't any other imports.
Reviewed By: samodom
Differential Revision: D33803396
fbshipit-source-id: 575d7798a77aac30384f8f44c1d45f97d60fe8f7
Summary:
In D33750740 (8044535803) Hackbook started showing me the following error
```
objc attribute used without importing module 'Foundation'
```
This custom rule should prevent most cases of this. (It will only detect cases in which there are only empty lines between the license and the first objc)
Ran the following to add missing imports
```
git ls-files '*.swift' | xargs perl -0777 -pi -e s'/(of this source tree.\n \*\/)\n+\objc/\1\n\nimport Foundation\n\n\objc/'
```
Reviewed By: samodom
Differential Revision: D33783526
fbshipit-source-id: e75e1a66152d9a9790aa363d2fe7c71fd9446849
Summary: The IPHONEOS_DEPLOYMENT_TARGET and TVOS_DEPLOYMENT_TARGET are now 11.0
Reviewed By: samodom
Differential Revision: D33721097
fbshipit-source-id: 95afae6119fe09c0773252890aef6411f54d24d1
Summary: Also unnest test error type
Reviewed By: jamestouri
Differential Revision: D33380686
fbshipit-source-id: b9a966222a720087858ab0dde693b965f0644d1b
Summary: This allows us to use both the consolidated list of components and the configurator to help bootstrap the SDK
Reviewed By: joesus
Differential Revision: D33345887
fbshipit-source-id: 8ee6d8fb6a6085e430646bd6f342955da1de92d7
Summary:
- Also enabled the assertionFailures rule but that doesn't produce any changes
- Added comments to some of the commented out disabled rules to explain what they do
Reviewed By: joesus
Differential Revision: D33180271
fbshipit-source-id: 9e9785de04108741bf6376cd0d3261448173a9ca
Summary: Just fixed things in tests since these wouldn't affect the public API. (There were a lot of things that I also didn't fix that could have been fixed without changing the public API because there were just so many changes). Mostly commiting this as a proof of concept as to how the acronyms rule can eventually make us more pedantic.
Reviewed By: joesus
Differential Revision: D33180069
fbshipit-source-id: 9c5cad75c33016e2a8154abada74bda59699c899
Summary:
* Abstract info dictionary provider
* Add bundle identifier to info dictionary providing protocol
* Abstract internal utility
* Lots of test changes to account for convoluted URL transformations in production code and transitive dependencies
Reviewed By: joesus
Differential Revision: D33105452
fbshipit-source-id: 32fab998a278b7ffba45b904362824f9ffb93845
Summary: This required reworking a test that was indirectly testing the shared internal utility and, by extension, other transitive dependencies
Reviewed By: joesus
Differential Revision: D33096088
fbshipit-source-id: b44d4ed9e606c12dbae565381565da7ea3c90da9
Summary: A previous change to some URL creation interfaces to move query items from `[String: Any]` to `[String: String]` needed further propagation to other interfaces resulting in a cascade of changes to internal files.
Reviewed By: joesus
Differential Revision: D33154458
fbshipit-source-id: 1bcc5813769d6486e3f7463252f2768ab907324e
Summary:
This rule has the following options:
```
--self # Explicit self: "insert", "remove" (default) or "init-only"
```
The init-only option will always use self in init methods even if it's not needed, but with the default "remove" option it will only use if its needed because of the parameter name being the same as the variable being set.
Reviewed By: samodom
Differential Revision: D33051306
fbshipit-source-id: 3dd5508ce7970792bdfe0c184a0eb8255283e047