Skip to content

Commit 6d591ce

Browse files
Merge pull request #4 from SomeRandomiOSDev/1.1.0
1.1.0
2 parents 1f66768 + 1a3288d commit 6d591ce

19 files changed

+990
-108
lines changed

.github/workflows/swift.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1-
name: Swift
1+
name: Test
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
7-
8-
runs-on: macOS-latest
9-
7+
strategy:
8+
matrix:
9+
os: [macOS-latest, ubuntu-latest]
10+
swift: ["5.1"]
11+
runs-on: ${{ matrix.os }}
12+
env:
13+
SWIFT_VERSION: ${{ matrix.swift }}
14+
SWIFT_EXEC: .swiftenv/shims/swift
1015
steps:
1116
- uses: actions/checkout@v2
17+
- name: Install Swift
18+
run: |
19+
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv
20+
~/.swiftenv/bin/swiftenv install $SWIFT_VERSION --skip-existing
21+
~/.swiftenv/bin/swiftenv rehash
1222
- name: Build
13-
run: swift build -v
14-
- name: Run Tests
15-
run: swift test -v
23+
run: |
24+
~/$SWIFT_EXEC --version
25+
~/$SWIFT_EXEC build -v
26+
- name: Test
27+
run: |
28+
~/$SWIFT_EXEC test -v

.swiftlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ opt_in_rules:
5757

5858
reporter: "xcode"
5959

60+
excluded:
61+
- Tests/LinuxMain.swift
62+
- Tests/HalfTests/XCTestManifests.swift
63+
- Tests/CHalfTests/XCTestManifests.swift
64+
6065
identifier_name:
6166
excluded:
6267
- pi

ATTRIBUTIONS

Lines changed: 317 additions & 0 deletions
Large diffs are not rendered by default.

Half.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "Half"
4-
s.version = "1.0.2"
4+
s.version = "1.1.0"
55
s.summary = "Swift Half-Precision Floating Point"
66
s.description = <<-DESC
77
A lightweight framework containing a Swift implementation for a half-precision floating point type for iOS, macOS, tvOS, and watchOS.
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
1919
s.source = { :git => "https://github.com/SomeRandomiOSDev/Half.git", :tag => s.version.to_s }
2020
s.source_files = 'Sources/**/*.{swift,h,c}'
2121
s.frameworks = 'Foundation'
22-
s.swift_versions = ['4.0', '4.2', '5.0']
22+
s.swift_versions = ['5.0']
2323
s.cocoapods_version = '>= 1.7.3'
2424

2525
end

Half.xcodeproj/project.pbxproj

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
DD94FBF923F3C5BB0041D4EC /* half.h in Headers */ = {isa = PBXBuildFile; fileRef = DDFEEC8423F0B6FF0096015C /* half.h */; settings = {ATTRIBUTES = (Public, ); }; };
2626
DD94FBFA23F3C5BC0041D4EC /* half.h in Headers */ = {isa = PBXBuildFile; fileRef = DDFEEC8423F0B6FF0096015C /* half.h */; settings = {ATTRIBUTES = (Public, ); }; };
2727
DD94FBFB23F3C5BD0041D4EC /* half.h in Headers */ = {isa = PBXBuildFile; fileRef = DDFEEC8423F0B6FF0096015C /* half.h */; settings = {ATTRIBUTES = (Public, ); }; };
28+
DDB8120323F587890079FEB5 /* CHalfTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB8120223F587890079FEB5 /* CHalfTests.swift */; };
29+
DDB8120423F587890079FEB5 /* CHalfTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB8120223F587890079FEB5 /* CHalfTests.swift */; };
30+
DDB8120523F587890079FEB5 /* CHalfTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDB8120223F587890079FEB5 /* CHalfTests.swift */; };
2831
DDFEEC3D23EF13910096015C /* Half.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDFEEC3323EF13900096015C /* Half.framework */; };
2932
DDFEEC4223EF13910096015C /* HalfTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDFEEC4123EF13910096015C /* HalfTests.swift */; };
3033
DDFEECC723F2001A0096015C /* Half.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDFEECBE23F2001A0096015C /* Half.framework */; };
@@ -88,11 +91,14 @@
8891

8992
/* Begin PBXFileReference section */
9093
DD6F08D124008A7400749359 /* codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = codecov.yml; sourceTree = "<group>"; };
94+
DDB1DF3F240A25D900C20FED /* fp_extend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fp_extend.cpp; sourceTree = "<group>"; };
95+
DDB1DF40240A25D900C20FED /* fp_trunc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fp_trunc.cpp; sourceTree = "<group>"; };
96+
DDB8120223F587890079FEB5 /* CHalfTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CHalfTests.swift; sourceTree = "<group>"; };
9197
DDFEEC3323EF13900096015C /* Half.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Half.framework; sourceTree = BUILT_PRODUCTS_DIR; };
92-
DDFEEC3723EF13900096015C /* Half-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Half-Info.plist"; path = "Info/Half-Info.plist"; sourceTree = "<group>"; };
98+
DDFEEC3723EF13900096015C /* Half-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Half-Info.plist"; path = "Plists/Half-Info.plist"; sourceTree = "<group>"; };
9399
DDFEEC3C23EF13910096015C /* HalfTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HalfTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
94100
DDFEEC4123EF13910096015C /* HalfTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HalfTests.swift; sourceTree = "<group>"; };
95-
DDFEEC4323EF13910096015C /* HalfTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "HalfTests-Info.plist"; path = "../../Info/HalfTests-Info.plist"; sourceTree = "<group>"; };
101+
DDFEEC4323EF13910096015C /* HalfTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "HalfTests-Info.plist"; path = "Plists/HalfTests-Info.plist"; sourceTree = "<group>"; };
96102
DDFEEC8423F0B6FF0096015C /* half.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = half.h; sourceTree = "<group>"; };
97103
DDFEECAB23F1BA550096015C /* Half.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = Half.podspec; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
98104
DDFEECAC23F1BA550096015C /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; };
@@ -174,11 +180,20 @@
174180
DD94FBF723F3C50E0041D4EC /* Tests */ = {
175181
isa = PBXGroup;
176182
children = (
183+
DDB1DF43240A279300C20FED /* CHalfTests */,
177184
DDFEEC4023EF13910096015C /* HalfTests */,
178185
);
179186
path = Tests;
180187
sourceTree = "<group>";
181188
};
189+
DDB1DF43240A279300C20FED /* CHalfTests */ = {
190+
isa = PBXGroup;
191+
children = (
192+
DDB8120223F587890079FEB5 /* CHalfTests.swift */,
193+
);
194+
path = CHalfTests;
195+
sourceTree = "<group>";
196+
};
182197
DDFEEC2923EF13900096015C = {
183198
isa = PBXGroup;
184199
children = (
@@ -217,7 +232,6 @@
217232
DDFEEC4123EF13910096015C /* HalfTests.swift */,
218233
DDFEED4D23F26F170096015C /* Half+CodingTests.swift */,
219234
DDFEED5123F2737B0096015C /* FunctionsTests.swift */,
220-
DDFEEC4323EF13910096015C /* HalfTests-Info.plist */,
221235
);
222236
path = HalfTests;
223237
sourceTree = "<group>";
@@ -243,6 +257,7 @@
243257
DDFEECB023F1BA6E0096015C /* ATTRIBUTIONS */,
244258
DDFEECB123F1BA730096015C /* LICENSE */,
245259
DDFEEC3723EF13900096015C /* Half-Info.plist */,
260+
DDFEEC4323EF13910096015C /* HalfTests-Info.plist */,
246261
);
247262
name = "Supporting Files";
248263
sourceTree = "<group>";
@@ -279,6 +294,8 @@
279294
isa = PBXGroup;
280295
children = (
281296
DDFEED8223F345690096015C /* half.c */,
297+
DDB1DF3F240A25D900C20FED /* fp_extend.cpp */,
298+
DDB1DF40240A25D900C20FED /* fp_trunc.cpp */,
282299
);
283300
path = src;
284301
sourceTree = "<group>";
@@ -603,6 +620,7 @@
603620
isa = PBXSourcesBuildPhase;
604621
buildActionMask = 2147483647;
605622
files = (
623+
DDB8120323F587890079FEB5 /* CHalfTests.swift in Sources */,
606624
DDFEED4E23F26F170096015C /* Half+CodingTests.swift in Sources */,
607625
DDFEED5223F2737B0096015C /* FunctionsTests.swift in Sources */,
608626
DDFEEC4223EF13910096015C /* HalfTests.swift in Sources */,
@@ -624,6 +642,7 @@
624642
isa = PBXSourcesBuildPhase;
625643
buildActionMask = 2147483647;
626644
files = (
645+
DDB8120423F587890079FEB5 /* CHalfTests.swift in Sources */,
627646
DDFEED4F23F26F170096015C /* Half+CodingTests.swift in Sources */,
628647
DDFEED5323F2737B0096015C /* FunctionsTests.swift in Sources */,
629648
DDFEED0A23F200FE0096015C /* HalfTests.swift in Sources */,
@@ -645,6 +664,7 @@
645664
isa = PBXSourcesBuildPhase;
646665
buildActionMask = 2147483647;
647666
files = (
667+
DDB8120523F587890079FEB5 /* CHalfTests.swift in Sources */,
648668
DDFEED5023F26F170096015C /* Half+CodingTests.swift in Sources */,
649669
DDFEED5423F2737B0096015C /* FunctionsTests.swift in Sources */,
650670
DDFEED0B23F200FF0096015C /* HalfTests.swift in Sources */,
@@ -827,7 +847,7 @@
827847
DYLIB_COMPATIBILITY_VERSION = 1;
828848
DYLIB_CURRENT_VERSION = 1;
829849
DYLIB_INSTALL_NAME_BASE = "@rpath";
830-
INFOPLIST_FILE = "Info/Half-Info.plist";
850+
INFOPLIST_FILE = "Plists/Half-Info.plist";
831851
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
832852
LD_RUNPATH_SEARCH_PATHS = (
833853
"$(inherited)",
@@ -852,7 +872,7 @@
852872
DYLIB_COMPATIBILITY_VERSION = 1;
853873
DYLIB_CURRENT_VERSION = 1;
854874
DYLIB_INSTALL_NAME_BASE = "@rpath";
855-
INFOPLIST_FILE = "Info/Half-Info.plist";
875+
INFOPLIST_FILE = "Plists/Half-Info.plist";
856876
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
857877
LD_RUNPATH_SEARCH_PATHS = (
858878
"$(inherited)",
@@ -873,7 +893,7 @@
873893
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
874894
CLANG_ENABLE_MODULES = YES;
875895
CODE_SIGN_STYLE = Automatic;
876-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
896+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
877897
LD_RUNPATH_SEARCH_PATHS = (
878898
"$(inherited)",
879899
"@executable_path/Frameworks",
@@ -892,7 +912,7 @@
892912
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
893913
CLANG_ENABLE_MODULES = YES;
894914
CODE_SIGN_STYLE = Automatic;
895-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
915+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
896916
LD_RUNPATH_SEARCH_PATHS = (
897917
"$(inherited)",
898918
"@executable_path/Frameworks",
@@ -930,7 +950,7 @@
930950
DYLIB_COMPATIBILITY_VERSION = 1;
931951
DYLIB_CURRENT_VERSION = 1;
932952
DYLIB_INSTALL_NAME_BASE = "@rpath";
933-
INFOPLIST_FILE = "Info/Half-Info.plist";
953+
INFOPLIST_FILE = "Plists/Half-Info.plist";
934954
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
935955
LD_RUNPATH_SEARCH_PATHS = (
936956
"$(inherited)",
@@ -956,7 +976,7 @@
956976
DYLIB_COMPATIBILITY_VERSION = 1;
957977
DYLIB_CURRENT_VERSION = 1;
958978
DYLIB_INSTALL_NAME_BASE = "@rpath";
959-
INFOPLIST_FILE = "Info/Half-Info.plist";
979+
INFOPLIST_FILE = "Plists/Half-Info.plist";
960980
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
961981
LD_RUNPATH_SEARCH_PATHS = (
962982
"$(inherited)",
@@ -977,7 +997,7 @@
977997
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
978998
CODE_SIGN_STYLE = Automatic;
979999
COMBINE_HIDPI_IMAGES = YES;
980-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
1000+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
9811001
LD_RUNPATH_SEARCH_PATHS = (
9821002
"$(inherited)",
9831003
"@executable_path/../Frameworks",
@@ -995,7 +1015,7 @@
9951015
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
9961016
CODE_SIGN_STYLE = Automatic;
9971017
COMBINE_HIDPI_IMAGES = YES;
998-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
1018+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
9991019
LD_RUNPATH_SEARCH_PATHS = (
10001020
"$(inherited)",
10011021
"@executable_path/../Frameworks",
@@ -1016,7 +1036,7 @@
10161036
DYLIB_COMPATIBILITY_VERSION = 1;
10171037
DYLIB_CURRENT_VERSION = 1;
10181038
DYLIB_INSTALL_NAME_BASE = "@rpath";
1019-
INFOPLIST_FILE = "Info/Half-Info.plist";
1039+
INFOPLIST_FILE = "Plists/Half-Info.plist";
10201040
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
10211041
LD_RUNPATH_SEARCH_PATHS = (
10221042
"$(inherited)",
@@ -1042,7 +1062,7 @@
10421062
DYLIB_COMPATIBILITY_VERSION = 1;
10431063
DYLIB_CURRENT_VERSION = 1;
10441064
DYLIB_INSTALL_NAME_BASE = "@rpath";
1045-
INFOPLIST_FILE = "Info/Half-Info.plist";
1065+
INFOPLIST_FILE = "Plists/Half-Info.plist";
10461066
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
10471067
LD_RUNPATH_SEARCH_PATHS = (
10481068
"$(inherited)",
@@ -1063,7 +1083,7 @@
10631083
buildSettings = {
10641084
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
10651085
CODE_SIGN_STYLE = Automatic;
1066-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
1086+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
10671087
LD_RUNPATH_SEARCH_PATHS = (
10681088
"$(inherited)",
10691089
"@executable_path/Frameworks",
@@ -1081,7 +1101,7 @@
10811101
buildSettings = {
10821102
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
10831103
CODE_SIGN_STYLE = Automatic;
1084-
INFOPLIST_FILE = "Info/HalfTests-Info.plist";
1104+
INFOPLIST_FILE = "Plists/HalfTests-Info.plist";
10851105
LD_RUNPATH_SEARCH_PATHS = (
10861106
"$(inherited)",
10871107
"@executable_path/Frameworks",
@@ -1104,7 +1124,7 @@
11041124
DYLIB_COMPATIBILITY_VERSION = 1;
11051125
DYLIB_CURRENT_VERSION = 1;
11061126
DYLIB_INSTALL_NAME_BASE = "@rpath";
1107-
INFOPLIST_FILE = "Info/Half-Info.plist";
1127+
INFOPLIST_FILE = "Plists/Half-Info.plist";
11081128
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
11091129
LD_RUNPATH_SEARCH_PATHS = (
11101130
"$(inherited)",
@@ -1131,7 +1151,7 @@
11311151
DYLIB_COMPATIBILITY_VERSION = 1;
11321152
DYLIB_CURRENT_VERSION = 1;
11331153
DYLIB_INSTALL_NAME_BASE = "@rpath";
1134-
INFOPLIST_FILE = "Info/Half-Info.plist";
1154+
INFOPLIST_FILE = "Plists/Half-Info.plist";
11351155
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
11361156
LD_RUNPATH_SEARCH_PATHS = (
11371157
"$(inherited)",

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ let package = Package(
1212
],
1313

1414
products: [
15-
.library(name: "Half", type: .dynamic, targets: ["Half"])
15+
.library(name: "Half", targets: ["Half", "CHalf"])
1616
],
1717

1818
targets: [
1919
.target(name: "CHalf"),
20+
.testTarget(name: "CHalfTests", dependencies: ["CHalf"]),
21+
2022
.target(name: "Half", dependencies: ["CHalf"]),
2123
.testTarget(name: "HalfTests", dependencies: ["Half"])
2224
],
2325

24-
swiftLanguageVersions: [.version("4"), .version("4.2"), .version("5")]
26+
swiftLanguageVersions: [.version("5")]
2527
)
File renamed without changes.
File renamed without changes.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ Half
55
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Half.svg)](https://cocoapods.org/pods/Half)
66
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
77
[![Platform](https://img.shields.io/cocoapods/p/Half.svg)](https://cocoapods.org/pods/Half)
8+
![Linux](https://img.shields.io/badge/platform-linux-lightgrey)
89
[![Build](https://travis-ci.com/SomeRandomiOSDev/Half.svg?branch=master)](https://travis-ci.com/SomeRandomiOSDev/Half)
910
[![Code Coverage](https://codecov.io/gh/SomeRandomiOSDev/Half/branch/master/graph/badge.svg)](https://codecov.io/gh/SomeRandomiOSDev/Half)
1011
[![Codacy](https://api.codacy.com/project/badge/Grade/8ad52c117e4a46d9aa4699d22fc0bf49)](https://app.codacy.com/app/SomeRandomiOSDev/Half?utm_source=github.com&utm_medium=referral&utm_content=SomeRandomiOSDev/Half&utm_campaign=Badge_Grade_Dashboard)
12+
![Swift](https://github.com/SomeRandomiOSDev/HalfTest/workflows/Swift/badge.svg)
1113

1214
**Half** is a lightweight framework containing a Swift implementation for a half-precision floating point type for iOS, macOS, tvOS, and watchOS.
1315

@@ -70,7 +72,7 @@ Joseph Newton, somerandomiosdev@gmail.com
7072
Credits
7173
--------
7274

73-
**Half** is based heavily on the `Float`, `Double`, and `Float80` structures provided by Swift. See `ATTRIBUTIONS` for more details.
75+
**Half** is based heavily on the implementations of the `Float`, `Double`, and `Float80` structures provided by Swift. See `ATTRIBUTIONS` for more details.
7476

7577
License
7678
--------

0 commit comments

Comments
 (0)