@@ -33,6 +33,7 @@ Tuple!(PlistDict, PlistDict) sign(
33
33
CertificateIdentity identity,
34
34
ProvisioningProfile[string ] provisioningProfiles,
35
35
void delegate (double progress) addProgress,
36
+ bool isMultithreaded = true ,
36
37
string teamId = null ,
37
38
MDxHashFunction sha1Hasher = null ,
38
39
MDxHashFunction sha2Hasher = null ,
@@ -83,12 +84,13 @@ Tuple!(PlistDict, PlistDict) sign(
83
84
size_t stepCount = subBundles.length + 2 ;
84
85
const double stepSize = 1.0 / stepCount;
85
86
86
- auto subBundlesTask = task( {
87
+ void signSubBundles () {
87
88
foreach (subBundle; parallel(subBundles)) {
88
89
auto bundleFiles = subBundle.sign(
89
90
identity,
90
91
provisioningProfiles,
91
- (double progress) => addProgress(progress * stepSize),
92
+ (double progress) => addProgress(progress * stepSize),
93
+ isMultithreaded,
92
94
teamId,
93
95
sha1HasherParallel.get (),
94
96
sha2HasherParallel.get ()
@@ -144,8 +146,13 @@ Tuple!(PlistDict, PlistDict) sign(
144
146
addFile(" _CodeSignature" .buildPath(" CodeResources" ));
145
147
addFile(subBundle.appInfo[" CFBundleExecutable" ].str().native());
146
148
}
147
- });
148
- subBundlesTask.executeInNewThread();
149
+ }
150
+
151
+ typeof (task(&signSubBundles)) subBundlesTask;
152
+ if (isMultithreaded) {
153
+ subBundlesTask = task(&signSubBundles);
154
+ subBundlesTask.executeInNewThread();
155
+ }
149
156
150
157
log.debugF! " Signing bundle %s..." (baseName(bundleFolder));
151
158
@@ -242,7 +249,9 @@ Tuple!(PlistDict, PlistDict) sign(
242
249
// too lazy yet to add better progress tracking
243
250
addProgress(stepSize);
244
251
245
- subBundlesTask.yieldForce();
252
+ if (isMultithreaded) {
253
+ subBundlesTask.yieldForce();
254
+ }
246
255
247
256
log.debug_(" Making CodeResources..." );
248
257
string codeResources = dict(
0 commit comments