Add various tooling and SQLite.swift dependency

This commit is contained in:
Simon Kågedal Reimer 2019-05-11 10:43:07 +02:00
parent 60ea7523a1
commit dab1963191
12 changed files with 90 additions and 4 deletions

2
Mintfile Normal file
View File

@ -0,0 +1,2 @@
realm/SwiftLint@0.32.0
skagedal/xcodeproj-modify@1.0.2

View File

@ -1,6 +1,15 @@
{
"object": {
"pins": [
{
"package": "SQLite.swift",
"repositoryURL": "https://github.com/stephencelis/SQLite.swift.git",
"state": {
"branch": null,
"revision": "691fc89e75873d417d700920e79a63cf210d1d71",
"version": "0.12.0"
}
},
{
"package": "llbuild",
"repositoryURL": "https://github.com/apple/swift-llbuild.git",

View File

@ -12,7 +12,8 @@ let package = Package(
],
dependencies: [
// There is no tagged release of Swift 5's SwiftPM yet, so let's use this for now.
.package(url: "https://github.com/apple/swift-package-manager.git", .branch("swift-5.0-branch"))
.package(url: "https://github.com/apple/swift-package-manager.git", .branch("swift-5.0-branch")),
.package(url: "https://github.com/stephencelis/SQLite.swift.git", from: "0.12.0"),
],
targets: [
.target(
@ -28,7 +29,8 @@ let package = Package(
.target(
name: "XcodeSimulatorKit",
dependencies: [
"SPMUtility"
"SPMUtility",
"SQLite"
]
),

3
Sources/.swiftlint.yml Normal file
View File

@ -0,0 +1,3 @@
disabled_rules:
- identifier_name
- nesting

View File

@ -63,7 +63,7 @@ struct CommandLineOptions {
binder.bind(
parser: parser,
to: { options, subcommand in
to: { _, subcommand in
print("Parsed subcommand: \(subcommand)")
}
)

View File

@ -0,0 +1,8 @@
//
// TrustStore.swift
// XcodeSimulatorKit
//
// Created by Simon Kågedal Reimer on 2019-05-05.
//
import Foundation

View File

@ -0,0 +1,10 @@
//
// NOTE: This file is automatically generated by generate-version-swift.sh.
// Should not be under version control.
//
public extension XcodeSimulatorTool {
static var version: String {
return "0.1"
}
}

View File

@ -34,7 +34,7 @@ public class XcodeSimulatorTool {
case .noCommand:
options.printUsage(on: stdoutStream)
case .version:
print("xcode-simulator-tool version 0.1")
print("xcode-simulator-tool version \(XcodeSimulatorTool.version)")
case .command(let command):
try command.run()
}

3
add-build-phase.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
mint run xcodeproj-modify xcodeproj-modify ./xcode-simulator-tool.xcodeproj add-run-script-phase xcode-simulator-tool ./xcode-build-phase.sh

15
generate-version-swift.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
version="0.1"
cat > ./Sources/XcodeSimulatorKit/Version.swift <<EOF
//
// NOTE: This file is automatically generated by generate-version-swift.sh.
// Should not be under version control.
//
public extension XcodeSimulatorTool {
static var version: String {
return "${version}"
}
}

28
generate-xcodeproj.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# This script should be run to generate the Xcode project.
# Generate xcodeproj
swift package generate-xcodeproj
# Set header template.
sed s/CURRENTYEAR/`date +%Y`/g > xcode-simulator-tool.xcodeproj/xcshareddata/IDETemplateMacros.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// Copyright © CURRENTYEAR Simon Kågedal Reimer. See LICENSE.
//</string>
</dict>
</plist>
EOF
echo Please open xcode-simulator-tool.xcodeproj in Xcode.
echo Then close it.
echo Then run ./add-build-phase.sh
echo Then open it again.
echo 'Edit Build Settings and make sure "Enable Modules (C and Objective-C)" is set to Yes.'

6
xcode-build-phase.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# This should be executed as a build phase in Xcode
mint run swiftlint swiftlint autocorrect --path Sources
mint run swiftlint swiftlint --path Sources