Skip to content

Commit

Permalink
Update for 1.8.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklockwood committed Jan 21, 2024
1 parent 0a9b8c9 commit 173c6fc
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 36 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [1.8.2](https://github.com/nicklockwood/ShapeScript/releases/tag/1.8.2) (2024-01-20)

- Fixed alpha blending bugs in rendered images
- Uniform vertex colors are now converted to a material
- Improved error messaging for file access errors
- Increased stack limit to prevent overflow for trivial recursion
- Fixed double application of local transform to imported shapes
- Fixed double application of local transform in functions
- Bumped Euclid to version 0.7.4
- Bumped LRUCache to version 1.0.5

## [1.8.1](https://github.com/nicklockwood/ShapeScript/releases/tag/1.8.1) (2023-12-31)

- Improved color replacement for imported shapes
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ ShapeScript is packaged as a Swift framework, which itself depends on the [Eucli
To install the ShapeScript framework using CocoaPods, add the following to your Podfile:

```ruby
pod 'ShapeScript', '~> 1.6'
pod 'ShapeScript', '~> 1.8'
```

To install using Carthage, add this to your Cartfile:

```ogdl
github "nicklockwood/ShapeScript" ~> 1.6
github "nicklockwood/ShapeScript" ~> 1.8
```

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

```swift
.package(url: "https://github.com/nicklockwood/ShapeScript.git", .upToNextMinor(from: "1.6.0")),
.package(url: "https://github.com/nicklockwood/ShapeScript.git", .upToNextMinor(from: "1.8.0")),
```

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.
Expand Down
4 changes: 2 additions & 2 deletions ShapeScript.podspec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ShapeScript",
"version": "1.8.1",
"version": "1.8.2",
"license": {
"type": "MIT",
"file": "LICENSE.md"
Expand All @@ -10,7 +10,7 @@
"authors": "Nick Lockwood",
"source": {
"git": "https://github.com/nicklockwood/ShapeScript.git",
"tag": "1.8.1"
"tag": "1.8.2"
},
"source_files": ["ShapeScript", "LRUCache/Sources", "SVGPath/Sources"],
"requires_arc": true,
Expand Down
12 changes: 6 additions & 6 deletions ShapeScript.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
PRODUCT_MODULE_NAME = Viewer;
PRODUCT_NAME = "ShapeScript Viewer";
Expand Down Expand Up @@ -1370,7 +1370,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
PRODUCT_MODULE_NAME = Viewer;
PRODUCT_NAME = "ShapeScript Viewer";
Expand Down Expand Up @@ -1400,7 +1400,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
PRODUCT_MODULE_NAME = Viewer;
PRODUCT_NAME = ShapeScript;
Expand Down Expand Up @@ -1435,7 +1435,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
PRODUCT_MODULE_NAME = Viewer;
PRODUCT_NAME = ShapeScript;
Expand Down Expand Up @@ -1602,7 +1602,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;
Expand Down Expand Up @@ -1639,7 +1639,7 @@
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.8.1;
MARKETING_VERSION = 1.8.2;
MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++14";
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;
Expand Down
2 changes: 1 addition & 1 deletion ShapeScript/Interpreter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation

// MARK: Public interface

public let version = "1.8.1"
public let version = "1.8.2"

public func evaluate(
_ program: Program,
Expand Down
6 changes: 2 additions & 4 deletions ShapeScript/StandardLibrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,8 @@ extension Dictionary where Key == String, Value == Symbol {
},
// debug
"debug": .block(.group) { context in
context.children.forEach {
if case let .mesh(geometry) = $0 {
geometry.debug = true
}
for case let .mesh(geometry) in context.children {
geometry.debug = true
}
if context.children.count == 1,
case let .mesh(child) = context.children[0]
Expand Down
37 changes: 23 additions & 14 deletions ShapeScriptTests/MetadataTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private let exampleURLs: [URL] = try! FileManager.default
.map { URL(fileURLWithPath: $0, relativeTo: examplesDirectory) }
.filter { $0.pathExtension == "shape" }

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

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

func testLatestVersionInChangelog() {
let changelog = try! String(contentsOf: changelogURL, encoding: .utf8)
XCTAssertTrue(changelog.contains("[\(shapeScriptVersion)]"), "CHANGELOG.md does not mention latest release")
func testProjectVersionMatchesChangelog() throws {
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
let range = try XCTUnwrap(changelog.range(of: "releases/tag/"))
XCTAssertTrue(
changelog.contains("(https://github.com/nicklockwood/ShapeScript/releases/tag/\(shapeScriptVersion))"),
changelog[range.upperBound...].hasPrefix(projectVersion),
"Project version \(projectVersion) does not match most recent tag in CHANGELOG.md"
)
}

func testLatestVersionInChangelog() throws {
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
XCTAssertTrue(changelog.contains("[\(projectVersion)]"), "CHANGELOG.md does not mention latest release")
XCTAssertTrue(
changelog.contains("(https://github.com/nicklockwood/ShapeScript/releases/tag/\(projectVersion))"),
"CHANGELOG.md does not include correct link for latest release"
)
}

func testLatestVersionInPodspec() {
let podspec = try! String(contentsOf: podspecURL, encoding: .utf8)
func testLatestVersionInPodspec() throws {
let podspec = try String(contentsOf: podspecURL, encoding: .utf8)
XCTAssertTrue(
podspec.contains("\"version\": \"\(shapeScriptVersion)\""),
podspec.contains("\"version\": \"\(projectVersion)\""),
"Podspec version does not match latest release"
)
XCTAssertTrue(
podspec.contains("\"tag\": \"\(shapeScriptVersion)\""),
podspec.contains("\"tag\": \"\(projectVersion)\""),
"Podspec tag does not match latest release"
)
}

func testVersionConstantUpdated() {
XCTAssertEqual(ShapeScript.version, shapeScriptVersion)
XCTAssertEqual(ShapeScript.version, projectVersion)
}

func testChangelogDatesAreAscending() throws {
Expand All @@ -202,7 +211,7 @@ class MetadataTests: XCTestCase {
}

func testUpdateWhatsNew() throws {
let changelog = try! String(contentsOf: changelogURL, encoding: .utf8)
let changelog = try String(contentsOf: changelogURL, encoding: .utf8)
var releases = [(version: String, date: String, notes: [String])]()
var notes = [String]()
for line in changelog.split(separator: "\n") {
Expand Down Expand Up @@ -550,9 +559,9 @@ class MetadataTests: XCTestCase {
func testExportVersionedHelp() throws {
let fm = FileManager.default
let outputDirectory = helpDirectory.appendingPathComponent(shapeScriptVersion)
let outputDirectory = helpDirectory.appendingPathComponent(projectVersion)
guard fm.fileExists(atPath: outputDirectory.path) else {
XCTFail("Help directory for \(shapeScriptVersion) not found")
XCTFail("Help directory for \(projectVersion) not found")
return
}
let attrs = try fm.attributesOfItem(atPath: outputDirectory.path)
Expand Down
28 changes: 28 additions & 0 deletions Viewer/Mac/WhatsNew.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,34 @@ What's New in ShapeScript?\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0

\f1\b\fs28 \cf2 ShapeScript 1.8.2 \'97 2024-01-20\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
\cf2 \kerning1\expnd0\expndtw0 \'95
\f0\b0 \expnd0\expndtw0\kerning0
Fixed alpha blending bugs in rendered images.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Uniform vertex colors are now converted to a material.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Improved error messaging for file access errors.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Increased stack limit to prevent overflow for trivial recursion.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Fixed double application of local transform to imported shapes.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Fixed double application of local transform in functions.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Bumped Euclid to version 0.7.4.\
\ \'95
\f0\b0 \expnd0\expndtw0\kerning0
Bumped LRUCache to version 1.0.5.\
\
\f1\b\fs28 \cf2 ShapeScript 1.8.1 \'97 2023-12-31\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
Expand Down
4 changes: 2 additions & 2 deletions Viewer/Shared/DocumentViewController+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ extension DocumentViewController {
}

// create geometry
geometry.children.forEach {
scnScene.rootNode.addChildNode(SCNNode($0))
for child in geometry.children {
scnScene.rootNode.addChildNode(SCNNode(child))
}

// restore selection
Expand Down
4 changes: 2 additions & 2 deletions Viewer/Shared/FileMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class FileMonitor {

deinit {
timer?.invalidate()
securityScopedResources.forEach {
$0.stopAccessingSecurityScopedResource()
for resource in securityScopedResources {
resource.stopAccessingSecurityScopedResource()
}
}
}
2 changes: 2 additions & 0 deletions Viewer/Shared/ProgramError+Formatting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import ShapeScript

#if canImport(UIKit)
import UIKit

typealias OSColor = UIColor
typealias OSFont = UIFont
#else
import Cocoa

typealias OSColor = NSColor
typealias OSFont = NSFont
#endif
Expand Down
4 changes: 2 additions & 2 deletions Viewer/iOS/Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class Document: UIDocument {
loadingProgress?.cancel()
super.close { hasChanges in
completionHandler?(hasChanges)
self.securityScopedResources.forEach {
$0.stopAccessingSecurityScopedResource()
for resource in self.securityScopedResources {
resource.stopAccessingSecurityScopedResource()
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions Viewer/iOS/WhatsNew.rtf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@
\paperw11900\paperh16840\margl1440\margr1440\vieww24140\viewh18420\viewkind0
\deftab720

\f0\b \cf2 ShapeScript 1.8.2 \'97 2024-01-20\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
\cf2 \kerning1\expnd0\expndtw0
\f1\b0 \expnd0\expndtw0\kerning0 \'95
\f1\b0 \expnd0\expndtw0\kerning0
Fixed alpha blending bugs in rendered images.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Uniform vertex colors are now converted to a material.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Improved error messaging for file access errors.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Increased stack limit to prevent overflow for trivial recursion.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Fixed double application of local transform to imported shapes.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Fixed double application of local transform in functions.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Bumped Euclid to version 0.7.4.\
\ \'95
\f1\b0 \expnd0\expndtw0\kerning0
Bumped LRUCache to version 1.0.5.\
\
\f0\b \cf2 ShapeScript 1.8.1 \'97 2023-12-31\
\
\pard\tx220\tx720\pardeftab720\li720\fi-720\partightenfactor0
Expand Down
1 change: 1 addition & 0 deletions docs/1.8.2

0 comments on commit 173c6fc

Please sign in to comment.