Create WebDAV Swift Package

This commit is contained in:
Isvvc 2020-10-29 13:59:43 -06:00
parent 56355adf92
commit 268c640f72
7 changed files with 79 additions and 5 deletions

15
.gitignore vendored
View File

@ -37,11 +37,11 @@ playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
Packages/
Package.pins
Package.resolved
*.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
@ -88,3 +88,8 @@ fastlane/test_output
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
# macOS
.DS_Store

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

28
Package.swift Normal file
View File

@ -0,0 +1,28 @@
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "WebDAV",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "WebDAV",
targets: ["WebDAV"]),
],
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 this package depends on.
.target(
name: "WebDAV",
dependencies: []),
.testTarget(
name: "WebDAVTests",
dependencies: ["WebDAV"]),
]
)

View File

@ -0,0 +1,3 @@
struct WebDAV {
var text = "Hello, World!"
}

7
Tests/LinuxMain.swift Normal file
View File

@ -0,0 +1,7 @@
import XCTest
import WebDAVTests
var tests = [XCTestCaseEntry]()
tests += WebDAVTests.allTests()
XCTMain(tests)

View File

@ -0,0 +1,15 @@
import XCTest
@testable import WebDAV
final class WebDAVTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct
// results.
XCTAssertEqual(WebDAV().text, "Hello, World!")
}
static var allTests = [
("testExample", testExample),
]
}

View File

@ -0,0 +1,9 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(WebDAVTests.allTests),
]
}
#endif