Skip to content

Commit

Permalink
Merge pull request #36 from jdanek4/spm-support
Browse files Browse the repository at this point in the history
Add SPM Support
  • Loading branch information
mfessenden authored Sep 15, 2021
2 parents 4a1fdd0 + 45fa75c commit 212f76e
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Docs/Private
Docs/Sketch
Demo/shaders/*
*.graffle
.build
.swiftpm
.DS_Store
51 changes: 51 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// 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: "SKTiled",
platforms: [
.iOS(.v12),
.macOS(.v10_12),
.tvOS(.v12)
],
products: [
.library(
name: "SKTiled",
targets: ["SKTiled"]),
],
dependencies: [],
targets: [
.target(
name: "SKTiled",
dependencies: [],
path: "Sources",
exclude: ["Info.plist"]
),
.testTarget(
name: "SKTiledTests",
dependencies: ["SKTiled"],
path: "Tests",
exclude: [
"Info-tvOS.plist",
"Info-iOS.plist",
"Info-macOS.plist"
],
resources: [
.copy("Assets/test-tilemap.tmx"),
.copy("Assets/characters-8x8.png"),
.copy("Assets/characters-8x8.tsx"),
.copy("Assets/environment-8x8.png"),
.copy("Assets/environment-8x8.tsx"),
.copy("Assets/items-8x8.png"),
.copy("Assets/items-8x8.tsx"),
.copy("Assets/items-alt-8x8.png"),
.copy("Assets/monsters-16x16.png"),
.copy("Assets/monsters-16x16.tsx"),
.copy("Assets/portraits-8x8.png"),
.copy("Assets/portraits-8x8.tsx")
]
)
]
)
4 changes: 2 additions & 2 deletions Tests/CoordinateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class CoordinateTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
let mapurl = testBundle!.url(forResource: tilemapName, withExtension: "tmx")!
let mapurl = testBundle.url(forResource: tilemapName, withExtension: "tmx")!
tilemap = SKTilemap.load(tmxFile: mapurl.path, loggingLevel: .none)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/ParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ParserTests: XCTestCase {
super.setUp()

if (testBundle == nil) {
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/PerformanceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PerformanceTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/PropertiesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PropertiesTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/QueryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class QueryTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/TilemapTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class TilemapTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
Expand Down
2 changes: 1 addition & 1 deletion Tests/TilesetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TilesetTests: XCTestCase {

if (testBundle == nil) {
TiledGlobals.default.loggingLevel = .none
testBundle = Bundle(for: type(of: self))
testBundle = Bundle.module
}

if (tilemap == nil) {
Expand Down

0 comments on commit 212f76e

Please sign in to comment.