This is an automated email from the ASF dual-hosted git repository.
dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-ios.git
The following commit(s) were added to refs/heads/master by this push:
new 6db1b6e0 fix: Apply new Xcode flags consistently across test projects
(#1343)
6db1b6e0 is described below
commit 6db1b6e0b2ef372d7757ba313b69639d1e0329c7
Author: Darryl Pogue <[email protected]>
AuthorDate: Mon Jun 12 06:07:13 2023 -0700
fix: Apply new Xcode flags consistently across test projects (#1343)
* fix: Error finding WKWebViewConfiguration class
* fix: Resolve Xcode test warnings
* fix: Don't enable script sandboxing in projects by default
This seems to cause too many issues with various 3rd party plugins and
pods, so just keep the existing behaviour for generated project files.
---
CordovaLib/Classes/Public/CDVViewController.m | 1 +
.../__PROJECT_NAME__.xcodeproj/project.pbxproj | 4 +-
tests/CordovaLibTests/CDVPluginInitTests.m | 8 +++-
.../CordovaLibTests.xcodeproj/project.pbxproj | 23 +++++++---
.../xcshareddata/xcschemes/CordovaLibApp.xcscheme | 2 +-
.../xcschemes/CordovaLibTests.xcscheme | 2 +-
.../SampleApp.xcodeproj/project.pbxproj | 51 +++++++++++++---------
7 files changed, 58 insertions(+), 33 deletions(-)
diff --git a/CordovaLib/Classes/Public/CDVViewController.m
b/CordovaLib/Classes/Public/CDVViewController.m
index 3b95fc98..9302dc2b 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -19,6 +19,7 @@
@import AVFoundation;
@import Foundation;
+@import WebKit;
#import <objc/message.h>
#import <Foundation/NSCharacterSet.h>
diff --git a/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
b/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
index 3ce8caf9..d01241ee 100755
--- a/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
+++ b/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj
@@ -384,7 +384,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_THUMB_SUPPORT = NO;
@@ -429,7 +429,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_THUMB_SUPPORT = NO;
diff --git a/tests/CordovaLibTests/CDVPluginInitTests.m
b/tests/CordovaLibTests/CDVPluginInitTests.m
index 4e765004..c5f8779a 100644
--- a/tests/CordovaLibTests/CDVPluginInitTests.m
+++ b/tests/CordovaLibTests/CDVPluginInitTests.m
@@ -63,6 +63,12 @@
{
CDVPlugin* swiftPlugin = [self pluginInstance:@"SwiftInit"];
- XCTAssertTrue([@"Successfully initialized" isEqualToString:[swiftPlugin
performSelector:sel_getUid("getInitString")]]);
+ XCTAssertTrue([@"Successfully initialized" isEqualToString:[swiftPlugin
performSelector:@selector(getInitString)]]);
+}
+
+// Unused, just to avoid a warning about the selector use above
+- (NSString*)getInitString
+{
+ return nil;
}
@end
diff --git a/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj
b/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj
index ca669b41..5e014bdc 100644
--- a/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj
+++ b/tests/CordovaLibTests/CordovaLibTests.xcodeproj/project.pbxproj
@@ -400,13 +400,15 @@
);
inputPaths = (
"",
+
"$(SRCROOT)/../../templates/project/www/cordova.js",
);
name = "Copy cordova.js into www directory";
outputPaths = (
+
$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cp
../../templates/project/www/cordova.js
\"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\"";
+ shellScript = "cp
../../templates/project/www/cordova.js
\"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\"\n";
showEnvVarsInLog = 0;
};
C0FA7CA61E4BB6420077B045 /* Copy cordova.js into www directory
*/ = {
@@ -416,13 +418,15 @@
);
inputPaths = (
"",
+
"$(SRCROOT)/../../templates/project/www/cordova.js",
);
name = "Copy cordova.js into www directory";
outputPaths = (
+
$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js,
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cp
../../templates/project/www/cordova.js
\"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\"";
+ shellScript = "cp
../../templates/project/www/cordova.js
\"$BUILT_PRODUCTS_DIR/$FULL_PRODUCT_NAME/www/cordova.js\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -521,6 +525,7 @@
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED =
YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -533,6 +538,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER =
YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -540,12 +546,11 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_THUMB_SUPPORT = NO;
- GCC_VERSION =
com.apple.compilers.llvm.clang.1_0;
+ GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -554,6 +559,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS =
"@executable_path/Frameworks";
+ MERGED_BINARY_TYPE = automatic;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DDEBUG";
OTHER_LDFLAGS = (
@@ -577,6 +583,7 @@
buildSettings = {
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED =
YES;
CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
@@ -589,17 +596,18 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_PREPROCESSOR_DEFINITIONS = "";
GCC_THUMB_SUPPORT = NO;
- GCC_VERSION =
com.apple.compilers.llvm.clang.1_0;
+ GCC_VERSION = "";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -608,6 +616,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS =
"@executable_path/Frameworks";
+ MERGED_BINARY_TYPE = automatic;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"-all_load",
diff --git
a/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme
b/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme
index 7d6f65f2..75fb1233 100644
---
a/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme
+++
b/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibApp.xcscheme
@@ -3,7 +3,7 @@
LastUpgradeVersion = "1130"
version = "1.7">
<BuildAction
- parallelizeBuildables = "NO"
+ parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
diff --git
a/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme
b/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme
index 54f0e1b0..dcbe4a90 100644
---
a/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme
+++
b/tests/cordova-ios.xcworkspace/xcshareddata/xcschemes/CordovaLibTests.xcscheme
@@ -3,7 +3,7 @@
LastUpgradeVersion = "1130"
version = "1.3">
<BuildAction
- parallelizeBuildables = "NO"
+ parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
diff --git
a/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj
b/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj
index e7c386eb..bd5c3165 100755
---
a/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj
+++
b/tests/spec/unit/fixtures/ios-config-xml/SampleApp.xcodeproj/project.pbxproj
@@ -13,6 +13,8 @@
301BF552109A68D80062928A /* libCordova.a in Frameworks */ =
{isa = PBXBuildFile; fileRef = 301BF535109A57CC0062928A /* libCordova.a */;
settings = {ATTRIBUTES = (Required, ); }; };
302D95F114D2391D003F00A1 /* MainViewController.m in Sources */
= {isa = PBXBuildFile; fileRef = 302D95EF14D2391D003F00A1 /*
MainViewController.m */; };
302D95F214D2391D003F00A1 /* MainViewController.xib in Resources
*/ = {isa = PBXBuildFile; fileRef = 302D95F014D2391D003F00A1 /*
MainViewController.xib */; };
+ 4E7CA2B6272ABB0D00177EF9 /* config.xml in Copy Staging
Resources */ = {isa = PBXBuildFile; fileRef = F840E1F0165FE0F500CFE078 /*
config.xml */; };
+ 4E7CA2B7272ABB0D00177EF9 /* www in Copy Staging Resources */ =
{isa = PBXBuildFile; fileRef = 301BF56E109A69640062928A /* www */; };
6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in
Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /*
CDVLaunchScreen.storyboard */; };
/* End PBXBuildFile section */
@@ -40,6 +42,21 @@
};
/* End PBXContainerItemProxy section */
+/* Begin PBXCopyFilesBuildPhase section */
+ 857339E32710CC9700A1C74C /* Copy Staging Resources */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 7;
+ files = (
+ 4E7CA2B6272ABB0D00177EF9 /* config.xml in Copy
Staging Resources */,
+ 4E7CA2B7272ABB0D00177EF9 /* www in Copy Staging
Resources */,
+ );
+ name = "Copy Staging Resources";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
/* Begin PBXFileReference section */
0207DA571B56EA530066E2B4 /* Assets.xcassets */ = {isa =
PBXFileReference; lastKnownFileType = folder.assetcatalog; name =
Assets.xcassets; path = "SampleApp/Assets.xcassets"; sourceTree = SOURCE_ROOT;
};
1D3623240D0F684500981E51 /* AppDelegate.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
AppDelegate.h; sourceTree = "<group>"; };
@@ -186,7 +203,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 1D6058960D05DD3E006BFB54 /*
Build configuration list for PBXNativeTarget "SampleApp" */;
buildPhases = (
- 304B58A110DAC018002A0835 /* Copy www directory
*/,
+ 857339E32710CC9700A1C74C /* Copy Staging
Resources */,
1D60588D0D05DD3D006BFB54 /* Resources */,
1D60588E0D05DD3D006BFB54 /* Sources */,
1D60588F0D05DD3D006BFB54 /* Frameworks */,
@@ -207,6 +224,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
+ BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1130;
TargetAttributes = {
1D6058900D05DD3D006BFB54 = {
@@ -216,10 +234,9 @@
};
buildConfigurationList = C01FCF4E08A954540054247B /*
Build configuration list for PBXProject "SampleApp" */;
compatibilityVersion = "Xcode 11.0";
- developmentRegion = English;
+ developmentRegion = en;
hasScannedForEncodings = 1;
knownRegions = (
- English,
en,
Base,
);
@@ -268,24 +285,6 @@
};
/* End PBXResourcesBuildPhase section */
-/* Begin PBXShellScriptBuildPhase section */
- 304B58A110DAC018002A0835 /* Copy www directory */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Copy www directory";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript =
"\"$SRCROOT/SampleApp/Scripts/copy-www-build-step.sh\"";
- showEnvVarsInLog = 0;
- };
-/* End PBXShellScriptBuildPhase section */
-
/* Begin PBXSourcesBuildPhase section */
1D60588E0D05DD3D006BFB54 /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -329,7 +328,9 @@
LD_RUNPATH_SEARCH_PATHS =
"@executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER =
com.example.friendstring;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_WORKSPACE = NO;
};
name = Debug;
};
@@ -352,7 +353,9 @@
LD_RUNPATH_SEARCH_PATHS =
"@executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER =
com.example.friendstring;
PRODUCT_NAME = "$(TARGET_NAME)";
+ SUPPORTS_MACCATALYST = YES;
TARGETED_DEVICE_FAMILY = "1,2";
+ VALIDATE_WORKSPACE = NO;
};
name = Release;
};
@@ -375,6 +378,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER =
YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -382,6 +386,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_THUMB_SUPPORT = NO;
@@ -392,6 +397,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ MERGED_BINARY_TYPE = automatic;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
@@ -419,12 +425,14 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ 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_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_THUMB_SUPPORT = NO;
@@ -435,6 +443,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ MERGED_BINARY_TYPE = automatic;
SDKROOT = iphoneos;
SKIP_INSTALL = NO;
WK_WEB_VIEW_ONLY = 1;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]