-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use original Stencil instead of fork (#150)
- Loading branch information
Showing
20 changed files
with
43 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
{% for color in colors %} | ||
<color name="{{color.name}}">{{color.hex}}</color> | ||
{% endfor %} | ||
<resources>{% for color in colors %} | ||
<color name="{{color.name}}">{{color.hex}}</color>{% endfor %} | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
{% for textStyle in textStyles %} | ||
<resources>{% for textStyle in textStyles %} | ||
<style name="{{ textStyle.name }}"> | ||
<item name="android:fontFamily">{{ textStyle.fontFamily }}</item> | ||
<item name="android:textSize">{{ textStyle.textSize }}sp</item> | ||
<item name="android:letterSpacing">{{ textStyle.letterSpacing }}</item> | ||
</style> | ||
{% endfor %} | ||
</style>{% endfor %} | ||
</resources> |
13 changes: 2 additions & 11 deletions
13
Sources/XcodeExport/Resources/Color+extension.swift.stencil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
{% include "header.stencil" %} | ||
|
||
import SwiftUI | ||
|
||
{% if assetsInSwiftPackage %} | ||
private class BundleProvider { | ||
static let bundle = Bundle.module | ||
} | ||
|
||
{% elif not assetsInMainBundle %} | ||
private class BundleProvider { | ||
static let bundle = Bundle(for: BundleProvider.self) | ||
} | ||
|
||
{% endif %} | ||
public extension Color { | ||
{% for color in colors %} | ||
{% if assetsInMainBundle %} | ||
static var {{ color.name }}: Color { Color({% if useNamespace %}"{{ color.originalName }}"{% else %}#function{% endif %}) } | ||
{% else %} | ||
static var {{ color.name }}: Color { Color({% if useNamespace %}"{{ color.originalName }}"{% else %}#function{% endif %}, in: BundleProvider.bundle) } | ||
{% endif %} | ||
{% endfor %} | ||
public extension Color {{ "{" }}{% for color in colors %} | ||
static var {{ color.name }}: Color { Color({% if useNamespace %}"{{ color.originalName }}"{% else %}#function{% endif %}{% if not assetsInMainBundle %}, in: BundleProvider.bundle{% endif %}) }{% endfor %} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
{% include "header.stencil" %} | ||
|
||
import SwiftUI | ||
|
||
{% if assetsInSwiftPackage %} | ||
private class BundleProvider { | ||
static let bundle = Bundle.module | ||
} | ||
|
||
{% elif not assetsInMainBundle %} | ||
private class BundleProvider { | ||
static let bundle = Bundle(for: BundleProvider.self) | ||
} | ||
|
||
{% endif %} | ||
public extension Image { | ||
{% include "Image+extension.swift.stencil.include" %} | ||
public extension Image {{ "{" }}{% include "Image+extension.swift.stencil.include" %} | ||
} |
7 changes: 1 addition & 6 deletions
7
Sources/XcodeExport/Resources/Image+extension.swift.stencil.include
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
{% for image in images %} | ||
{% if assetsInMainBundle %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: Image { Image(#function) } | ||
{% else %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: Image { Image(#function, bundle: BundleProvider.bundle) } | ||
{% endif %} | ||
{% endfor %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: Image { Image(#function{% if not assetsInMainBundle %}, bundle: BundleProvider.bundle{% endif %}) }{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
{% include "header.stencil" %} | ||
|
||
import UIKit | ||
|
||
{% if assetsInSwiftPackage %} | ||
private class BundleProvider { | ||
static let bundle = Bundle.module | ||
} | ||
|
||
{% elif not assetsInMainBundle %} | ||
private class BundleProvider { | ||
static let bundle = Bundle(for: BundleProvider.self) | ||
} | ||
|
||
{% endif %} | ||
public extension UIImage { | ||
{% include "UIImage+extension.swift.stencil.include" %} | ||
public extension UIImage {{ "{" }}{% include "UIImage+extension.swift.stencil.include" %} | ||
} |
7 changes: 1 addition & 6 deletions
7
Sources/XcodeExport/Resources/UIImage+extension.swift.stencil.include
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
{% for image in images %} | ||
{% if assetsInMainBundle %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: UIImage { UIImage(named: #function)! } | ||
{% else %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: UIImage { UIImage(named: #function, in: BundleProvider.bundle, compatibleWith: nil)! } | ||
{% endif %} | ||
{% endfor %} | ||
{% if addObjcPrefix %}@objc {% endif %}static var {{ image.name }}: UIImage { UIImage(named: #function{% if not assetsInMainBundle %}, in: BundleProvider.bundle, compatibleWith: nil{% endif %})! }{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters