Skip to content

Commit

Permalink
Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
g-Off committed Jun 2, 2019
1 parent a1e12a8 commit f5095a8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
11 changes: 4 additions & 7 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
// swift-tools-version:5.0

import PackageDescription

let package = Package(
name: "XcodeProject",
platforms: [
.macOS(.v10_14)
],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "XcodeProject",
targets: ["XcodeProject"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "XcodeProject",
dependencies: []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class PBXBuildPhase: PBXObject {
}

public func remove(file: PBXBuildFile) {
guard let index = files.index(of: file) else { return }
guard let index = files.firstIndex(of: file) else { return }
files.remove(at: index)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeProject/Objects/References/PBXGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class PBXGroup: PBXReference {

public func remove(child: PBXReference) {
guard child.parent == self else { return }
guard let index = children.index(of: child) else { return }
guard let index = children.firstIndex(of: child) else { return }
children.remove(at: index)
self.child(child, didMoveTo: nil)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/XcodeProject/Workspace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension WorkspaceItem {
print(location)
var scheme: String = ""
var path: String = location
if let index = location.index(of: ":") {
if let index = location.firstIndex(of: ":") {
scheme = String(location[..<index])
path = String(location[location.index(after: index)...])
}
Expand Down
13 changes: 7 additions & 6 deletions XcodeProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Geoffrey Foster";
TargetAttributes = {
6CD222821DDD5C170058C7CD = {
Expand All @@ -347,10 +347,11 @@
};
buildConfigurationList = 6CD2227D1DDD5C170058C7CD /* Build configuration list for PBXProject "XcodeProject" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 6CD222791DDD5C170058C7CD;
productRefGroup = 6CD222841DDD5C180058C7CD /* Products */;
Expand Down Expand Up @@ -451,6 +452,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -503,6 +505,7 @@
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -512,6 +515,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -556,6 +560,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -579,7 +584,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -600,7 +604,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProject";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -612,7 +615,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProjectTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -624,7 +626,6 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProjectTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit f5095a8

Please sign in to comment.