Skip to content

Commit

Permalink
0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
subdan committed Sep 10, 2020
1 parent df798ea commit 527d840
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion FigmaExport.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "FigmaExport"
spec.version = "0.10.5"
spec.version = "0.11.0"
spec.summary = "Command line utility to export colors, icons and images from Figma to Xcode / Android Studio project."
spec.homepage = "https://github.com/RedMadRobot/figma-export"
spec.license = { type: "MIT", file: "LICENSE" }
Expand Down
9 changes: 0 additions & 9 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{
"object": {
"pins": [
{
"package": "Diff",
"repositoryURL": "https://github.com/soffes/Diff",
"state": {
"branch": null,
"revision": "859cf080426506d998058c3bece38fbdcf1fbc02",
"version": "0.2.5"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit.git",
Expand Down
5 changes: 2 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ let package = Package(
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.0.1"),
.package(url: "https://github.com/jpsim/Yams.git", from: "3.0.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.14.0"),
.package(url: "https://github.com/soffes/Diff", from: "0.2.5")
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.14.0")
],
targets: [

Expand Down Expand Up @@ -58,7 +57,7 @@ let package = Package(
),
.testTarget(
name: "XcodeExportTests",
dependencies: ["XcodeExport", "Diff"]
dependencies: ["XcodeExport"]
)
]
)
2 changes: 1 addition & 1 deletion Sources/XcodeExport/XcodeTypographyExporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Label: UILabel {
var style: LabelStyle? { nil }
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDtitleLabel?.fontidChange(previousTraitCollection)
super.traitCollectionDidChange(previousTraitCollection)
if previousTraitCollection?.preferredContentSizeCategory != traitCollection.preferredContentSizeCategory {
updateText()
Expand Down
29 changes: 2 additions & 27 deletions Tests/XcodeExportTests/XcodeTypographyExporterTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import XCTest
import XcodeExport
import FigmaExportCore
import Diff

final class XcodeTypographyExporterTests: XCTestCase {

Expand Down Expand Up @@ -221,7 +220,7 @@ final class XcodeTypographyExporterTests: XCTestCase {
self.tracking = tracking
}
funcs attributes(for alignment: NSTextAlignment, lineBreakMode: NSLineBreakMode) -> [NSAttributedString.Key: Any] {
func attributes(for alignment: NSTextAlignment, lineBreakMode: NSLineBreakMode) -> [NSAttributedString.Key: Any] {
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.alignment = alignment
Expand Down Expand Up @@ -250,29 +249,6 @@ final class XcodeTypographyExporterTests: XCTestCase {
}
"""

let differ: () -> String = {
var result = ""

let diff1 = diff(contentsLabel, String(data: files[0].data!, encoding: .utf8)!)
let diff2 = diff(contentsLabelStyle, String(data: files[1].data!, encoding: .utf8)!)

if let d = diff1 {
let a = String.Index(utf16Offset: d.0.lowerBound - 10, in: contentsLabel)
let b = String.Index(utf16Offset: d.0.upperBound + 10, in: contentsLabel)
print(contentsLabel[a..<b])
result += "range=\(d.0) symbols=\(d.1)"
}

if let d = diff2 {
let a = String.Index(utf16Offset: d.0.lowerBound - 10, in: contentsLabel)
let b = String.Index(utf16Offset: d.0.upperBound + 10, in: contentsLabel)
print(contentsLabel[a..<b])
result += "\nrange=\(d.0) symbols=\(d.1)"
}

return result
}

XCTAssertEqual(files.count, 2, "Must be generated 2 files but generated \(files.count)")
XCTAssertEqual(
files,
Expand All @@ -291,8 +267,7 @@ final class XcodeTypographyExporterTests: XCTestCase {
),
data: contentsLabelStyle.data(using: .utf8)!
)
],
differ()
]
)
}

Expand Down

0 comments on commit 527d840

Please sign in to comment.