Skip to content

Commit 152eb01

Browse files
committed
Refactor REPL framework and move it into a separate framework LispKitTools.
1 parent 189a77f commit 152eb01

File tree

7 files changed

+268
-19
lines changed

7 files changed

+268
-19
lines changed

LispKit.xcodeproj/project.pbxproj

+196-11
Large diffs are not rendered by default.

Package.swift

+11-5
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,24 @@ let package = Package(
4242
],
4343
products: [
4444
.library(name: "LispKit", targets: ["LispKit"]),
45+
.library(name: "LispKitTools", targets: ["LispKitTools"]),
4546
.executable(name: "LispKitRepl", targets: ["LispKitRepl"])
4647
],
4748
dependencies: [
48-
.package(url: "https://github.com/objecthub/swift-numberkit.git", from: "2.3.2"),
49-
.package(url: "https://github.com/objecthub/swift-markdownkit.git", from: "0.2.0"),
50-
.package(url: "https://github.com/objecthub/swift-commandlinekit.git", from: "0.3.1")
49+
.package(url: "https://github.com/objecthub/swift-numberkit.git",
50+
.upToNextMajor(from: "2.3.2")),
51+
.package(url: "https://github.com/objecthub/swift-markdownkit.git",
52+
.upToNextMajor(from: "0.2.0")),
53+
.package(url: "https://github.com/objecthub/swift-commandlinekit.git",
54+
.upToNextMajor(from: "0.3.1"))
5155
],
5256
targets: [
5357
.target(name: "LispKit",
54-
dependencies: ["NumberKit", "MarkdownKit", "CommandLineKit"]),
58+
dependencies: ["NumberKit", "MarkdownKit"]),
59+
.target(name: "LispKitTools",
60+
dependencies: ["LispKit", "CommandLineKit"]),
5561
.target(name: "LispKitRepl",
56-
dependencies: ["LispKit"],
62+
dependencies: ["LispKit", "LispKitTools"],
5763
exclude: ["BuildMetadata.m", "BuildMetadata.h"]),
5864
.testTarget(name: "LispKitTests",
5965
dependencies: ["LispKit"])

Sources/LispKitRepl/LispKitReplBridgingHeader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// LispKitRepl-Bridging-Header.h
2+
// LispKitReplBridgingHeader.h
33
// LispKit
44
//
55
// Created by Matthias Zenger on 14/04/2016.

Sources/LispKitRepl/main.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
// limitations under the License.
1919
//
2020

21+
import Foundation
2122
import LispKit
23+
import LispKitTools
2224

2325
let repl = LispKitRepl(name: AppInfo.name,
2426
version: AppInfo.version,
2527
build: AppInfo.buildAnnotation,
2628
copyright: AppInfo.copyright,
2729
prompt: AppInfo.prompt)
30+
let features = ["repl"]
2831

2932
guard repl.flagsValid() else {
3033
exit(1)
@@ -35,11 +38,11 @@ if repl.shouldRunRepl() {
3538
guard repl.configurationSuccessfull(implementationName: "LispKit",
3639
implementationVersion: "1.8.1",
3740
includeInternalResources: false,
38-
features: ["repl"]) else {
41+
features: features) else {
3942
exit(1)
4043
}
4144
#else
42-
guard repl.configurationSuccessfull(features: ["repl"]) else {
45+
guard repl.configurationSuccessfull(features: features) else {
4346
exit(1)
4447
}
4548
#endif

Sources/LispKitTools/Info.plist

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>$(MARKETING_VERSION)</string>
19+
<key>CFBundleVersion</key>
20+
<string>$(CURRENT_PROJECT_VERSION)</string>
21+
<key>NSHumanReadableCopyright</key>
22+
<string>Copyright © 2019 Matthias Zenger. All rights reserved.</string>
23+
</dict>
24+
</plist>

Sources/LispKit/REPL/LispKitRepl.swift renamed to Sources/LispKitTools/LispKitRepl.swift

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//
2020

2121
import Foundation
22+
import LispKit
2223
import CommandLineKit
2324

2425
///

Sources/LispKitTools/LispKitTools.h

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// LispKitTools.h
3+
// LispKitTools
4+
//
5+
// Created by Matthias Zenger on 21/11/2019.
6+
// Copyright © 2019 ObjectHub. All rights reserved.
7+
//
8+
// Licensed under the Apache License, Version 2.0 (the "License");
9+
// you may not use this file except in compliance with the License.
10+
// You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing, software
15+
// distributed under the License is distributed on an "AS IS" BASIS,
16+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
// See the License for the specific language governing permissions and
18+
// limitations under the License.
19+
//
20+
21+
#import <Foundation/Foundation.h>
22+
23+
//! Project version number for LispKitTools.
24+
FOUNDATION_EXPORT double LispKitToolsVersionNumber;
25+
26+
//! Project version string for LispKitTools.
27+
FOUNDATION_EXPORT const unsigned char LispKitToolsVersionString[];
28+
29+
// In this header, you should import all the public headers of your framework using
30+
// statements like #import <LispKitTools/PublicHeader.h>

0 commit comments

Comments
 (0)