Skip to content

Commit

Permalink
Added package resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olcay Taner YILDIZ committed Dec 16, 2021
1 parent 1accb2c commit 1778270
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.2
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -20,7 +20,8 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "FrameNet",
dependencies: []),
dependencies: [],
resources: [.process("framenet.xml")]),
.testTarget(
name: "FrameNetTests",
dependencies: ["FrameNet"]),
Expand Down
7 changes: 3 additions & 4 deletions Sources/FrameNet/FrameNet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ public class FrameNet: NSObject, XMLParserDelegate{
private var frames: [Frame] = []
private var frame: Frame? = nil
private var value: String = ""
private var parser: XMLParser = XMLParser()

override public init(){
let url = Bundle.module.url(forResource: "framenet", withExtension: "xml")
parser = XMLParser(contentsOf: url!)!
super.init()
let thisSourceFile = URL(fileURLWithPath: #file)
let thisDirectory = thisSourceFile.deletingLastPathComponent()
let url = thisDirectory.appendingPathComponent("framenet.xml")
let parser = XMLParser(contentsOf: url)!
parser.delegate = self
parser.parse()
}
Expand Down

0 comments on commit 1778270

Please sign in to comment.