Skip to content

Commit

Permalink
Improve support for the Swift Package Manager
Browse files Browse the repository at this point in the history
Still not quite there (compiler errors), but this brings support a lot
closer.
  • Loading branch information
alejandro-isaza committed Dec 9, 2016
1 parent 968d4ad commit 0a15376
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 52 deletions.
12 changes: 5 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ xcuserdata/
*.xccheckout
*.xcscmblueprint

# Object files
*.o
*.lo
.deps/
.libs/
.build/

# Carthage
Carthage/

# Swift Package Manager
#
Packages/
.build/
96 changes: 52 additions & 44 deletions HDF5Kit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Source/Attribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class Attribute {
public internal(set) var id: hid_t = -1

Expand Down
4 changes: 4 additions & 0 deletions Source/Dataset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class Dataset: Object {
/// The address in the file of the dataset or `nil` if the offset is undefined. That address is expressed as the offset in bytes from the beginning of the file.
public var offset: Int? {
Expand Down
4 changes: 4 additions & 0 deletions Source/Dataspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class Dataspace {
var id: hid_t

Expand Down
4 changes: 4 additions & 0 deletions Source/Datatype.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public enum DataClass: Int32 {
case noClass = -1 // error
case integer = 0 // integer types
Expand Down
4 changes: 4 additions & 0 deletions Source/DoubleAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class DoubleAttribute: Attribute {

public func read() throws -> [Double] {
Expand Down
4 changes: 4 additions & 0 deletions Source/DoubleDataset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class DoubleDataset: Dataset {
public subscript(slices: HyperslabIndexType...) -> [Double] {
// There is a problem with Swift where it gives a compiler error if `set` is implemented here
Expand Down
4 changes: 4 additions & 0 deletions Source/Error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public enum Error: Swift.Error {
case ioError
}
4 changes: 4 additions & 0 deletions Source/File.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class File: GroupType {
public enum CreateMode: UInt32 {
case truncate = 0x02 // Overwrite existing files
Expand Down
4 changes: 4 additions & 0 deletions Source/FloatAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class FloatAttribute: Attribute {

public func read() throws -> [Float] {
Expand Down
4 changes: 4 additions & 0 deletions Source/FloatDataset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class FloatDataset: Dataset {
public subscript(slices: HyperslabIndexType...) -> [Float] {
// There is a problem with Swift where it gives a compiler error if `set` is implemented here
Expand Down
4 changes: 4 additions & 0 deletions Source/Group.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public protocol GroupType {
var id: hid_t { get }
}
Expand Down
4 changes: 4 additions & 0 deletions Source/HyperslabIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

postfix operator ..

prefix operator ..
Expand Down
4 changes: 4 additions & 0 deletions Source/IntAttribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class IntAttribute: Attribute {

public func read() throws -> [Int] {
Expand Down
4 changes: 4 additions & 0 deletions Source/IntDataset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class IntDataset: Dataset {
public subscript(slices: HyperslabIndexType...) -> [Int] {
// There is a problem with Swift where it gives a compiler error if `set` is implemented here
Expand Down
4 changes: 4 additions & 0 deletions Source/NativeType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public enum NativeType {
case int
case uint
Expand Down
4 changes: 4 additions & 0 deletions Source/Object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class Object {
public internal(set) var id: hid_t = -1

Expand Down
6 changes: 5 additions & 1 deletion Source/StringAttribute.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// Copyright © 2016 Alejandro Isaza.
// Copyright © 2016 Alejandro Isaza.
//
// This file is part of HDF5Kit. The full HDF5Kit copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

open class StringAttribute: Attribute {

public func read() throws -> [String] {
Expand Down
4 changes: 4 additions & 0 deletions Source/StringDataset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.

#if SWIFT_PACKAGE
import CHDF5
#endif

public class StringDataset: Dataset {
open subscript(slices: HyperslabIndexType...) -> [String] {
// There is a problem with Swift where it gives a compiler error if `set` is implemented here
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0a15376

Please sign in to comment.