You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validate embedded frameworks as part of the `ValidateProductTaskAction` to surface issues which would later prevent installation or App Store submission.
rdar://124355004
@@ -45,6 +47,8 @@ public final class ValidateProductTaskAction: TaskAction {
45
47
varapplicationPath:Path!=nil
46
48
varinfoplistSubpath:String!=nil
47
49
varvalidateExtension=true
50
+
varvalidateEmbeddedFrameworks=true
51
+
varisShallowBundle=false
48
52
49
53
varhadErrors=false
50
54
func error(_ message:String){
@@ -79,7 +83,13 @@ public final class ValidateProductTaskAction: TaskAction {
79
83
80
84
// The default is yes, so we only need an opt-out for now. This also prevents us from having to pass in `-validate-extension` everywhere, even though that is the default behavior.
81
85
case"-no-validate-extension":
82
-
validateExtension =false;
86
+
validateExtension =false
87
+
88
+
case"-no-validate-embedded-frameworks":
89
+
validateEmbeddedFrameworks =false
90
+
91
+
case"-shallow-bundle":
92
+
isShallowBundle =true
83
93
84
94
case"-infoplist-subpath":
85
95
guardlet path = generator.next()else{
@@ -133,8 +143,10 @@ public final class ValidateProductTaskAction: TaskAction {
// It seems reasonably common that developers mix up the formats, so we check that to be more helpful.
232
+
if isShallow, fs.exists(frameworkPath.join(Self.deepBundleInfoPlistSubpath)){
233
+
outputDelegate.emitError("Framework \(frameworkPath.str) contains \(Self.deepBundleInfoPlistSubpath), expected \(Self.shallowBundleInfoPlistSubpath) at the root level since the platform uses shallow bundles")
outputDelegate.emitError("Framework \(frameworkPath.str) contains \(Self.shallowBundleInfoPlistSubpath), expected \(Self.deepBundleInfoPlistSubpath) since the platform does not use shallow bundles")
236
+
}else{
237
+
outputDelegate.emitError("Framework \(frameworkPath.str) did not contain an Info.plist")
// Note that there is a lot of type validation which *could* be performed here (e.g., emitting an error if some value is not the expected type), but I've only copied the validation being performed in XCWorkQueueCommandBuiltinInvocation_validationUtility, from which this was ported.
0 commit comments