Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to swift-tools-version:5.1; Removed redundant modifiers #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions Daylight.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
5B402B671E9B29FF0079BE20 /* DaylightAstronomy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DaylightAstronomy.swift; sourceTree = "<group>"; };
OBJ_12 /* DaylightTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DaylightTests.swift; sourceTree = "<group>"; };
OBJ_14 /* Daylight.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Daylight.framework; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_15 /* DaylightTests.xctest */ = {isa = PBXFileReference; lastKnownFileType = file; path = DaylightTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_15 /* DaylightTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; path = DaylightTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
OBJ_6 /* Package.swift */ = {isa = PBXFileReference; explicitFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
OBJ_9 /* Daylight.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Daylight.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -53,6 +53,16 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
E82443BC23302AF1002F82AD /* Daylight */ = {
isa = PBXGroup;
children = (
OBJ_9 /* Daylight.swift */,
5B402B651E9B29A20079BE20 /* DaylightUtilities.swift */,
5B402B671E9B29FF0079BE20 /* DaylightAstronomy.swift */,
);
path = Daylight;
sourceTree = "<group>";
};
OBJ_10 /* Tests */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -92,22 +102,11 @@
OBJ_7 /* Sources */ = {
isa = PBXGroup;
children = (
OBJ_8 /* Daylight */,
E82443BC23302AF1002F82AD /* Daylight */,
);
path = Sources;
sourceTree = "<group>";
};
OBJ_8 /* Daylight */ = {
isa = PBXGroup;
children = (
OBJ_9 /* Daylight.swift */,
5B402B651E9B29A20079BE20 /* DaylightUtilities.swift */,
5B402B671E9B29FF0079BE20 /* DaylightAstronomy.swift */,
);
name = Daylight;
path = Sources;
sourceTree = SOURCE_ROOT;
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -158,6 +157,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = OBJ_5;
Expand Down Expand Up @@ -229,11 +229,13 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Daylight.xcodeproj/Daylight_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = Daylight;
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SWIFT_VERSION = 5.0;
TARGET_NAME = Daylight;
};
name = Debug;
Expand All @@ -249,11 +251,13 @@
HEADER_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = Daylight.xcodeproj/Daylight_Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx";
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = Daylight;
PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SWIFT_VERSION = 5.0;
TARGET_NAME = Daylight;
};
name = Release;
Expand All @@ -271,6 +275,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_VERSION = 5.0;
TARGET_NAME = DaylightTests;
};
name = Debug;
Expand All @@ -288,6 +293,7 @@
LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
SWIFT_VERSION = 5.0;
TARGET_NAME = DaylightTests;
};
name = Release;
Expand Down
24 changes: 23 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
// swift-tools-version:5.1
import PackageDescription

let package = Package(
name: "Daylight"
name: "Daylight",
platforms: [
.iOS(.v12),
.watchOS(.v5),
.macOS(.v10_10)
],
products: [
.library(
name: "Daylight",
targets: ["Daylight"]),
],
dependencies: [
// no dependencies
],
targets: [
.target(
name: "Daylight",
dependencies: []),
.testTarget(
name: "DaylightTests",
dependencies: ["Daylight"]),
]
)
4 changes: 2 additions & 2 deletions Sources/Daylight.swift → Sources/Daylight/Daylight.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public struct Day {

public extension Date {

public func timeOf(_ solarEvent: SolarEvent, at location: Location) -> Date {
func timeOf(_ solarEvent: SolarEvent, at location: Location) -> Date {
switch solarEvent {
case .sunrise, .civilDawn, .nauticalDawn, .astronomicalDawn:
return calculateDawn(location: location.coords,
Expand All @@ -85,7 +85,7 @@ public extension Date {
}
}

public func timeOfNext(_ solarEvent: SolarEvent, at location: Location) -> Date {
func timeOfNext(_ solarEvent: SolarEvent, at location: Location) -> Date {
var time = self.timeOf(solarEvent, at: location)
if self >= time {
time = self.dayAfter.timeOf(solarEvent, at: location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ internal extension JulianDate {

internal extension Date {

internal func dateFromTimeUTC(timeUTCMins: Float64, timezone: TimeZone) -> Date {
func dateFromTimeUTC(timeUTCMins: Float64, timezone: TimeZone) -> Date {

var localCalendar = Calendar(identifier: .gregorian)
localCalendar.timeZone = timezone
Expand Down