Create a package

This commit is contained in:
Alexandr Goncharov 2017-10-08 02:15:55 +03:00
parent 9cb222f0f9
commit d614bc0b2c
7 changed files with 98 additions and 0 deletions

1
.gitignore vendored
View File

@ -65,3 +65,4 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
JSONDecoder-Keypath.xcodeproj

2
.swift-version Normal file
View File

@ -0,0 +1,2 @@
4.0

41
.swiftlint.yml Normal file
View File

@ -0,0 +1,41 @@
included: # paths to include during linting. `--path` is ignored if present.
- Sources
- Tests
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle)
disabled_rules: # rule identifiers to exclude from running
- line_length
- todo
- nesting
opt_in_rules: # some rules are only opt-in
- empty_count
- explicit_init
- closure_spacing
- overridden_super_call
- redundant_nil_coalescing
- private_outlet
- operator_usage_whitespace
- first_where
- fatal_error_message
- vertical_parameter_alignment_on_call
- unneeded_parentheses_in_closure_argument
- extension_access_modifier
- pattern_matching_keywords
- force_unwrapping
# configurable rules can be customized from this configuration file
# binary rules can set their severity level
trailing_whitespace:
ignores_empty_lines: true
ignores_comments: true
vertical_whitespace: # Limit vertical whitespace to a single empty line.
max_empty_lines: 2
identifier_name:
excluded:
- id

29
Package.swift Normal file
View File

@ -0,0 +1,29 @@
// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "JSONDecoder-Keypath",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "JSONDecoder-Keypath",
targets: ["JSONDecoder-Keypath"]),
],
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: "JSONDecoder-Keypath",
dependencies: []),
.testTarget(
name: "JSONDecoder-KeypathTests",
dependencies: ["JSONDecoder-Keypath"]),
],
swiftLanguageVersions: [4]
)

View File

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

View File

@ -0,0 +1,16 @@
import XCTest
@testable import JSONDecoder_Keypath
class JSONDecoder_KeypathTests: 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(JSONDecoder_Keypath().text, "Hello, World!")
}
static var allTests = [
("testExample", testExample),
]
}

6
Tests/LinuxMain.swift Normal file
View File

@ -0,0 +1,6 @@
import XCTest
@testable import JSONDecoder_KeypathTests
XCTMain([
testCase(JSONDecoder_KeypathTests.allTests),
])