Skip to content

Commit 173c6fc

Browse files
committed
Update for 1.8.2 release
1 parent 0a9b8c9 commit 173c6fc

File tree

14 files changed

+114
-36
lines changed

14 files changed

+114
-36
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Change Log
22

3+
## [1.8.2](https://github.com/nicklockwood/ShapeScript/releases/tag/1.8.2) (2024-01-20)
4+
5+
- Fixed alpha blending bugs in rendered images
6+
- Uniform vertex colors are now converted to a material
7+
- Improved error messaging for file access errors
8+
- Increased stack limit to prevent overflow for trivial recursion
9+
- Fixed double application of local transform to imported shapes
10+
- Fixed double application of local transform in functions
11+
- Bumped Euclid to version 0.7.4
12+
- Bumped LRUCache to version 1.0.5
13+
314
## [1.8.1](https://github.com/nicklockwood/ShapeScript/releases/tag/1.8.1) (2023-12-31)
415

516
- Improved color replacement for imported shapes

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ ShapeScript is packaged as a Swift framework, which itself depends on the [Eucli
3434
To install the ShapeScript framework using CocoaPods, add the following to your Podfile:
3535

3636
```ruby
37-
pod 'ShapeScript', '~> 1.6'
37+
pod 'ShapeScript', '~> 1.8'
3838
```
3939

4040
To install using Carthage, add this to your Cartfile:
4141

4242
```ogdl
43-
github "nicklockwood/ShapeScript" ~> 1.6
43+
github "nicklockwood/ShapeScript" ~> 1.8
4444
```
4545

4646
To install using Swift Package Manager, add this to the `dependencies:` section in your Package.swift file:
4747

4848
```swift
49-
.package(url: "https://github.com/nicklockwood/ShapeScript.git", .upToNextMinor(from: "1.6.0")),
49+
.package(url: "https://github.com/nicklockwood/ShapeScript.git", .upToNextMinor(from: "1.8.0")),
5050
```
5151

5252
The repository also includes ShapeScript Viewer apps for iOS and macOS, a cut-down version of the full ShapeScript apps available on the [Mac](https://apps.apple.com/app/id1441135869) and [iOS](https://apps.apple.com/app/id1606439346) app stores. It is not currently possible to install or run these apps using CocoaPods, Carthage or Swift Package Manager but you can run them by opening the included Xcode project and selecting the `Viewer (Mac)` or `Viewer (iOS)` schemes. For Linux, see [usage instructions](#usage-linux) below.

ShapeScript.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ShapeScript",
3-
"version": "1.8.1",
3+
"version": "1.8.2",
44
"license": {
55
"type": "MIT",
66
"file": "LICENSE.md"
@@ -10,7 +10,7 @@
1010
"authors": "Nick Lockwood",
1111
"source": {
1212
"git": "https://github.com/nicklockwood/ShapeScript.git",
13-
"tag": "1.8.1"
13+
"tag": "1.8.2"
1414
},
1515
"source_files": ["ShapeScript", "LRUCache/Sources", "SVGPath/Sources"],
1616
"requires_arc": true,

ShapeScript.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@
13421342
"$(inherited)",
13431343
"@executable_path/../Frameworks",
13441344
);
1345-
MARKETING_VERSION = 1.8.1;
1345+
MARKETING_VERSION = 1.8.2;
13461346
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
13471347
PRODUCT_MODULE_NAME = Viewer;
13481348
PRODUCT_NAME = "ShapeScript Viewer";
@@ -1370,7 +1370,7 @@
13701370
"$(inherited)",
13711371
"@executable_path/../Frameworks",
13721372
);
1373-
MARKETING_VERSION = 1.8.1;
1373+
MARKETING_VERSION = 1.8.2;
13741374
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
13751375
PRODUCT_MODULE_NAME = Viewer;
13761376
PRODUCT_NAME = "ShapeScript Viewer";
@@ -1400,7 +1400,7 @@
14001400
"$(inherited)",
14011401
"@executable_path/Frameworks",
14021402
);
1403-
MARKETING_VERSION = 1.8.1;
1403+
MARKETING_VERSION = 1.8.2;
14041404
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
14051405
PRODUCT_MODULE_NAME = Viewer;
14061406
PRODUCT_NAME = ShapeScript;
@@ -1435,7 +1435,7 @@
14351435
"$(inherited)",
14361436
"@executable_path/Frameworks",
14371437
);
1438-
MARKETING_VERSION = 1.8.1;
1438+
MARKETING_VERSION = 1.8.2;
14391439
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
14401440
PRODUCT_MODULE_NAME = Viewer;
14411441
PRODUCT_NAME = ShapeScript;
@@ -1602,7 +1602,7 @@
16021602
"@executable_path/../Frameworks",
16031603
"@loader_path/Frameworks",
16041604
);
1605-
MARKETING_VERSION = 1.8.1;
1605+
MARKETING_VERSION = 1.8.2;
16061606
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
16071607
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
16081608
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;
@@ -1639,7 +1639,7 @@
16391639
"@executable_path/../Frameworks",
16401640
"@loader_path/Frameworks",
16411641
);
1642-
MARKETING_VERSION = 1.8.1;
1642+
MARKETING_VERSION = 1.8.2;
16431643
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
16441644
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
16451645
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;

ShapeScript/Interpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
// MARK: Public interface
1313

14-
public let version = "1.8.1"
14+
public let version = "1.8.2"
1515

1616
public func evaluate(
1717
_ program: Program,

ShapeScript/StandardLibrary.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,8 @@ extension Dictionary where Key == String, Value == Symbol {
294294
},
295295
// debug
296296
"debug": .block(.group) { context in
297-
context.children.forEach {
298-
if case let .mesh(geometry) = $0 {
299-
geometry.debug = true
300-
}
297+
for case let .mesh(geometry) in context.children {
298+
geometry.debug = true
301299
}
302300
if context.children.count == 1,
303301
case let .mesh(child) = context.children[0]

ShapeScriptTests/MetadataTests.swift

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private let exampleURLs: [URL] = try! FileManager.default
4747
.map { URL(fileURLWithPath: $0, relativeTo: examplesDirectory) }
4848
.filter { $0.pathExtension == "shape" }
4949

50-
private let shapeScriptVersion: String = {
50+
private let projectVersion: String = {
5151
let string = try! String(contentsOf: projectURL)
5252
let start = string.range(of: "MARKETING_VERSION = ")!.upperBound
5353
let end = string.range(of: ";", range: start ..< string.endIndex)!.lowerBound
@@ -118,7 +118,7 @@ private let footerLinks: [(String, String)] = [
118118

119119
private let versions: [String] = {
120120
let fm = FileManager.default
121-
var versions = Set([shapeScriptVersion])
121+
var versions = Set([projectVersion])
122122
let files = try! fm.contentsOfDirectory(atPath: helpDirectory.path)
123123
for file in files where file.hasPrefix("1.") {
124124
versions.insert(file)
@@ -158,29 +158,38 @@ private let urlRegex = try! NSRegularExpression(pattern: "\\]\\(([^\\)]*)\\)", o
158158
class MetadataTests: XCTestCase {
159159
// MARK: Releases
160160

161-
func testLatestVersionInChangelog() {
162-
let changelog = try! String(contentsOf: changelogURL, encoding: .utf8)
163-
XCTAssertTrue(changelog.contains("[\(shapeScriptVersion)]"), "CHANGELOG.md does not mention latest release")
161+
func testProjectVersionMatchesChangelog() throws {
162+
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
163+
let range = try XCTUnwrap(changelog.range(of: "releases/tag/"))
164164
XCTAssertTrue(
165-
changelog.contains("(https://github.com/nicklockwood/ShapeScript/releases/tag/\(shapeScriptVersion))"),
165+
changelog[range.upperBound...].hasPrefix(projectVersion),
166+
"Project version \(projectVersion) does not match most recent tag in CHANGELOG.md"
167+
)
168+
}
169+
170+
func testLatestVersionInChangelog() throws {
171+
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
172+
XCTAssertTrue(changelog.contains("[\(projectVersion)]"), "CHANGELOG.md does not mention latest release")
173+
XCTAssertTrue(
174+
changelog.contains("(https://github.com/nicklockwood/ShapeScript/releases/tag/\(projectVersion))"),
166175
"CHANGELOG.md does not include correct link for latest release"
167176
)
168177
}
169178

170-
func testLatestVersionInPodspec() {
171-
let podspec = try! String(contentsOf: podspecURL, encoding: .utf8)
179+
func testLatestVersionInPodspec() throws {
180+
let podspec = try String(contentsOf: podspecURL, encoding: .utf8)
172181
XCTAssertTrue(
173-
podspec.contains("\"version\": \"\(shapeScriptVersion)\""),
182+
podspec.contains("\"version\": \"\(projectVersion)\""),
174183
"Podspec version does not match latest release"
175184
)
176185
XCTAssertTrue(
177-
podspec.contains("\"tag\": \"\(shapeScriptVersion)\""),
186+
podspec.contains("\"tag\": \"\(projectVersion)\""),
178187
"Podspec tag does not match latest release"
179188
)
180189
}
181190

182191
func testVersionConstantUpdated() {
183-
XCTAssertEqual(ShapeScript.version, shapeScriptVersion)
192+
XCTAssertEqual(ShapeScript.version, projectVersion)
184193
}
185194

186195
func testChangelogDatesAreAscending() throws {
@@ -202,7 +211,7 @@ class MetadataTests: XCTestCase {
202211
}
203212

204213
func testUpdateWhatsNew() throws {
205-
let changelog = try! String(contentsOf: changelogURL, encoding: .utf8)
214+
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
206215
var releases = [(version: String, date: String, notes: [String])]()
207216
var notes = [String]()
208217
for line in changelog.split(separator: "\n") {
@@ -550,9 +559,9 @@ class MetadataTests: XCTestCase {
550559
551560
func testExportVersionedHelp() throws {
552561
let fm = FileManager.default
553-
let outputDirectory = helpDirectory.appendingPathComponent(shapeScriptVersion)
562+
let outputDirectory = helpDirectory.appendingPathComponent(projectVersion)
554563
guard fm.fileExists(atPath: outputDirectory.path) else {
555-
XCTFail("Help directory for \(shapeScriptVersion) not found")
564+
XCTFail("Help directory for \(projectVersion) not found")
556565
return
557566
}
558567
let attrs = try fm.attributesOfItem(atPath: outputDirectory.path)

Viewer/Mac/WhatsNew.rtf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,34 @@ What's New in ShapeScript?\
1111
\
1212
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
1313

14+
\f1\b\fs28 \cf2 ShapeScript 1.8.2 \'97 2024-01-20\
15+
\
16+
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
17+
\cf2 \kerning1\expnd0\expndtw0 \'95
18+
\f0\b0 \expnd0\expndtw0\kerning0
19+
Fixed alpha blending bugs in rendered images.\
20+
\ \'95
21+
\f0\b0 \expnd0\expndtw0\kerning0
22+
Uniform vertex colors are now converted to a material.\
23+
\ \'95
24+
\f0\b0 \expnd0\expndtw0\kerning0
25+
Improved error messaging for file access errors.\
26+
\ \'95
27+
\f0\b0 \expnd0\expndtw0\kerning0
28+
Increased stack limit to prevent overflow for trivial recursion.\
29+
\ \'95
30+
\f0\b0 \expnd0\expndtw0\kerning0
31+
Fixed double application of local transform to imported shapes.\
32+
\ \'95
33+
\f0\b0 \expnd0\expndtw0\kerning0
34+
Fixed double application of local transform in functions.\
35+
\ \'95
36+
\f0\b0 \expnd0\expndtw0\kerning0
37+
Bumped Euclid to version 0.7.4.\
38+
\ \'95
39+
\f0\b0 \expnd0\expndtw0\kerning0
40+
Bumped LRUCache to version 1.0.5.\
41+
\
1442
\f1\b\fs28 \cf2 ShapeScript 1.8.1 \'97 2023-12-31\
1543
\
1644
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0

Viewer/Shared/DocumentViewController+View.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ extension DocumentViewController {
7474
}
7575

7676
// create geometry
77-
geometry.children.forEach {
78-
scnScene.rootNode.addChildNode(SCNNode($0))
77+
for child in geometry.children {
78+
scnScene.rootNode.addChildNode(SCNNode(child))
7979
}
8080

8181
// restore selection

Viewer/Shared/FileMonitor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ class FileMonitor {
7070

7171
deinit {
7272
timer?.invalidate()
73-
securityScopedResources.forEach {
74-
$0.stopAccessingSecurityScopedResource()
73+
for resource in securityScopedResources {
74+
resource.stopAccessingSecurityScopedResource()
7575
}
7676
}
7777
}

Viewer/Shared/ProgramError+Formatting.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import ShapeScript
1010

1111
#if canImport(UIKit)
1212
import UIKit
13+
1314
typealias OSColor = UIColor
1415
typealias OSFont = UIFont
1516
#else
1617
import Cocoa
18+
1719
typealias OSColor = NSColor
1820
typealias OSFont = NSFont
1921
#endif

Viewer/iOS/Document.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class Document: UIDocument {
113113
loadingProgress?.cancel()
114114
super.close { hasChanges in
115115
completionHandler?(hasChanges)
116-
self.securityScopedResources.forEach {
117-
$0.stopAccessingSecurityScopedResource()
116+
for resource in self.securityScopedResources {
117+
resource.stopAccessingSecurityScopedResource()
118118
}
119119
}
120120
}

Viewer/iOS/WhatsNew.rtf

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,35 @@
55
\paperw11900\paperh16840\margl1440\margr1440\vieww24140\viewh18420\viewkind0
66
\deftab720
77

8+
\f0\b \cf2 ShapeScript 1.8.2 \'97 2024-01-20\
9+
\
10+
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
11+
\cf2 \kerning1\expnd0\expndtw0
12+
\f1\b0 \expnd0\expndtw0\kerning0 \'95
13+
\f1\b0 \expnd0\expndtw0\kerning0
14+
Fixed alpha blending bugs in rendered images.\
15+
\ \'95
16+
\f1\b0 \expnd0\expndtw0\kerning0
17+
Uniform vertex colors are now converted to a material.\
18+
\ \'95
19+
\f1\b0 \expnd0\expndtw0\kerning0
20+
Improved error messaging for file access errors.\
21+
\ \'95
22+
\f1\b0 \expnd0\expndtw0\kerning0
23+
Increased stack limit to prevent overflow for trivial recursion.\
24+
\ \'95
25+
\f1\b0 \expnd0\expndtw0\kerning0
26+
Fixed double application of local transform to imported shapes.\
27+
\ \'95
28+
\f1\b0 \expnd0\expndtw0\kerning0
29+
Fixed double application of local transform in functions.\
30+
\ \'95
31+
\f1\b0 \expnd0\expndtw0\kerning0
32+
Bumped Euclid to version 0.7.4.\
33+
\ \'95
34+
\f1\b0 \expnd0\expndtw0\kerning0
35+
Bumped LRUCache to version 1.0.5.\
36+
\
837
\f0\b \cf2 ShapeScript 1.8.1 \'97 2023-12-31\
938
\
1039
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0

docs/1.8.2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.8.1

0 commit comments

Comments
 (0)