From 55531fce990d16b8e41208b74d39ead1347691c2 Mon Sep 17 00:00:00 2001 From: Vignesh Kumar Date: Mon, 27 Feb 2017 18:33:44 +0530 Subject: [PATCH] Updated the package. --- Package.swift | 13 +++++++++ .../Source => Sources}/CSVExport.swift | 0 .../CSVExportTests_Info.plist | 25 +++++++++++++++++ .../SwiftCSVExport_Info.plist | 25 +++++++++++++++++ SwiftCSVExport.xcodeproj/project.pbxproj | 20 +++++++------ Tests/CSVExportTests/CSVExportTests.swift | 28 +++++++++++++++++++ Tests/CSVExportTests/XCTestManifests.swift | 14 ++++++++++ Tests/LinuxMain.swift | 14 ++++++++++ 8 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 Package.swift rename {SwiftCSVExport/Source => Sources}/CSVExport.swift (100%) create mode 100644 SwiftCSVExport.xcodeproj/CSVExportTests_Info.plist create mode 100644 SwiftCSVExport.xcodeproj/SwiftCSVExport_Info.plist create mode 100755 Tests/CSVExportTests/CSVExportTests.swift create mode 100755 Tests/CSVExportTests/XCTestManifests.swift create mode 100755 Tests/LinuxMain.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..45defcb --- /dev/null +++ b/Package.swift @@ -0,0 +1,13 @@ +// +// Package.swift +// SwiftCSVExport +// +// Created by Vignesh on 30/01/17. +// Copyright © 2017 vigneshuvi. All rights reserved. +// + +import PackageDescription + +let package = Package( + name: "SwiftCSVExport" +) diff --git a/SwiftCSVExport/Source/CSVExport.swift b/Sources/CSVExport.swift similarity index 100% rename from SwiftCSVExport/Source/CSVExport.swift rename to Sources/CSVExport.swift diff --git a/SwiftCSVExport.xcodeproj/CSVExportTests_Info.plist b/SwiftCSVExport.xcodeproj/CSVExportTests_Info.plist new file mode 100644 index 0000000..7c23420 --- /dev/null +++ b/SwiftCSVExport.xcodeproj/CSVExportTests_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SwiftCSVExport.xcodeproj/SwiftCSVExport_Info.plist b/SwiftCSVExport.xcodeproj/SwiftCSVExport_Info.plist new file mode 100644 index 0000000..57ada9f --- /dev/null +++ b/SwiftCSVExport.xcodeproj/SwiftCSVExport_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/SwiftCSVExport.xcodeproj/project.pbxproj b/SwiftCSVExport.xcodeproj/project.pbxproj index 53c93bc..ee8bce5 100644 --- a/SwiftCSVExport.xcodeproj/project.pbxproj +++ b/SwiftCSVExport.xcodeproj/project.pbxproj @@ -7,14 +7,13 @@ objects = { /* Begin PBXBuildFile section */ + 0B2F39981E645A4B0019240C /* CSVExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B2F39971E645A4B0019240C /* CSVExport.swift */; }; 0B54EBD91E4987A00043976B /* SwiftCSVExport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B54EBCF1E4987A00043976B /* SwiftCSVExport.framework */; }; 0B54EBDE1E4987A00043976B /* SwiftCSVExportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B54EBDD1E4987A00043976B /* SwiftCSVExportTests.swift */; }; 0B54EBE01E4987A00043976B /* SwiftCSVExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B54EBD21E4987A00043976B /* SwiftCSVExport.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0B54EBEA1E4987FA0043976B /* CSVExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B54EBE91E4987FA0043976B /* CSVExport.swift */; }; 0B54EBF91E499C1B0043976B /* SwiftCSVExportOSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B54EBF01E499C1B0043976B /* SwiftCSVExportOSX.framework */; }; 0B54EBFE1E499C1B0043976B /* SwiftCSVExportOSXTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B54EBFD1E499C1B0043976B /* SwiftCSVExportOSXTests.swift */; }; 0B54EC001E499C1B0043976B /* SwiftCSVExportOSX.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B54EBF21E499C1B0043976B /* SwiftCSVExportOSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 0B54EC071E499C2F0043976B /* CSVExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0B54EBE91E4987FA0043976B /* CSVExport.swift */; }; 0B69156F1E4DB535007C9394 /* SwiftCSVExport.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B54EBD21E4987A00043976B /* SwiftCSVExport.h */; }; /* End PBXBuildFile section */ @@ -36,13 +35,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 0B2F39971E645A4B0019240C /* CSVExport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CSVExport.swift; path = Sources/CSVExport.swift; sourceTree = SOURCE_ROOT; }; 0B54EBCF1E4987A00043976B /* SwiftCSVExport.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftCSVExport.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0B54EBD21E4987A00043976B /* SwiftCSVExport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftCSVExport.h; sourceTree = ""; }; 0B54EBD31E4987A00043976B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0B54EBD81E4987A00043976B /* SwiftCSVExportTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftCSVExportTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 0B54EBDD1E4987A00043976B /* SwiftCSVExportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftCSVExportTests.swift; sourceTree = ""; }; 0B54EBDF1E4987A00043976B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 0B54EBE91E4987FA0043976B /* CSVExport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CSVExport.swift; path = Source/CSVExport.swift; sourceTree = ""; }; 0B54EBF01E499C1B0043976B /* SwiftCSVExportOSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftCSVExportOSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 0B54EBF21E499C1B0043976B /* SwiftCSVExportOSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftCSVExportOSX.h; sourceTree = ""; }; 0B54EBF31E499C1B0043976B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -85,6 +84,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0B2F39961E645A410019240C /* Sources */ = { + isa = PBXGroup; + children = ( + 0B2F39971E645A4B0019240C /* CSVExport.swift */, + ); + name = Sources; + sourceTree = ""; + }; 0B54EBC51E4987A00043976B = { isa = PBXGroup; children = ( @@ -110,9 +117,9 @@ 0B54EBD11E4987A00043976B /* SwiftCSVExport */ = { isa = PBXGroup; children = ( + 0B2F39961E645A410019240C /* Sources */, 0B54EBD21E4987A00043976B /* SwiftCSVExport.h */, 0B54EBD31E4987A00043976B /* Info.plist */, - 0B54EBE91E4987FA0043976B /* CSVExport.swift */, ); path = SwiftCSVExport; sourceTree = ""; @@ -328,7 +335,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0B54EBEA1E4987FA0043976B /* CSVExport.swift in Sources */, + 0B2F39981E645A4B0019240C /* CSVExport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -344,7 +351,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0B54EC071E499C2F0043976B /* CSVExport.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -587,7 +593,6 @@ 0B54EC051E499C1B0043976B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 7FUQA46NH7; @@ -604,7 +609,6 @@ 0B54EC061E499C1B0043976B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 7FUQA46NH7; diff --git a/Tests/CSVExportTests/CSVExportTests.swift b/Tests/CSVExportTests/CSVExportTests.swift new file mode 100755 index 0000000..ab7ffd5 --- /dev/null +++ b/Tests/CSVExportTests/CSVExportTests.swift @@ -0,0 +1,28 @@ +// +// CSVExportTests.swift +// SwiftCSVExport +// +// Created by Vignesh on 30/01/17. +// Copyright © 2017 vigneshuvi. All rights reserved. +// + + +@testable import SwiftCSVExport +import XCTest + +class CSVExportTests: XCTestCase { + + func testCSVExport() { + /* + let string = "[{\"name\":\"vignesh\",\"email\":\"vigneshuvi@gmail.com\"},{\"name\":\"vinoth\",\"email\":\"vinoth@gmail.com\"}]"; + let filePath:String = exportCSV("userlist", fields:["name","email"], values:string); + print(filePath) + + let fileDetails = readCSV(filePath); + XCTAssertNotNil(fileDetails, "CSV object cann't be nil") + if fileDetails.allKeys.count > 0 { + print(fileDetails) + }*/ + } + +} diff --git a/Tests/CSVExportTests/XCTestManifests.swift b/Tests/CSVExportTests/XCTestManifests.swift new file mode 100755 index 0000000..127220d --- /dev/null +++ b/Tests/CSVExportTests/XCTestManifests.swift @@ -0,0 +1,14 @@ +// +// CSVExportTests.swift +// SwiftCSVExport +// +// Created by Vignesh on 30/01/17. +// Copyright © 2017 vigneshuvi. All rights reserved. +// + +extension CSVExportTests { + + static var allTests = [ + ("testCSVExport", testCSVExport) + ] +} \ No newline at end of file diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift new file mode 100755 index 0000000..aa462a9 --- /dev/null +++ b/Tests/LinuxMain.swift @@ -0,0 +1,14 @@ +// +// LinuxMain.swift +// SwiftCSVExport +// +// Created by Vignesh on 30/01/17. +// Copyright © 2017 vigneshuvi. All rights reserved. +// + +@testable import CSVExportTests + +import XCTest + +XCTMain([testCase(CSVExportTests.allTests) + ])