Skip to content

Commit 77bd898

Browse files
Merge branch 'release/1.0.7'
2 parents 86ffede + 5d43b8d commit 77bd898

File tree

4 files changed

+64
-46
lines changed

4 files changed

+64
-46
lines changed

Info/MKHProjGen.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.6</string>
18+
<string>1.0.7</string>
1919
<key>CFBundleVersion</key>
2020
<string>$(CURRENT_PROJECT_VERSION)</string>
2121
<key>NSHumanReadableCopyright</key>

MKHProjGen.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@
415415
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
416416
CODE_SIGN_IDENTITY = "-";
417417
COPY_PHASE_STRIP = NO;
418-
CURRENT_PROJECT_VERSION = 7;
418+
CURRENT_PROJECT_VERSION = 8;
419419
DEBUG_INFORMATION_FORMAT = dwarf;
420420
ENABLE_STRICT_OBJC_MSGSEND = YES;
421421
ENABLE_TESTABILITY = YES;
@@ -467,7 +467,7 @@
467467
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
468468
CODE_SIGN_IDENTITY = "-";
469469
COPY_PHASE_STRIP = NO;
470-
CURRENT_PROJECT_VERSION = 7;
470+
CURRENT_PROJECT_VERSION = 8;
471471
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
472472
ENABLE_NS_ASSERTIONS = NO;
473473
ENABLE_STRICT_OBJC_MSGSEND = YES;

Src/Spec.1.2.1.swift

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ enum Spec_1_2_1
2727

2828
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#version-number
2929

30-
result <<< (idention, "version: 1.2.1")
30+
result <<< (idention, Spec.key("version") + " 1.2.1")
3131

3232
//===
3333

@@ -39,24 +39,28 @@ enum Spec_1_2_1
3939

4040
//===
4141

42-
result <<< (idention, "variants:")
42+
result <<< (idention, Spec.key("variants"))
4343

4444
idention += 1
4545

46-
result <<< (idention, "$base:")
46+
result <<< (idention, Spec.key("$base"))
4747

4848
idention += 1
4949

50-
result <<< (idention, "abstract: true")
50+
result <<< (idention, Spec.key("abstract") + " true")
5151

5252
idention -= 1
5353

54-
result <<< (idention, "\(p.name):")
54+
result <<< (idention, Spec.key(p.name))
5555

5656
idention -= 1
5757

5858
//===
5959

60+
result <<< (0, "") // empty line in the EOF
61+
62+
//===
63+
6064
return result
6165
}
6266

@@ -76,7 +80,7 @@ enum Spec_1_2_1
7680

7781
//===
7882

79-
result <<< (idention, "configurations:")
83+
result <<< (idention, Spec.key("configurations"))
8084

8185
//===
8286

@@ -113,15 +117,15 @@ enum Spec_1_2_1
113117

114118
//===
115119

116-
result <<< (idention, "\(c.name):")
120+
result <<< (idention, Spec.key(c.name))
117121

118122
//===
119123

120124
idention += 1
121125

122126
//===
123127

124-
result <<< (idention, "type: \(c.type)")
128+
result <<< (idention, Spec.key("type") + Spec.value(c.type))
125129

126130
//===
127131

@@ -133,7 +137,7 @@ enum Spec_1_2_1
133137
// NOTE: when using xcconfig files,
134138
// any overrides or profiles will be ignored.
135139

136-
result <<< (idention, "source: \(externalConfig)")
140+
result <<< (idention, Spec.key("source") + Spec.value(externalConfig) )
137141
}
138142
else
139143
{
@@ -143,23 +147,23 @@ enum Spec_1_2_1
143147

144148
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#profiles
145149

146-
result <<< (idention, "profiles:")
150+
result <<< (idention, Spec.key("profiles"))
147151

148152
for p in b.profiles + c.profiles
149153
{
150-
result <<< (idention, "- \(p)")
154+
result <<< (idention, "-" + Spec.value(p))
151155
}
152156

153157
//===
154158

155159
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
156160

157-
result <<< (idention, "overrides:")
161+
result <<< (idention, Spec.key("overrides"))
158162
idention += 1
159163

160164
for o in b.overrides + c.overrides
161165
{
162-
result <<< (idention, "\(o.key): \(o.value)")
166+
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
163167
}
164168

165169
idention -= 1
@@ -190,7 +194,7 @@ enum Spec_1_2_1
190194

191195
//===
192196

193-
result <<< (idention, "targets:")
197+
result <<< (idention, Spec.key("targets"))
194198

195199
//===
196200

@@ -235,7 +239,7 @@ enum Spec_1_2_1
235239

236240
//===
237241

238-
result <<< (idention, "\(t.name):")
242+
result <<< (idention, Spec.key(t.name))
239243

240244
//===
241245

@@ -245,13 +249,13 @@ enum Spec_1_2_1
245249

246250
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#platform
247251

248-
result <<< (idention, "platform: \(t.platform.rawValue)")
252+
result <<< (idention, Spec.key("platform") + Spec.value(t.platform.rawValue))
249253

250254
//===
251255

252256
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#type
253257

254-
result <<< (idention, "type: \"\(t.type.rawValue)\"")
258+
result <<< (idention, Spec.key("type") + Spec.value(t.type.rawValue))
255259

256260
//===
257261

@@ -268,7 +272,7 @@ enum Spec_1_2_1
268272

269273
for path in t.includes
270274
{
271-
result <<< (idention, "- \(path)")
275+
result <<< (idention, "-" + Spec.value(path))
272276
}
273277
}
274278

@@ -279,13 +283,13 @@ enum Spec_1_2_1
279283
if
280284
!t.excludes.isEmpty
281285
{
282-
result <<< (idention, "excludes:")
286+
result <<< (idention, Spec.key("excludes"))
283287
idention += 1
284-
result <<< (idention, "files:")
288+
result <<< (idention, Spec.key("files"))
285289

286290
for path in t.excludes
287291
{
288-
result <<< (idention, "- \(path)")
292+
result <<< (idention, "-" + Spec.value(path))
289293
}
290294

291295
idention -= 1
@@ -298,11 +302,11 @@ enum Spec_1_2_1
298302
if
299303
!t.i18nResources.isEmpty
300304
{
301-
result <<< (idention, "i18n-resources:")
305+
result <<< (idention, Spec.key("i18n-resources"))
302306

303307
for path in t.i18nResources
304308
{
305-
result <<< (idention, "- \(path)")
309+
result <<< (idention, "-" + Spec.value(path))
306310
}
307311
}
308312

@@ -321,7 +325,9 @@ enum Spec_1_2_1
321325
if
322326
t.includeCocoapods
323327
{
324-
result <<< (idention, "includes_cocoapods: \(t.includeCocoapods)")
328+
result <<<
329+
(idention,
330+
Spec.key("includes_cocoapods") + Spec.value(t.includeCocoapods))
325331
}
326332

327333
//===
@@ -355,7 +361,7 @@ enum Spec_1_2_1
355361
!deps.binaries.isEmpty ||
356362
!deps.projects.isEmpty
357363
{
358-
result <<< (idention, "references:")
364+
result <<< (idention, Spec.key("references"))
359365

360366
//===
361367

@@ -388,7 +394,7 @@ enum Spec_1_2_1
388394

389395
for dep in fromSDK
390396
{
391-
result <<< (idention, "- sdkroot:\(dep)")
397+
result <<< (idention, "-" + Spec.value("sdkroot:\(dep)"))
392398
}
393399

394400
//===
@@ -414,7 +420,7 @@ enum Spec_1_2_1
414420

415421
for t in targets
416422
{
417-
result <<< (idention, "- \(t)")
423+
result <<< (idention, "-" + Spec.value(t))
418424
}
419425

420426
//===
@@ -440,8 +446,8 @@ enum Spec_1_2_1
440446

441447
for b in binaries
442448
{
443-
result <<< (idention, "- location: \(b.location)")
444-
result <<< (idention, " codeSignOnCopy: \(b.codeSignOnCopy)")
449+
result <<< (idention, Spec.key("- location") + Spec.value(b.location))
450+
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(b.codeSignOnCopy))
445451
}
446452

447453
//===
@@ -467,14 +473,14 @@ enum Spec_1_2_1
467473

468474
for p in projects
469475
{
470-
result <<< (idention, "- location: \(p.location)")
471-
result <<< (idention, " frameworks:")
476+
result <<< (idention, Spec.key("- location") + Spec.value(p.location))
477+
result <<< (idention, Spec.key(" frameworks"))
472478

473479
for f in p.frameworks
474480
{
475-
result <<< (idention, " - name: \(f.name)")
476-
result <<< (idention, " copy: \(f.copy)")
477-
result <<< (idention, " codeSignOnCopy: \(f.codeSignOnCopy)")
481+
result <<< (idention, Spec.key(" - name") + Spec.value(f.name))
482+
result <<< (idention, Spec.key(" copy") + Spec.value(f.copy))
483+
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(f.codeSignOnCopy))
478484
}
479485
}
480486

@@ -499,7 +505,7 @@ enum Spec_1_2_1
499505

500506
//===
501507

502-
result <<< (idention, "configurations:")
508+
result <<< (idention, Spec.key("configurations"))
503509

504510
//===
505511

@@ -536,7 +542,7 @@ enum Spec_1_2_1
536542

537543
//===
538544

539-
result <<< (idention, "\(c.name):")
545+
result <<< (idention, Spec.key(c.name))
540546

541547
//===
542548

@@ -548,7 +554,7 @@ enum Spec_1_2_1
548554

549555
for o in b.overrides + c.overrides
550556
{
551-
result <<< (idention, "\(o.key): \(o.value)")
557+
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
552558
}
553559

554560
//===
@@ -581,7 +587,7 @@ enum Spec_1_2_1
581587
!scripts.beforeBuilds.isEmpty ||
582588
!scripts.afterBuilds.isEmpty
583589
{
584-
result <<< (idention, "scripts:")
590+
result <<< (idention, Spec.key("scripts"))
585591

586592
//===
587593

@@ -621,7 +627,7 @@ enum Spec_1_2_1
621627

622628
for s in regulars
623629
{
624-
result <<< (idention, "- \(s)")
630+
result <<< (idention, "-" + Spec.value(s))
625631
}
626632

627633
//===
@@ -645,11 +651,11 @@ enum Spec_1_2_1
645651

646652
//===
647653

648-
result <<< (idention, "prebuild:")
654+
result <<< (idention, Spec.key("prebuild"))
649655

650656
for s in beforeBuild
651657
{
652-
result <<< (idention, "- \(s)")
658+
result <<< (idention, "-" + Spec.value(s))
653659
}
654660

655661
//===
@@ -673,11 +679,11 @@ enum Spec_1_2_1
673679

674680
//===
675681

676-
result <<< (idention, "postbuild:")
682+
result <<< (idention, Spec.key("postbuild"))
677683

678684
for s in afterBuild
679685
{
680-
result <<< (idention, "- \(s)")
686+
result <<< (idention, "-" + Spec.value(s))
681687
}
682688

683689
//===

Src/Spec.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,16 @@ enum Spec
3434
{
3535
return Array(repeating: " ", count: idention).joined()
3636
}
37+
38+
static
39+
func key(_ v: Any) -> String
40+
{
41+
return "\(v):"
42+
}
43+
44+
static
45+
func value(_ v: Any) -> String
46+
{
47+
return " \"\(v)\""
48+
}
3749
}

0 commit comments

Comments
 (0)