11
11
12
12
namespace Xamarin . MacDev . Tasks {
13
13
class CustomCompileEntitlements : CompileEntitlements {
14
- protected override MobileProvision ? GetMobileProvision ( MobileProvisionPlatform platform , string uuid )
14
+ protected override MobileProvision GetMobileProvision ( MobileProvisionPlatform platform , string uuid )
15
15
{
16
16
if ( File . Exists ( ProvisioningProfile ) )
17
17
return MobileProvision . LoadFromFile ( ProvisioningProfile ) ;
18
18
19
- return null ;
19
+ return null ! ;
20
20
}
21
21
}
22
22
@@ -61,10 +61,10 @@ public void ValidateEntitlement ()
61
61
{
62
62
var task = CreateEntitlementsTask ( out var compiledEntitlements , out var archivedEntitlements ) ;
63
63
ExecuteTask ( task ) ;
64
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
65
- Assert . IsTrue ( compiled . Get < PBoolean > ( EntitlementKeys . GetTaskAllow ) . Value , "#1" ) ;
66
- Assert . AreEqual ( "32UV7A8CDE.com.xamarin.MySingleView" , compiled . Get < PString > ( "application-identifier" ) . Value , "#2" ) ;
67
- Assert . AreEqual ( "Z8CSQKJE7R" , compiled . Get < PString > ( "com.apple.developer.team-identifier" ) . Value , "#3" ) ;
64
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
65
+ Assert . IsTrue ( compiled . Get < PBoolean > ( EntitlementKeys . GetTaskAllow ) ? . Value , "#1" ) ;
66
+ Assert . AreEqual ( "32UV7A8CDE.com.xamarin.MySingleView" , compiled . Get < PString > ( "application-identifier" ) ? . Value , "#2" ) ;
67
+ Assert . AreEqual ( "Z8CSQKJE7R" , compiled . Get < PString > ( "com.apple.developer.team-identifier" ) ? . Value , "#3" ) ;
68
68
Assert . AreEqual ( "applinks:*.xamarin.com" , compiled . GetAssociatedDomains ( ) . ToStringArray ( ) . First ( ) , "#4" ) ;
69
69
Assert . AreEqual ( "Z8CSQKJE7R.*" , compiled . GetPassBookIdentifiers ( ) . ToStringArray ( ) . First ( ) , "#5" ) ;
70
70
Assert . AreEqual ( "Z8CSQKJE7R.com.xamarin.MySingleView" , compiled . GetUbiquityKeyValueStore ( ) , "#6" ) ;
@@ -113,7 +113,7 @@ public void CustomEntitlemements_String (string value)
113
113
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
114
114
task . CustomEntitlements = customEntitlements ;
115
115
ExecuteTask ( task ) ;
116
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
116
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
117
117
Assert . AreEqual ( value ?? string . Empty , compiled . GetString ( "com.xamarin.custom.entitlement" ) ? . Value , "#1" ) ;
118
118
}
119
119
@@ -131,7 +131,7 @@ public void CustomEntitlemements_StringArray ()
131
131
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
132
132
task . CustomEntitlements = customEntitlements ;
133
133
ExecuteTask ( task ) ;
134
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
134
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
135
135
var array = compiled . GetArray ( "com.xamarin.custom.entitlement" ) ;
136
136
Assert . NotNull ( array , "array" ) ;
137
137
Assert . AreEqual ( new string [ ] { "A" , "B" , "C" } , array . ToStringArray ( ) , "array contents" ) ;
@@ -154,7 +154,7 @@ public void CustomEntitlemements_StringArray_CustomSeparator (string separator)
154
154
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
155
155
task . CustomEntitlements = customEntitlements ;
156
156
ExecuteTask ( task ) ;
157
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
157
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
158
158
var array = compiled . GetArray ( "com.xamarin.custom.entitlement" ) ;
159
159
Assert . NotNull ( array , "array" ) ;
160
160
Assert . AreEqual ( new string [ ] { "A;B;C" , "D" , "E" } , array . ToStringArray ( ) , "array contents" ) ;
@@ -166,7 +166,7 @@ public void AllowJit_Default ()
166
166
var task = CreateEntitlementsTask ( out var compiledEntitlements ) ;
167
167
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
168
168
ExecuteTask ( task ) ;
169
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
169
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
170
170
Assert . IsFalse ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
171
171
}
172
172
@@ -180,9 +180,9 @@ public void AllowJit_True ()
180
180
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
181
181
task . CustomEntitlements = customEntitlements ;
182
182
ExecuteTask ( task ) ;
183
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
183
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
184
184
Assert . IsTrue ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
185
- Assert . IsTrue ( compiled . Get < PBoolean > ( EntitlementKeys . AllowExecutionOfJitCode ) . Value , "#2" ) ;
185
+ Assert . IsTrue ( compiled . Get < PBoolean > ( EntitlementKeys . AllowExecutionOfJitCode ) ? . Value , "#2" ) ;
186
186
}
187
187
188
188
[ Test ]
@@ -195,9 +195,9 @@ public void AllowJit_False ()
195
195
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
196
196
task . CustomEntitlements = customEntitlements ;
197
197
ExecuteTask ( task ) ;
198
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
198
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
199
199
Assert . IsTrue ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
200
- Assert . IsFalse ( compiled . Get < PBoolean > ( EntitlementKeys . AllowExecutionOfJitCode ) . Value , "#2" ) ;
200
+ Assert . IsFalse ( compiled . Get < PBoolean > ( EntitlementKeys . AllowExecutionOfJitCode ) ? . Value , "#2" ) ;
201
201
202
202
Assert . That ( archivedEntitlements , Does . Not . Exist , "No archived entitlements" ) ;
203
203
}
@@ -212,7 +212,7 @@ public void AllowJit_None ()
212
212
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=maccatalyst" ;
213
213
task . CustomEntitlements = customEntitlements ;
214
214
ExecuteTask ( task ) ;
215
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
215
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
216
216
Assert . IsFalse ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
217
217
}
218
218
@@ -226,14 +226,14 @@ public void AppIdentifierPrefix ()
226
226
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=ios" ;
227
227
task . CustomEntitlements = customEntitlements ;
228
228
ExecuteTask ( task ) ;
229
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
229
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
230
230
Assert . IsFalse ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
231
- var kag = ( ( PString ) compiled [ "keychain-access-group" ] ) . Value ;
231
+ var kag = ( ( PString ? ) compiled [ "keychain-access-group" ] ) ? . Value ;
232
232
Assert . That ( kag , Is . EqualTo ( "32UV7A8CDE.org.xamarin" ) , "value 1" ) ;
233
233
234
- var archived = PDictionary . FromFile ( archivedEntitlements ) ;
234
+ var archived = PDictionary . FromFile ( archivedEntitlements ) ! ;
235
235
Assert . IsTrue ( archived . ContainsKey ( "keychain-access-group" ) , "archived" ) ;
236
- var archivedKag = ( ( PString ) archived [ "keychain-access-group" ] ) . Value ;
236
+ var archivedKag = ( ( PString ? ) archived [ "keychain-access-group" ] ) ? . Value ;
237
237
Assert . That ( archivedKag , Is . EqualTo ( "32UV7A8CDE.org.xamarin" ) , "archived value 1" ) ;
238
238
}
239
239
@@ -247,14 +247,14 @@ public void TeamIdentifierPrefix ()
247
247
task . TargetFrameworkMoniker = ".NETCoreApp,Version=v6.0,Profile=ios" ;
248
248
task . CustomEntitlements = customEntitlements ;
249
249
ExecuteTask ( task ) ;
250
- var compiled = PDictionary . FromFile ( compiledEntitlements ) ;
250
+ var compiled = PDictionary . FromFile ( compiledEntitlements ) ! ;
251
251
Assert . IsFalse ( compiled . ContainsKey ( EntitlementKeys . AllowExecutionOfJitCode ) , "#1" ) ;
252
- var kag = ( ( PString ) compiled [ "keychain-access-group" ] ) . Value ;
252
+ var kag = ( ( PString ? ) compiled [ "keychain-access-group" ] ) ? . Value ;
253
253
Assert . That ( kag , Is . EqualTo ( "Z8CSQKJE7R.org.xamarin" ) , "value 1" ) ;
254
254
255
- var archived = PDictionary . FromFile ( archivedEntitlements ) ;
255
+ var archived = PDictionary . FromFile ( archivedEntitlements ) ! ;
256
256
Assert . IsTrue ( archived . ContainsKey ( "keychain-access-group" ) , "archived" ) ;
257
- var archivedKag = ( ( PString ) archived [ "keychain-access-group" ] ) . Value ;
257
+ var archivedKag = ( ( PString ? ) archived [ "keychain-access-group" ] ) ? . Value ;
258
258
Assert . That ( archivedKag , Is . EqualTo ( "Z8CSQKJE7R.org.xamarin" ) , "archived value 1" ) ;
259
259
}
260
260
}
0 commit comments