Skip to content

Commit c317982

Browse files
committed
Include iOS scheme in Xcode package. Clean up Xcode project.
1 parent 51fb4ec commit c317982

File tree

12 files changed

+174
-50
lines changed

12 files changed

+174
-50
lines changed

NumberKit.xcodeproj/project.pbxproj

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -20,7 +20,7 @@
2020
CCA2651723EF73B700483329 /* CodableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA2651623EF73B700483329 /* CodableTests.swift */; };
2121
CCA8E8111F7780C800927A41 /* FloatingPointNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA8E8101F7780C800927A41 /* FloatingPointNumber.swift */; };
2222
CCA8E8131F77814F00927A41 /* IntegerNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA8E8121F77814F00927A41 /* IntegerNumber.swift */; };
23-
CCD2603D23F20F7200DFE5A4 /* NumberKit_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD2603B23F20F7200DFE5A4 /* NumberKit_iOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
23+
CCD2603D23F20F7200DFE5A4 /* NumberKit_iOS.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD2603B23F20F7200DFE5A4 /* NumberKit_iOS.h */; platformFilter = ios; settings = {ATTRIBUTES = (Public, ); }; };
2424
CCD2604123F2119900DFE5A4 /* NumberUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC99F56D1B7AAAA300355E1E /* NumberUtil.swift */; };
2525
CCD2604223F2119C00DFE5A4 /* IntegerNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA8E8121F77814F00927A41 /* IntegerNumber.swift */; };
2626
CCD2604323F2119F00DFE5A4 /* FloatingPointNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA8E8101F7780C800927A41 /* FloatingPointNumber.swift */; };
@@ -189,9 +189,9 @@
189189
isa = PBXNativeTarget;
190190
buildConfigurationList = CC99F5631B7AA6E200355E1E /* Build configuration list for PBXNativeTarget "NumberKit" */;
191191
buildPhases = (
192+
CC99F54C1B7AA6E200355E1E /* Headers */,
192193
CC99F54A1B7AA6E200355E1E /* Sources */,
193194
CC99F54B1B7AA6E200355E1E /* Frameworks */,
194-
CC99F54C1B7AA6E200355E1E /* Headers */,
195195
CC99F54D1B7AA6E200355E1E /* Resources */,
196196
);
197197
buildRules = (
@@ -225,9 +225,9 @@
225225
isa = PBXNativeTarget;
226226
buildConfigurationList = CCD2604023F20F7200DFE5A4 /* Build configuration list for PBXNativeTarget "NumberKit iOS" */;
227227
buildPhases = (
228+
CCD2603423F20F7200DFE5A4 /* Headers */,
228229
CCD2603523F20F7200DFE5A4 /* Sources */,
229230
CCD2603623F20F7200DFE5A4 /* Frameworks */,
230-
CCD2603423F20F7200DFE5A4 /* Headers */,
231231
CCD2603723F20F7200DFE5A4 /* Resources */,
232232
);
233233
buildRules = (
@@ -464,7 +464,8 @@
464464
MACOSX_DEPLOYMENT_TARGET = 10.12;
465465
MTL_ENABLE_DEBUG_INFO = NO;
466466
SDKROOT = macosx;
467-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
467+
SWIFT_COMPILATION_MODE = wholemodule;
468+
SWIFT_OPTIMIZATION_LEVEL = "-O";
468469
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
469470
SWIFT_VERSION = 5.0;
470471
TARGETED_DEVICE_FAMILY = "1,2";
@@ -478,16 +479,20 @@
478479
buildSettings = {
479480
CLANG_ENABLE_MODULES = YES;
480481
COMBINE_HIDPI_IMAGES = YES;
481-
CURRENT_PROJECT_VERSION = 1;
482+
CURRENT_PROJECT_VERSION = 2;
482483
DEFINES_MODULE = YES;
483484
DYLIB_COMPATIBILITY_VERSION = 1;
484485
DYLIB_CURRENT_VERSION = 1;
485486
DYLIB_INSTALL_NAME_BASE = "@rpath";
486487
FRAMEWORK_VERSION = A;
487488
INFOPLIST_FILE = "$(SRCROOT)/Sources/NumberKit/Info.plist";
488489
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
489-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
490-
MARKETING_VERSION = 2.3.4;
490+
LD_RUNPATH_SEARCH_PATHS = (
491+
"$(inherited)",
492+
"@executable_path/../Frameworks",
493+
"@loader_path/Frameworks",
494+
);
495+
MARKETING_VERSION = 2.3.5;
491496
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKit;
492497
PRODUCT_NAME = "$(TARGET_NAME)";
493498
SKIP_INSTALL = YES;
@@ -501,16 +506,20 @@
501506
buildSettings = {
502507
CLANG_ENABLE_MODULES = YES;
503508
COMBINE_HIDPI_IMAGES = YES;
504-
CURRENT_PROJECT_VERSION = 1;
509+
CURRENT_PROJECT_VERSION = 2;
505510
DEFINES_MODULE = YES;
506511
DYLIB_COMPATIBILITY_VERSION = 1;
507512
DYLIB_CURRENT_VERSION = 1;
508513
DYLIB_INSTALL_NAME_BASE = "@rpath";
509514
FRAMEWORK_VERSION = A;
510515
INFOPLIST_FILE = "$(SRCROOT)/Sources/NumberKit/Info.plist";
511516
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
512-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
513-
MARKETING_VERSION = 2.3.4;
517+
LD_RUNPATH_SEARCH_PATHS = (
518+
"$(inherited)",
519+
"@executable_path/../Frameworks",
520+
"@loader_path/Frameworks",
521+
);
522+
MARKETING_VERSION = 2.3.5;
514523
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKit;
515524
PRODUCT_NAME = "$(TARGET_NAME)";
516525
SKIP_INSTALL = YES;
@@ -523,7 +532,11 @@
523532
buildSettings = {
524533
COMBINE_HIDPI_IMAGES = YES;
525534
INFOPLIST_FILE = Tests/NumberKitTests/Info.plist;
526-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
535+
LD_RUNPATH_SEARCH_PATHS = (
536+
"$(inherited)",
537+
"@executable_path/../Frameworks",
538+
"@loader_path/../Frameworks",
539+
);
527540
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKitTests;
528541
PRODUCT_NAME = "$(TARGET_NAME)";
529542
SWIFT_VERSION = 5.0;
@@ -535,7 +548,11 @@
535548
buildSettings = {
536549
COMBINE_HIDPI_IMAGES = YES;
537550
INFOPLIST_FILE = Tests/NumberKitTests/Info.plist;
538-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
551+
LD_RUNPATH_SEARCH_PATHS = (
552+
"$(inherited)",
553+
"@executable_path/../Frameworks",
554+
"@loader_path/../Frameworks",
555+
);
539556
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKitTests;
540557
PRODUCT_NAME = "$(TARGET_NAME)";
541558
SWIFT_VERSION = 5.0;
@@ -552,24 +569,29 @@
552569
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
553570
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
554571
CODE_SIGN_STYLE = Automatic;
555-
CURRENT_PROJECT_VERSION = 1;
572+
CURRENT_PROJECT_VERSION = 2;
556573
DEFINES_MODULE = YES;
557574
DEVELOPMENT_TEAM = C72Z63N8M5;
558575
DYLIB_COMPATIBILITY_VERSION = 1;
559576
DYLIB_CURRENT_VERSION = 1;
560577
DYLIB_INSTALL_NAME_BASE = "@rpath";
561578
GCC_C_LANGUAGE_STANDARD = gnu11;
562-
INFOPLIST_FILE = "$(SRCROOT)/Sources/NumberKit iOS/Info.plist";
579+
INFOPLIST_FILE = "Sources/NumberKit iOS/Info.plist";
563580
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
564581
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
565-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
566-
MARKETING_VERSION = 2.3.4;
582+
LD_RUNPATH_SEARCH_PATHS = (
583+
"$(inherited)",
584+
"@executable_path/Frameworks",
585+
"@loader_path/Frameworks",
586+
);
587+
MARKETING_VERSION = 2.3.5;
567588
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
568589
MTL_FAST_MATH = YES;
569590
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKit;
570591
PRODUCT_NAME = NumberKit;
571592
SDKROOT = iphoneos;
572593
SKIP_INSTALL = YES;
594+
SUPPORTS_MACCATALYST = YES;
573595
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
574596
SWIFT_VERSION = 5.0;
575597
TARGETED_DEVICE_FAMILY = "1,2";
@@ -586,23 +608,29 @@
586608
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
587609
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
588610
CODE_SIGN_STYLE = Automatic;
589-
CURRENT_PROJECT_VERSION = 1;
611+
CURRENT_PROJECT_VERSION = 2;
590612
DEFINES_MODULE = YES;
591613
DEVELOPMENT_TEAM = C72Z63N8M5;
592614
DYLIB_COMPATIBILITY_VERSION = 1;
593615
DYLIB_CURRENT_VERSION = 1;
594616
DYLIB_INSTALL_NAME_BASE = "@rpath";
595617
GCC_C_LANGUAGE_STANDARD = gnu11;
596-
INFOPLIST_FILE = "$(SRCROOT)/Sources/NumberKit iOS/Info.plist";
618+
INFOPLIST_FILE = "Sources/NumberKit iOS/Info.plist";
597619
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
598620
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
599-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
600-
MARKETING_VERSION = 2.3.4;
621+
LD_RUNPATH_SEARCH_PATHS = (
622+
"$(inherited)",
623+
"@executable_path/Frameworks",
624+
"@loader_path/Frameworks",
625+
);
626+
MARKETING_VERSION = 2.3.5;
601627
MTL_FAST_MATH = YES;
602628
PRODUCT_BUNDLE_IDENTIFIER = net.objecthub.NumberKit;
603629
PRODUCT_NAME = NumberKit;
604630
SDKROOT = iphoneos;
605631
SKIP_INSTALL = YES;
632+
SUPPORTS_MACCATALYST = YES;
633+
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
606634
SWIFT_VERSION = 5.0;
607635
TARGETED_DEVICE_FAMILY = "1,2";
608636
VALIDATE_PRODUCT = YES;
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1130"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "CCD2603823F20F7200DFE5A4"
18+
BuildableName = "NumberKit iOS.framework"
19+
BlueprintName = "NumberKit iOS"
20+
ReferencedContainer = "container:NumberKit.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "CC99F5581B7AA6E200355E1E"
36+
BuildableName = "NumberKitTests.xctest"
37+
BlueprintName = "NumberKitTests"
38+
ReferencedContainer = "container:NumberKit.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
41+
</Testables>
42+
</TestAction>
43+
<LaunchAction
44+
buildConfiguration = "Debug"
45+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
46+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
47+
launchStyle = "0"
48+
useCustomWorkingDirectory = "NO"
49+
ignoresPersistentStateOnLaunch = "NO"
50+
debugDocumentVersioning = "YES"
51+
debugServiceExtension = "internal"
52+
allowLocationSimulation = "YES">
53+
</LaunchAction>
54+
<ProfileAction
55+
buildConfiguration = "Release"
56+
shouldUseLaunchSchemeArgsEnv = "YES"
57+
savedToolIdentifier = ""
58+
useCustomWorkingDirectory = "NO"
59+
debugDocumentVersioning = "YES">
60+
<MacroExpansion>
61+
<BuildableReference
62+
BuildableIdentifier = "primary"
63+
BlueprintIdentifier = "CCD2603823F20F7200DFE5A4"
64+
BuildableName = "NumberKit iOS.framework"
65+
BlueprintName = "NumberKit iOS"
66+
ReferencedContainer = "container:NumberKit.xcodeproj">
67+
</BuildableReference>
68+
</MacroExpansion>
69+
</ProfileAction>
70+
<AnalyzeAction
71+
buildConfiguration = "Debug">
72+
</AnalyzeAction>
73+
<ArchiveAction
74+
buildConfiguration = "Release"
75+
revealArchiveInOrganizer = "YES">
76+
</ArchiveAction>
77+
</Scheme>

Package.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,32 @@ import PackageDescription
2323

2424
let package = Package(
2525
name: "NumberKit",
26+
27+
// Platforms define the operating systems for which this library can be compiled for.
2628
platforms: [
2729
.macOS(.v10_12),
2830
.iOS(.v11),
2931
],
32+
33+
// Products define the executables and libraries produced by a package, and make them visible
34+
// to other packages.
3035
products: [
3136
.library(name: "NumberKit", targets: ["NumberKit"]),
3237
],
38+
39+
// Dependencies declare other packages that this package depends on.
40+
// e.g. `.package(url: /* package url */, from: "1.0.0"),`
3341
dependencies: [
3442
],
43+
44+
// Targets are the basic building blocks of a package. A target can define a module or
45+
// a test suite. Targets can depend on other targets in this package, and on products
46+
// in packages which this package depends on.
3547
targets: [
3648
.target(name: "NumberKit", dependencies: []),
3749
.testTarget(name: "NumberKitTests", dependencies: ["NumberKit"]),
3850
],
51+
52+
// Required Swift language version.
3953
swiftLanguageVersions: [.v5]
4054
)

README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,47 @@ each represented as a struct:
1212
2. `Rational`: signed rational numbers
1313
3. `Complex`: complex floating-point numbers
1414

15-
**Requirements**:
16-
- Xcode 11.4
17-
- Swift 5.2
18-
- macOS with Xcode or Swift Package Manager
19-
- Linux with Swift Package Manager
20-
2115
**Note**: So far, with every major version of Swift, Apple decided to change the foundational APIs of the numeric
2216
types in Swift significantly and consistently in a backward incompatible way. In order to be more isolated from
2317
such changes in future, with Swift 3, I decided to introduce a distinct integer type used in NumberKit based on a
2418
new protocol `IntegerNumber`. All standard numeric integer types implement this protocol. This is now consistent
2519
with the usage of protocol `FloatingPointNumber` for floating point numbers, where there was, so far, never a
2620
real, generic enough foundation (and still isn't).
2721

28-
2922
## BigInt
3023

3124
`BigInt` objects are immutable, signed, arbitrary-precision integers that can be used as a
32-
drop-in replacement for the existing binary integer types of Swift 5. Struct `BigInt` defines all
25+
drop-in replacement for the existing binary integer types of Swift 5.
26+
[Struct `BigInt`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/BigInt.swift) defines all
3327
the standard arithmetic integer operations and implements the corresponding protocols defined
3428
in the standard library.
3529

3630

3731
## Rational
3832

39-
Struct `Rational<T>` defines immutable, rational numbers based on an existing signed integer
33+
[Struct `Rational<T>`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Rational.swift)
34+
defines immutable, rational numbers based on an existing signed integer
4035
type `T`, like `Int32`, `Int64`, or `BigInt`. A rational number is a signed number that can
4136
be expressed as the quotient of two integers _a_ and _b_: _a / b_.
4237

4338

4439
## Complex
4540

46-
Struct `Complex<T>` defines complex numbers based on an existing floating point type `T`,
47-
like `Float` or `Double`. A complex number consists of two components, a real part _re_
48-
and an imaginary part _im_ and is typically written as: _re + im * i_ where _i_ is
49-
the _imaginary unit_.
41+
[Struct `Complex<T>`](https://github.com/objecthub/swift-numberkit/blob/master/Sources/NumberKit/Complex.swift)
42+
defines complex numbers based on an existing floating point type `T`, like `Float` or `Double`. A complex number
43+
consists of two components, a real part _re_ and an imaginary part _im_ and is typically written as: _re + im * i_
44+
where _i_ is the _imaginary unit_.
45+
46+
## Requirements
47+
48+
The following technologies are needed to build the components of the _Swift NumberKit_ framework:
49+
50+
- [Xcode 11.4](https://developer.apple.com/xcode/)
51+
- [Swift 5.2](https://developer.apple.com/swift/)
52+
- [Swift Package Manager](https://swift.org/package-manager/)
53+
- macOS or Linux
54+
55+
## Copyright
56+
57+
Author: Matthias Zenger (<[email protected]>)
58+
Copyright © 2016-2020 Matthias Zenger. All rights reserved.

Sources/NumberKit iOS/NumberKit_iOS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// NumberKit_iOS.h
3-
// NumberKit-iOS
3+
// NumberKit
44
//
55
// Created by Matthias Zenger on 10/02/2020.
66
// Copyright © 2015-2020 Matthias Zenger. All rights reserved.

Sources/NumberKit/Complex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// NumberKit
44
//
55
// Created by Matthias Zenger on 15/08/2015.
6-
// Copyright © 2015-2019 Matthias Zenger. All rights reserved.
6+
// Copyright © 2015-2020 Matthias Zenger. All rights reserved.
77
//
88
// Licensed under the Apache License, Version 2.0 (the "License");
99
// you may not use this file except in compliance with the License.

Sources/NumberKit/FloatingPointNumber.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// NumberKit
44
//
55
// Created by Matthias Zenger on 23/09/2017.
6-
// Copyright © 2015-2019 Matthias Zenger. All rights reserved.
6+
// Copyright © 2015-2020 Matthias Zenger. All rights reserved.
77
//
88
// Licensed under the Apache License, Version 2.0 (the "License");
99
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)