Skip to content

Commit 7438b18

Browse files
committed
Improved architectures and signatures in build.
This is still not ideal. It's unclear to me why some simulator builds include i386, and why only the macOS framework gets signed.
1 parent e165541 commit 7438b18

File tree

8 files changed

+64
-52
lines changed

8 files changed

+64
-52
lines changed

Makefile

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# - ci used by Travis for continuous integration
33
# - dist used to build the binary distribution
44
#
5-
# Note that the dist target will checkout the source code to a temporary
6-
# directory. Any uncommited changes will not affect the build. That said,
7-
# it will use the locally checked out version of the Xcode configs.
5+
# Note that the dist target uses git checkout to copy the source into the
6+
# product directory. This means you should make sure that you don't have
7+
# uncommited local changes when building a distribution.
88

9-
SYMROOT = $(CURDIR)/Build
10-
DISTDIR = $(SYMROOT)/Product
11-
XCODECI = xcodebuild -project "$(CURDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockCI.xcconfig"
12-
XCODEDIST = xcodebuild -project "$(DISTDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockDist.xcconfig"
13-
SHELL = /bin/bash -e -o pipefail
9+
BUILD_DIR = $(CURDIR)/Build
10+
PRODUCT_DIR = $(BUILD_DIR)/Product
11+
XCODECI = xcodebuild -project "$(CURDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockCI.xcconfig"
12+
XCODEDIST = xcodebuild -project "$(CURDIR)/Source/OCMock.xcodeproj" -xcconfig "$(CURDIR)/Source/OCMockDist.xcconfig"
13+
SHELL = /bin/bash -e -o pipefail
1414

15-
.PHONY: checkout macos ioslib ios tvos watchos
15+
.PHONY: macos ioslib ios tvos watchos sourcecode product dmg
1616

1717
clean:
1818
rm -rf "$(CURDIR)/Build"
@@ -29,37 +29,37 @@ ci-ios:
2929
$(XCODECI) -scheme OCMockLib -destination 'platform=iOS Simulator,OS=latest,name=iPhone 11' test | xcpretty -c
3030

3131

32-
dist: clean product dmg
33-
34-
checkout:
35-
@echo "** Checking out source..."
36-
mkdir -p "$(DISTDIR)"
37-
git archive master | tar -x -C "$(DISTDIR)" Source
38-
39-
macos: checkout
32+
dist: product sourcecode dmg
33+
34+
macos:
4035
@echo "** Building macOS framework..."
41-
$(XCODEDIST) -target OCMock -sdk macosx install INSTALL_PATH="/macOS" | xcpretty -c
42-
43-
ioslib: checkout
36+
$(XCODEDIST) -scheme OCMock install INSTALL_PATH="/macOS" | xcpretty -c
37+
38+
ioslib:
4439
@echo "** Building iOS library..."
4540
$(XCODEDIST) -target OCMockLib -sdk iphonesimulator install INSTALL_PATH="/iOS library" | xcpretty -c
4641

47-
ios: checkout
42+
ios:
4843
@echo "** Building iOS framework..."
4944
$(XCODEDIST) -target "OCMock iOS" -sdk iphonesimulator install INSTALL_PATH="/iOS" | xcpretty -c
5045

51-
tvos: checkout
46+
tvos:
5247
@echo "** Building tvOS framework..."
5348
$(XCODEDIST) -target "OCMock tvOS" -sdk appletvsimulator install INSTALL_PATH="/tvOS" | xcpretty -c
5449

55-
watchos: checkout
50+
watchos:
5651
@echo "** Building watchOS framework..."
57-
$(XCODEDIST) -target "OCMock watchOS" -sdk watchsimulator install INSTALL_PATH="/watchOS"| xcpretty -c
52+
$(XCODEDIST) -target "OCMock watchOS" -sdk watchsimulator install INSTALL_PATH="/watchOS" | xcpretty -c
53+
54+
sourcecode:
55+
@echo "** Checking out source code..."
56+
mkdir -p "$(PRODUCT_DIR)"
57+
git archive master | tar -x -C "$(PRODUCT_DIR)" Source
5858

5959
product: macos ioslib ios tvos watchos
60-
@echo "** Verifying products..."
61-
Tools/distcheck.rb $(DISTDIR)
60+
@echo "** Verifying build products..."
61+
Tools/buildcheck.rb $(PRODUCT_DIR)
6262

6363
dmg:
6464
@echo "** Creating disk image..."
65-
Tools/makedmg.rb $(DISTDIR) $(SYMROOT)
65+
Tools/makedmg.rb $(PRODUCT_DIR) $(BUILD_DIR)

Source/Changes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Listing of notable changes by release. More detail is usually found in the Git
22
commit messages and/or the pull requests.
33

4-
OCMock 3.8 (2020-12-21)
4+
OCMock 3.8 (2020-12-23)
55

66
* Added support for ARM-based Macs. Unfortunately, this means that the hack to
77
combine the device targets with the simulator targets no longer works. The

Source/OCMock.xcodeproj/project.pbxproj

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@
13341334
TestTargetID = 030EF0A714632FD000B04273;
13351335
};
13361336
D31108AC1828DB8700737925 = {
1337+
ProvisioningStyle = Manual;
13371338
TestTargetID = 030EF0DB14632FF700B04273;
13381339
};
13391340
F0B950F01B0080BE00942C38 = {
@@ -1885,8 +1886,6 @@
18851886
SDKROOT = iphoneos;
18861887
SKIP_INSTALL = YES;
18871888
TARGETED_DEVICE_FAMILY = "1,2";
1888-
VALID_ARCHS = "arm64 armv7 armv7s arm64e";
1889-
"VALID_ARCHS[sdk=iphonesimulator*]" = "x86_64 i386";
18901889
};
18911890
name = Debug;
18921891
};
@@ -1904,8 +1903,6 @@
19041903
SKIP_INSTALL = YES;
19051904
TARGETED_DEVICE_FAMILY = "1,2";
19061905
VALIDATE_PRODUCT = YES;
1907-
VALID_ARCHS = "arm64 armv7 armv7s arm64e";
1908-
"VALID_ARCHS[sdk=iphonesimulator*]" = "x86_64 i386";
19091906
};
19101907
name = Release;
19111908
};
@@ -2120,6 +2117,9 @@
21202117
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
21212118
CLANG_WARN_EMPTY_BODY = YES;
21222119
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
2120+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
2121+
CODE_SIGN_STYLE = Manual;
2122+
DEVELOPMENT_TEAM = "";
21232123
GCC_PRECOMPILE_PREFIX_HEADER = YES;
21242124
GCC_PREFIX_HEADER = "OCMockLibTests/OCMockLibTests-Prefix.pch";
21252125
GCC_PREPROCESSOR_DEFINITIONS = (
@@ -2133,6 +2133,8 @@
21332133
OTHER_LDFLAGS = "-ObjC";
21342134
PRODUCT_BUNDLE_IDENTIFIER = "org.ocmock.${PRODUCT_NAME:rfc1034identifier}";
21352135
PRODUCT_NAME = "$(TARGET_NAME)";
2136+
PROVISIONING_PROFILE_SPECIFIER = "";
2137+
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
21362138
SDKROOT = iphoneos;
21372139
};
21382140
name = Debug;
@@ -2148,6 +2150,9 @@
21482150
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
21492151
CLANG_WARN_EMPTY_BODY = YES;
21502152
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
2153+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
2154+
CODE_SIGN_STYLE = Manual;
2155+
DEVELOPMENT_TEAM = "";
21512156
ENABLE_NS_ASSERTIONS = NO;
21522157
GCC_PRECOMPILE_PREFIX_HEADER = YES;
21532158
GCC_PREFIX_HEADER = "OCMockLibTests/OCMockLibTests-Prefix.pch";
@@ -2158,6 +2163,8 @@
21582163
OTHER_LDFLAGS = "-ObjC";
21592164
PRODUCT_BUNDLE_IDENTIFIER = "org.ocmock.${PRODUCT_NAME:rfc1034identifier}";
21602165
PRODUCT_NAME = "$(TARGET_NAME)";
2166+
PROVISIONING_PROFILE_SPECIFIER = "";
2167+
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "";
21612168
SDKROOT = iphoneos;
21622169
VALIDATE_PRODUCT = YES;
21632170
};

Source/OCMock.xcodeproj/xcshareddata/xcschemes/OCMock.xcscheme

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,6 @@
3939
ReferencedContainer = "container:OCMock.xcodeproj">
4040
</BuildableReference>
4141
</TestableReference>
42-
<TestableReference
43-
skipped = "NO">
44-
<BuildableReference
45-
BuildableIdentifier = "primary"
46-
BlueprintIdentifier = "03565A1A18F05626003AE91E"
47-
BuildableName = "OCMock Tests.xctest"
48-
BlueprintName = "OCMock Tests"
49-
ReferencedContainer = "container:OCMock.xcodeproj">
50-
</BuildableReference>
51-
</TestableReference>
5242
</Testables>
5343
</TestAction>
5444
<LaunchAction
@@ -77,6 +67,15 @@
7767
savedToolIdentifier = ""
7868
useCustomWorkingDirectory = "NO"
7969
debugDocumentVersioning = "YES">
70+
<MacroExpansion>
71+
<BuildableReference
72+
BuildableIdentifier = "primary"
73+
BlueprintIdentifier = "030EF0A714632FD000B04273"
74+
BuildableName = "OCMock.framework"
75+
BlueprintName = "OCMock"
76+
ReferencedContainer = "container:OCMock.xcodeproj">
77+
</BuildableReference>
78+
</MacroExpansion>
8079
</ProfileAction>
8180
<AnalyzeAction
8281
buildConfiguration = "Debug">

Source/OCMockCI.xcconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
// https://help.apple.com/xcode/#/dev745c5c974
33

44
// If you change these here you must also update the makefile
5-
SYMROOT = ../Build
6-
OBJROOT = ../Build
5+
// Note that OBJROOT is not defined in terms of SYMROOT. For some
6+
// reason that doesn't work; PIFcache files get misplaced.
7+
SYMROOT = $(PROJECT_DIR)/../Build
8+
OBJROOT = $(PROJECT_DIR)/../Build/Intermediaries

Source/OCMockDist.xcconfig

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// Configuration settings file format documentation can be found at:
22
// https://help.apple.com/xcode/#/dev745c5c974
33

4-
// If you change these here you must also update the makefile
5-
SYMROOT = ../../../Build
6-
OBJROOT = ../../../Build/Intermediaries
4+
#include "OCMockCI.xcconfig"
5+
6+
// If you change this here you must also update the makefile
77
DSTROOT = $(SYMROOT)/Product
88

99
// Make sure that files are copied to DSTROOT
1010
SKIP_INSTALL = NO
1111

1212
// Set the codesign identity for distribution
13+
CODE_SIGN_STYLE = Manual
1314
TEAM_IDENTIFIER = 28U2VZ7DF8
14-
CODE_SIGN_IDENTITY = Apple Development: erik@doernenburg.com
15+
CODE_SIGN_IDENTITY = Apple Development: erik@doernenburg.com (FJTF47J852)

Tools/distcheck.rb renamed to Tools/buildcheck.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ def run(cmd, &block)
1212
def checkArchs(path, expected)
1313
archs = nil
1414
run("lipo -info \"#{path}\"") { |lipo| archs = /re: (.*)/.match(lipo.readline)[1].strip() }
15-
if archs != expected
15+
if (expected.split(" ") - archs.split(" ")).count > 0
16+
puts "Warning: missing architecture; expected \"#{expected}\", found \"#{archs}\""
17+
end
18+
if (archs.split(" ") - expected.split(" ")).count > 0
1619
puts "Warning: unexpected architecture; expected \"#{expected}\", found \"#{archs}\""
1720
end
1821
end
@@ -39,7 +42,7 @@ def checkAuthority(path, expected)
3942
watchosproduct = "#{productdir}/watchOS/OCMock.framework"
4043

4144
checkArchs "#{macosproduct}/OCMock", "x86_64 arm64"
42-
checkArchs "#{ioslibproduct}", "armv7 i386 x86_64 arm64"
45+
checkArchs "#{ioslibproduct}", "x86_64 arm64"
4346
checkArchs "#{iosproduct}/OCMock", "x86_64 arm64"
4447
checkArchs "#{tvosproduct}/OCMock", "x86_64 arm64"
4548
checkArchs "#{watchosproduct}/OCMock", "x86_64 arm64"

Tools/makedmg.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def getVersion(productdir)
1717
end
1818

1919
def makeDMG(productdir, dmgdir, dmgname, volumename)
20-
tempdmg = "/tmp/ocmock-temp-#{Process.pid}.dmg"
20+
tempdmg = "#{dmgdir}/ocmock-temp-#{Process.pid}.dmg"
2121
finaldmg = "#{dmgdir}/#{dmgname}.dmg"
2222
run("hdiutil create -size 8m #{tempdmg} -layout NONE")
2323
disk_id = nil
@@ -27,7 +27,7 @@ def makeDMG(productdir, dmgdir, dmgname, volumename)
2727
run("hdid #{tempdmg}") { |hdid| disk_id = hdid.readline.split[0] }
2828
run("cp -R #{productdir}/* '/Volumes/#{volumename}'")
2929
run("hdiutil eject #{disk_id}")
30-
run("rm #{finaldmg}") { }
30+
run("rm -f #{finaldmg}")
3131
run("hdiutil convert -format UDZO #{tempdmg} -o #{finaldmg} -imagekey zlib-level=9")
3232
run("rm #{tempdmg}")
3333
end

0 commit comments

Comments
 (0)