├── .gitignore ├── Example 1 - SwiftGen ├── Binaries │ └── SwiftGenBinary.artifactbundle │ │ ├── info.json │ │ └── swiftgen-6.4.0 │ │ ├── CHANGELOG.md │ │ ├── LICENCE │ │ ├── README.md │ │ ├── bin │ │ └── swiftgen │ │ ├── lib │ │ ├── Commander.framework │ │ │ ├── Commander │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Commander │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Commander │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── Kanna.framework │ │ │ ├── Kanna │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Kanna │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Kanna │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── PathKit.framework │ │ │ ├── PathKit │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── PathKit │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── PathKit │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── Stencil.framework │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ ├── Stencil │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ ├── Stencil │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ ├── Stencil │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── StencilSwiftKit.framework │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ ├── StencilSwiftKit │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ ├── StencilSwiftKit │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ ├── StencilSwiftKit │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ ├── SwiftGenKit.framework │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ ├── SwiftGenKit │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ ├── SwiftGenKit │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ ├── SwiftGenKit │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ └── Yams.framework │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ ├── Versions │ │ │ ├── A │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ ├── Yams │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ └── Current │ │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ │ ├── Yams │ │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ │ └── Yams │ │ └── templates │ │ ├── colors │ │ ├── literals-swift4.stencil │ │ ├── literals-swift5.stencil │ │ ├── swift4.stencil │ │ └── swift5.stencil │ │ ├── coredata │ │ ├── swift4.stencil │ │ └── swift5.stencil │ │ ├── fonts │ │ ├── swift4.stencil │ │ └── swift5.stencil │ │ ├── ib │ │ ├── scenes-swift4.stencil │ │ ├── scenes-swift5.stencil │ │ ├── segues-swift4.stencil │ │ └── segues-swift5.stencil │ │ ├── json │ │ ├── inline-swift4.stencil │ │ ├── inline-swift5.stencil │ │ ├── runtime-swift4.stencil │ │ └── runtime-swift5.stencil │ │ ├── plist │ │ ├── inline-swift4.stencil │ │ ├── inline-swift5.stencil │ │ ├── runtime-swift4.stencil │ │ └── runtime-swift5.stencil │ │ ├── strings │ │ ├── flat-swift4.stencil │ │ ├── flat-swift5.stencil │ │ ├── objc-h.stencil │ │ ├── objc-m.stencil │ │ ├── structured-swift4.stencil │ │ └── structured-swift5.stencil │ │ ├── xcassets │ │ ├── swift4.stencil │ │ └── swift5.stencil │ │ └── yaml │ │ ├── inline-swift4.stencil │ │ └── inline-swift5.stencil ├── Package.swift ├── Plugins │ └── SwiftGenPlugin │ │ └── plugin.swift ├── README.md ├── Sources │ └── SwiftGenExample │ │ ├── Base.lproj │ │ └── Foo.strings │ │ ├── SwiftGenExample.swift │ │ └── main.swift ├── Tests │ └── SwiftGenExampleTests │ │ └── SwiftGenExampleTests.swift └── swiftgen.yml ├── Example 2 - SwiftProtobuf ├── Package.swift ├── README.md ├── Sources │ └── ProtobufExample │ │ ├── Foo.proto │ │ ├── ProtobufExample.swift │ │ └── main.swift └── Tests │ └── ProtobufExampleTests │ └── ProtobufExampleTests.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .build/ 3 | .swiftpm/ 4 | DerivedData/ 5 | Package.resolved 6 | xcuserdata/ 7 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": "1.0", 3 | "artifacts": { 4 | "swiftgen": { 5 | "type": "executable", 6 | "version": "6.4.0", 7 | "variants": [ 8 | { 9 | "path": "swiftgen-6.4.0/bin/swiftgen", 10 | "supportedTriples": ["x86_64-apple-macosx", "arm64-apple-macosx"] 11 | }, 12 | ] 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/LICENCE: -------------------------------------------------------------------------------- 1 | MIT Licence 2 | 3 | Copyright (c) 2020 SwiftGen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/bin/swiftgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/bin/swiftgen -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Commander -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/A/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/A/Commander -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | fxz5lohg6eU7BgFhLfB6oodZH4o= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | fxz5lohg6eU7BgFhLfB6oodZH4o= 19 | 20 | hash2 21 | 22 | zjilo2yuXGdKwODfAttCRgPT+I1DvBNsxMcOB0X+PaE= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/Current/Commander: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/Current/Commander -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commander 11 | CFBundleIdentifier 12 | org.cocoapods.Commander 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commander 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Commander.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | fxz5lohg6eU7BgFhLfB6oodZH4o= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | fxz5lohg6eU7BgFhLfB6oodZH4o= 19 | 20 | hash2 21 | 22 | zjilo2yuXGdKwODfAttCRgPT+I1DvBNsxMcOB0X+PaE= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Kanna: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Kanna -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Kanna 11 | CFBundleIdentifier 12 | org.cocoapods.Kanna 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Kanna 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 5.2.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/A/Kanna: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/A/Kanna -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Kanna 11 | CFBundleIdentifier 12 | org.cocoapods.Kanna 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Kanna 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 5.2.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | k2nE1LdmafXNpbGtswxpKpPpWVU= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | k2nE1LdmafXNpbGtswxpKpPpWVU= 19 | 20 | hash2 21 | 22 | VK4SHmj9xBVkA9OVymeHLL/50IJ65LX6VsKK6abHjzU= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/Current/Kanna: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/Current/Kanna -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Kanna 11 | CFBundleIdentifier 12 | org.cocoapods.Kanna 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Kanna 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 5.2.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Kanna.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | k2nE1LdmafXNpbGtswxpKpPpWVU= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | k2nE1LdmafXNpbGtswxpKpPpWVU= 19 | 20 | hash2 21 | 22 | VK4SHmj9xBVkA9OVymeHLL/50IJ65LX6VsKK6abHjzU= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/PathKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/A/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/A/PathKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | R5TpstzJhAMGB02JxqrndLJDaFI= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | R5TpstzJhAMGB02JxqrndLJDaFI= 19 | 20 | hash2 21 | 22 | +8O14492Ui0RQGGNesdaLkuhdk9Khu5HcVJaC4UschE= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/Current/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/Current/PathKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.9.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/PathKit.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | R5TpstzJhAMGB02JxqrndLJDaFI= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | R5TpstzJhAMGB02JxqrndLJDaFI= 19 | 20 | hash2 21 | 22 | +8O14492Ui0RQGGNesdaLkuhdk9Khu5HcVJaC4UschE= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.13.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Stencil -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.13.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/A/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/A/Stencil -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | k2rcoqdtvUquenzW8Gm4M4M/Tzk= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | k2rcoqdtvUquenzW8Gm4M4M/Tzk= 19 | 20 | hash2 21 | 22 | wl+NAKZ7rMaUIzNMimUVKpqXUNooqe1HrDNFmPevCyY= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.13.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/Current/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/Current/Stencil -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Stencil.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | k2rcoqdtvUquenzW8Gm4M4M/Tzk= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | k2rcoqdtvUquenzW8Gm4M4M/Tzk= 19 | 20 | hash2 21 | 22 | wl+NAKZ7rMaUIzNMimUVKpqXUNooqe1HrDNFmPevCyY= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | StencilSwiftKit 11 | CFBundleIdentifier 12 | org.cocoapods.StencilSwiftKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | StencilSwiftKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.7.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/StencilSwiftKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/StencilSwiftKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | StencilSwiftKit 11 | CFBundleIdentifier 12 | org.cocoapods.StencilSwiftKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | StencilSwiftKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.7.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/A/StencilSwiftKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/A/StencilSwiftKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | tgilxM+NQQsHBowd2W2CmVoinzI= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | tgilxM+NQQsHBowd2W2CmVoinzI= 19 | 20 | hash2 21 | 22 | Eqy669910uabop0uFe8Wqqi6xwlZCLClP87SiGygkH8= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | StencilSwiftKit 11 | CFBundleIdentifier 12 | org.cocoapods.StencilSwiftKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | StencilSwiftKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.7.2 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/Current/StencilSwiftKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/Current/StencilSwiftKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/StencilSwiftKit.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | tgilxM+NQQsHBowd2W2CmVoinzI= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | tgilxM+NQQsHBowd2W2CmVoinzI= 19 | 20 | hash2 21 | 22 | Eqy669910uabop0uFe8Wqqi6xwlZCLClP87SiGygkH8= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftGenKit 11 | CFBundleIdentifier 12 | com.alisoftware.SwiftGenKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftGenKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 6.4.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 6.4.0 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.11 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/SwiftGenKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/SwiftGenKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftGenKit 11 | CFBundleIdentifier 12 | com.alisoftware.SwiftGenKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftGenKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 6.4.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 6.4.0 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.11 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/A/SwiftGenKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/A/SwiftGenKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | JaESlfL3GPx2h8+s2582u/VB/EU= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | JaESlfL3GPx2h8+s2582u/VB/EU= 19 | 20 | hash2 21 | 22 | t8M/YHlu03ZphV+jeh2xZorsn/yeEWmZuxppv8DjJZg= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftGenKit 11 | CFBundleIdentifier 12 | com.alisoftware.SwiftGenKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftGenKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 6.4.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 6.4.0 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.11 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/Current/SwiftGenKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/Current/SwiftGenKit -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/SwiftGenKit.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | JaESlfL3GPx2h8+s2582u/VB/EU= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | JaESlfL3GPx2h8+s2582u/VB/EU= 19 | 20 | hash2 21 | 22 | t8M/YHlu03ZphV+jeh2xZorsn/yeEWmZuxppv8DjJZg= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Yams 11 | CFBundleIdentifier 12 | org.cocoapods.Yams 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Yams 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Yams 11 | CFBundleIdentifier 12 | org.cocoapods.Yams 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Yams 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/A/Yams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/A/Yams -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | usXNJFA1ewvlsiZavz5Q1dx1dQM= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | usXNJFA1ewvlsiZavz5Q1dx1dQM= 19 | 20 | hash2 21 | 22 | LV1gYYeWQbD4Doj2Mn+BDbGO1bivphT9JZ//0K/Ko5A= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/Current/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 19H2 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Yams 11 | CFBundleIdentifier 12 | org.cocoapods.Yams 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Yams 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 12A7300 33 | DTPlatformName 34 | macosx 35 | DTPlatformVersion 36 | 10.15.6 37 | DTSDKBuild 38 | 19G68 39 | DTSDKName 40 | macosx10.15 41 | DTXcode 42 | 1201 43 | DTXcodeBuild 44 | 12A7300 45 | LSMinimumSystemVersion 46 | 10.9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/Current/Yams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/Current/Yams -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Versions/Current/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | usXNJFA1ewvlsiZavz5Q1dx1dQM= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | hash 17 | 18 | usXNJFA1ewvlsiZavz5Q1dx1dQM= 19 | 20 | hash2 21 | 22 | LV1gYYeWQbD4Doj2Mn+BDbGO1bivphT9JZ//0K/Ko5A= 23 | 24 | 25 | 26 | rules 27 | 28 | ^Resources/ 29 | 30 | ^Resources/.*\.lproj/ 31 | 32 | optional 33 | 34 | weight 35 | 1000 36 | 37 | ^Resources/.*\.lproj/locversion.plist$ 38 | 39 | omit 40 | 41 | weight 42 | 1100 43 | 44 | ^Resources/Base\.lproj/ 45 | 46 | weight 47 | 1010 48 | 49 | ^version.plist$ 50 | 51 | 52 | rules2 53 | 54 | .*\.dSYM($|/) 55 | 56 | weight 57 | 11 58 | 59 | ^(.*/)?\.DS_Store$ 60 | 61 | omit 62 | 63 | weight 64 | 2000 65 | 66 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 67 | 68 | nested 69 | 70 | weight 71 | 10 72 | 73 | ^.* 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^Resources/ 90 | 91 | weight 92 | 20 93 | 94 | ^Resources/.*\.lproj/ 95 | 96 | optional 97 | 98 | weight 99 | 1000 100 | 101 | ^Resources/.*\.lproj/locversion.plist$ 102 | 103 | omit 104 | 105 | weight 106 | 1100 107 | 108 | ^Resources/Base\.lproj/ 109 | 110 | weight 111 | 1010 112 | 113 | ^[^/]+$ 114 | 115 | nested 116 | 117 | weight 118 | 10 119 | 120 | ^embedded\.provisionprofile$ 121 | 122 | weight 123 | 20 124 | 125 | ^version\.plist$ 126 | 127 | weight 128 | 20 129 | 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Yams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abertelrud/swiftpm-buildtool-plugin-examples/7d1f2b75b5fa34b684231549cc4db26a3c7663f3/Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/lib/Yams.framework/Yams -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/colors/literals-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if palettes %} 5 | {% set enumName %}{{param.enumName|default:"ColorName"}}{% endset %} 6 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 7 | #if os(OSX) 8 | import AppKit 9 | {% if enumName != 'NSColor' %}{{accessModifier}} enum {{enumName}} { }{% endif %} 10 | #elseif os(iOS) || os(tvOS) || os(watchOS) 11 | import UIKit 12 | {% if enumName != 'UIColor' %}{{accessModifier}} enum {{enumName}} { }{% endif %} 13 | #endif 14 | 15 | // swiftlint:disable superfluous_disable_command 16 | // swiftlint:disable file_length 17 | 18 | // MARK: - Colors 19 | 20 | // swiftlint:disable identifier_name line_length type_body_length 21 | {{accessModifier}} extension {{enumName}} { 22 | {% macro h2f hex %}{{hex|hexToInt|int255toFloat}}{% endmacro %} 23 | {% macro enumBlock colors accessPrefix %} 24 | {% for color in colors %} 25 | /// 0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}} (r: {{color.red|hexToInt}}, g: {{color.green|hexToInt}}, b: {{color.blue|hexToInt}}, a: {{color.alpha|hexToInt}}) 26 | {{accessPrefix}}static let {{color.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = #colorLiteral(red: {% call h2f color.red %}, green: {% call h2f color.green %}, blue: {% call h2f color.blue %}, alpha: {% call h2f color.alpha %}) 27 | {% endfor %} 28 | {% endmacro %} 29 | {% if palettes.count > 1 or param.forceFileNameEnum %} 30 | {% set accessPrefix %}{{accessModifier}} {% endset %} 31 | {% for palette in palettes %} 32 | enum {{palette.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 33 | {% filter indent:2 %}{% call enumBlock palette.colors accessPrefix %}{% endfilter %} 34 | } 35 | {% endfor %} 36 | {% else %} 37 | {% call enumBlock palettes.first.colors "" %} 38 | {% endif %} 39 | } 40 | // swiftlint:enable identifier_name line_length type_body_length 41 | {% else %} 42 | // No color found 43 | {% endif %} 44 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/colors/literals-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if palettes %} 5 | {% set enumName %}{{param.enumName|default:"ColorName"}}{% endset %} 6 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 7 | #if os(OSX) 8 | import AppKit 9 | {% if enumName != 'NSColor' %}{{accessModifier}} enum {{enumName}} { }{% endif %} 10 | #elseif os(iOS) || os(tvOS) || os(watchOS) 11 | import UIKit 12 | {% if enumName != 'UIColor' %}{{accessModifier}} enum {{enumName}} { }{% endif %} 13 | #endif 14 | 15 | // swiftlint:disable superfluous_disable_command 16 | // swiftlint:disable file_length 17 | 18 | // MARK: - Colors 19 | 20 | // swiftlint:disable identifier_name line_length type_body_length 21 | {{accessModifier}} extension {{enumName}} { 22 | {% macro h2f hex %}{{hex|hexToInt|int255toFloat}}{% endmacro %} 23 | {% macro enumBlock colors accessPrefix %} 24 | {% for color in colors %} 25 | /// 0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}} (r: {{color.red|hexToInt}}, g: {{color.green|hexToInt}}, b: {{color.blue|hexToInt}}, a: {{color.alpha|hexToInt}}) 26 | {{accessPrefix}}static let {{color.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = #colorLiteral(red: {% call h2f color.red %}, green: {% call h2f color.green %}, blue: {% call h2f color.blue %}, alpha: {% call h2f color.alpha %}) 27 | {% endfor %} 28 | {% endmacro %} 29 | {% if palettes.count > 1 or param.forceFileNameEnum %} 30 | {% set accessPrefix %}{{accessModifier}} {% endset %} 31 | {% for palette in palettes %} 32 | enum {{palette.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 33 | {% filter indent:2 %}{% call enumBlock palette.colors accessPrefix %}{% endfilter %} 34 | } 35 | {% endfor %} 36 | {% else %} 37 | {% call enumBlock palettes.first.colors "" %} 38 | {% endif %} 39 | } 40 | // swiftlint:enable identifier_name line_length type_body_length 41 | {% else %} 42 | // No color found 43 | {% endif %} 44 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/colors/swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if palettes %} 5 | {% set colorAlias %}{{param.colorAliasName|default:"Color"}}{% endset %} 6 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 7 | #if os(OSX) 8 | import AppKit.NSColor 9 | {{accessModifier}} typealias {{colorAlias}} = NSColor 10 | #elseif os(iOS) || os(tvOS) || os(watchOS) 11 | import UIKit.UIColor 12 | {{accessModifier}} typealias {{colorAlias}} = UIColor 13 | #endif 14 | 15 | // swiftlint:disable superfluous_disable_command file_length implicit_return 16 | 17 | // MARK: - Colors 18 | 19 | // swiftlint:disable identifier_name line_length type_body_length 20 | {% set enumName %}{{param.enumName|default:"ColorName"}}{% endset %} 21 | {{accessModifier}} struct {{enumName}} { 22 | {{accessModifier}} let rgbaValue: UInt32 23 | {{accessModifier}} var color: {{colorAlias}} { return {{colorAlias}}(named: self) } 24 | 25 | {% macro rgbaValue color %}0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}}{% endmacro %} 26 | {% macro enumBlock colors %} 27 | {% for color in colors %} 28 | /// 29 | /// Alpha: {{color.alpha|hexToInt|int255toFloat|percent}}
(0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}}) 30 | {{accessModifier}} static let {{color.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}(rgbaValue: {% call rgbaValue color %}) 31 | {% endfor %} 32 | {% endmacro %} 33 | {% if palettes.count > 1 or param.forceFileNameEnum %} 34 | {% for palette in palettes %} 35 | {{accessModifier}} enum {{palette.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 36 | {% filter indent:2 %}{% call enumBlock palette.colors %}{% endfilter %} 37 | } 38 | {% endfor %} 39 | {% else %} 40 | {% call enumBlock palettes.first.colors %} 41 | {% endif %} 42 | } 43 | // swiftlint:enable identifier_name line_length type_body_length 44 | 45 | // MARK: - Implementation Details 46 | 47 | internal extension {{colorAlias}} { 48 | convenience init(rgbaValue: UInt32) { 49 | let components = RGBAComponents(rgbaValue: rgbaValue).normalized 50 | self.init(red: components[0], green: components[1], blue: components[2], alpha: components[3]) 51 | } 52 | } 53 | 54 | private struct RGBAComponents { 55 | let rgbaValue: UInt32 56 | 57 | private var shifts: [UInt32] { 58 | [ 59 | rgbaValue >> 24, // red 60 | rgbaValue >> 16, // green 61 | rgbaValue >> 8, // blue 62 | rgbaValue // alpha 63 | ] 64 | } 65 | 66 | private var components: [CGFloat] { 67 | shifts.map { 68 | CGFloat($0 & 0xff) 69 | } 70 | } 71 | 72 | var normalized: [CGFloat] { 73 | components.map { $0 / 255.0 } 74 | } 75 | } 76 | 77 | {{accessModifier}} extension {{colorAlias}} { 78 | convenience init(named color: {{enumName}}) { 79 | self.init(rgbaValue: color.rgbaValue) 80 | } 81 | } 82 | {% else %} 83 | // No color found 84 | {% endif %} 85 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/colors/swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if palettes %} 5 | {% set colorAlias %}{{param.colorAliasName|default:"Color"}}{% endset %} 6 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 7 | #if os(OSX) 8 | import AppKit.NSColor 9 | {{accessModifier}} typealias {{colorAlias}} = NSColor 10 | #elseif os(iOS) || os(tvOS) || os(watchOS) 11 | import UIKit.UIColor 12 | {{accessModifier}} typealias {{colorAlias}} = UIColor 13 | #endif 14 | 15 | // swiftlint:disable superfluous_disable_command file_length implicit_return 16 | 17 | // MARK: - Colors 18 | 19 | // swiftlint:disable identifier_name line_length type_body_length 20 | {% set enumName %}{{param.enumName|default:"ColorName"}}{% endset %} 21 | {{accessModifier}} struct {{enumName}} { 22 | {{accessModifier}} let rgbaValue: UInt32 23 | {{accessModifier}} var color: {{colorAlias}} { return {{colorAlias}}(named: self) } 24 | 25 | {% macro rgbaValue color %}0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}}{% endmacro %} 26 | {% macro enumBlock colors %} 27 | {% for color in colors %} 28 | /// 29 | /// Alpha: {{color.alpha|hexToInt|int255toFloat|percent}}
(0x{{color.red}}{{color.green}}{{color.blue}}{{color.alpha}}) 30 | {{accessModifier}} static let {{color.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}(rgbaValue: {% call rgbaValue color %}) 31 | {% endfor %} 32 | {% endmacro %} 33 | {% if palettes.count > 1 or param.forceFileNameEnum %} 34 | {% for palette in palettes %} 35 | {{accessModifier}} enum {{palette.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 36 | {% filter indent:2 %}{% call enumBlock palette.colors %}{% endfilter %} 37 | } 38 | {% endfor %} 39 | {% else %} 40 | {% call enumBlock palettes.first.colors %} 41 | {% endif %} 42 | } 43 | // swiftlint:enable identifier_name line_length type_body_length 44 | 45 | // MARK: - Implementation Details 46 | 47 | internal extension {{colorAlias}} { 48 | convenience init(rgbaValue: UInt32) { 49 | let components = RGBAComponents(rgbaValue: rgbaValue).normalized 50 | self.init(red: components[0], green: components[1], blue: components[2], alpha: components[3]) 51 | } 52 | } 53 | 54 | private struct RGBAComponents { 55 | let rgbaValue: UInt32 56 | 57 | private var shifts: [UInt32] { 58 | [ 59 | rgbaValue >> 24, // red 60 | rgbaValue >> 16, // green 61 | rgbaValue >> 8, // blue 62 | rgbaValue // alpha 63 | ] 64 | } 65 | 66 | private var components: [CGFloat] { 67 | shifts.map { 68 | CGFloat($0 & 0xff) 69 | } 70 | } 71 | 72 | var normalized: [CGFloat] { 73 | components.map { $0 / 255.0 } 74 | } 75 | } 76 | 77 | {{accessModifier}} extension {{colorAlias}} { 78 | convenience init(named color: {{enumName}}) { 79 | self.init(rgbaValue: color.rgbaValue) 80 | } 81 | } 82 | {% else %} 83 | // No color found 84 | {% endif %} 85 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/coredata/swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | // swiftlint:disable superfluous_disable_command implicit_return 5 | // swiftlint:disable sorted_imports 6 | import CoreData 7 | import Foundation 8 | {% for import in param.extraImports %} 9 | import {{ import }} 10 | {% empty %} 11 | {# If extraImports is a single String instead of an array, `for` considers it empty but we still have to check if there's a single String value #} 12 | {% if param.extraImports %}import {{ param.extraImports }}{% endif %} 13 | {% endfor %} 14 | 15 | // swiftlint:disable attributes file_length vertical_whitespace_closing_braces 16 | // swiftlint:disable identifier_name line_length type_body_length 17 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 18 | 19 | {% for model in models %} 20 | {% for name, entity in model.entities %} 21 | {% set superclass %}{{ model.entities[entity.superEntity].className|default:"NSManagedObject" }}{% endset %} 22 | {% set entityClassName %}{{ entity.className|default:"NSManagedObject" }}{% endset %} 23 | // MARK: - {{ entity.name }} 24 | 25 | {% if not entity.shouldGenerateCode %} 26 | // Note: '{{ entity.name }}' has codegen enabled for Xcode, skipping code generation. 27 | 28 | {% elif entityClassName|contains:"." %} 29 | // Warning: '{{ entityClassName }}' cannot be a valid type name, skipping code generation. 30 | 31 | {% else %} 32 | {% if param.generateObjcName %} 33 | @objc({{ entityClassName }}) 34 | {% endif %} 35 | {{ accessModifier }} class {{ entityClassName }}: {{ superclass }} { 36 | {% set override %}{% if superclass != "NSManagedObject" %}override {% endif %}{% endset %} 37 | {{ override }}{{ accessModifier }} class var entityName: String { 38 | return "{{ entity.name }}" 39 | } 40 | 41 | {{ override }}{{ accessModifier }} class func entity(in managedObjectContext: NSManagedObjectContext) -> NSEntityDescription? { 42 | return NSEntityDescription.entity(forEntityName: entityName, in: managedObjectContext) 43 | } 44 | 45 | @available(*, deprecated, renamed: "makeFetchRequest", message: "To avoid collisions with the less concrete method in `NSManagedObject`, please use `makeFetchRequest()` instead.") 46 | @nonobjc {{ accessModifier }} class func fetchRequest() -> NSFetchRequest<{{ entityClassName }}> { 47 | return NSFetchRequest<{{ entityClassName }}>(entityName: entityName) 48 | } 49 | 50 | @nonobjc {{ accessModifier }} class func makeFetchRequest() -> NSFetchRequest<{{ entityClassName }}> { 51 | return NSFetchRequest<{{ entityClassName }}>(entityName: entityName) 52 | } 53 | 54 | // swiftlint:disable discouraged_optional_boolean discouraged_optional_collection 55 | {% for attribute in entity.attributes %} 56 | {% if attribute.userInfo.RawType %} 57 | {% set rawType attribute.userInfo.RawType %} 58 | {% set unwrapOptional attribute.userInfo.unwrapOptional %} 59 | {{ accessModifier }} var {{ attribute.name }}: {{ rawType }}{% if not unwrapOptional %}?{% endif %} { 60 | get { 61 | let key = "{{ attribute.name }}" 62 | willAccessValue(forKey: key) 63 | defer { didAccessValue(forKey: key) } 64 | 65 | {% if unwrapOptional %} 66 | guard let value = primitiveValue(forKey: key) as? {{ rawType }}.RawValue, 67 | let result = {{ rawType }}(rawValue: value) else { 68 | fatalError("Could not convert value for key '\(key)' to type '{{ rawType }}'") 69 | } 70 | return result 71 | {% else %} 72 | guard let value = primitiveValue(forKey: key) as? {{ rawType }}.RawValue else { 73 | return nil 74 | } 75 | return {{ rawType }}(rawValue: value) 76 | {% endif %} 77 | } 78 | set { 79 | let key = "{{ attribute.name }}" 80 | willChangeValue(forKey: key) 81 | defer { didChangeValue(forKey: key) } 82 | 83 | setPrimitiveValue(newValue{% if not unwrapOptional %}?{% endif %}.rawValue, forKey: key) 84 | } 85 | } 86 | {% elif attribute.usesScalarValueType and attribute.isOptional %} 87 | {{ accessModifier }} var {{ attribute.name }}: {{ attribute.typeName }}? { 88 | get { 89 | let key = "{{ attribute.name }}" 90 | willAccessValue(forKey: key) 91 | defer { didAccessValue(forKey: key) } 92 | 93 | return primitiveValue(forKey: key) as? {{ attribute.typeName }} 94 | } 95 | set { 96 | let key = "{{ attribute.name }}" 97 | willChangeValue(forKey: key) 98 | defer { didChangeValue(forKey: key) } 99 | 100 | setPrimitiveValue(newValue, forKey: key) 101 | } 102 | } 103 | {% else %} 104 | @NSManaged {{ accessModifier }} var {{ attribute.name }}: {{ attribute.typeName }}{% if attribute.isOptional %}?{% endif %} 105 | {% endif %} 106 | {% endfor %} 107 | {% for relationship in entity.relationships %} 108 | {% if relationship.isToMany %} 109 | @NSManaged {{ accessModifier }} var {{ relationship.name }}: {% if relationship.isOrdered %}NSOrderedSet{% else %}Set<{{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}>{% endif %}{% if relationship.isOptional %}?{% endif %} 110 | {% else %} 111 | @NSManaged {{ accessModifier }} var {{ relationship.name }}: {{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}{% if relationship.isOptional %}?{% endif %} 112 | {% endif %} 113 | {% endfor %} 114 | {% for fetchedProperty in entity.fetchedProperties %} 115 | @NSManaged {{ accessModifier }} var {{ fetchedProperty.name }}: [{{ fetchedProperty.fetchRequest.entity }}] 116 | {% endfor %} 117 | // swiftlint:enable discouraged_optional_boolean discouraged_optional_collection 118 | } 119 | 120 | {% for relationship in entity.relationships where relationship.isToMany %} 121 | {% set destinationEntityClassName %}{{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}{% endset %} 122 | {% set collectionClassName %}{% if relationship.isOrdered %}NSOrderedSet{% else %}Set<{{ destinationEntityClassName }}>{% endif %}{% endset %} 123 | {% set relationshipName %}{{ relationship.name | upperFirstLetter }}{% endset %} 124 | // MARK: Relationship {{ relationshipName }} 125 | 126 | extension {{ entityClassName }} { 127 | {% if relationship.isOrdered %} 128 | @objc(insertObject:in{{ relationshipName }}AtIndex:) 129 | @NSManaged public func insertInto{{ relationshipName }}(_ value: {{ destinationEntityClassName }}, at idx: Int) 130 | 131 | @objc(removeObjectFrom{{ relationshipName }}AtIndex:) 132 | @NSManaged public func removeFrom{{ relationshipName }}(at idx: Int) 133 | 134 | @objc(insert{{ relationshipName }}:atIndexes:) 135 | @NSManaged public func insertInto{{ relationshipName }}(_ values: [{{ destinationEntityClassName }}], at indexes: NSIndexSet) 136 | 137 | @objc(remove{{ relationshipName }}AtIndexes:) 138 | @NSManaged public func removeFrom{{ relationshipName }}(at indexes: NSIndexSet) 139 | 140 | @objc(replaceObjectIn{{ relationshipName }}AtIndex:withObject:) 141 | @NSManaged public func replace{{ relationshipName }}(at idx: Int, with value: {{ destinationEntityClassName }}) 142 | 143 | @objc(replace{{ relationshipName }}AtIndexes:with{{ relationshipName }}:) 144 | @NSManaged public func replace{{ relationshipName }}(at indexes: NSIndexSet, with values: [{{ destinationEntityClassName }}]) 145 | 146 | {% endif %} 147 | @objc(add{{ relationshipName }}Object:) 148 | @NSManaged public func addTo{{ relationshipName }}(_ value: {{ destinationEntityClassName }}) 149 | 150 | @objc(remove{{ relationshipName }}Object:) 151 | @NSManaged public func removeFrom{{ relationshipName }}(_ value: {{ destinationEntityClassName }}) 152 | 153 | @objc(add{{ relationshipName }}:) 154 | @NSManaged public func addTo{{ relationshipName }}(_ values: {{ collectionClassName }}) 155 | 156 | @objc(remove{{ relationshipName }}:) 157 | @NSManaged public func removeFrom{{ relationshipName }}(_ values: {{ collectionClassName }}) 158 | } 159 | 160 | {% endfor %} 161 | {% if model.fetchRequests[entity.name].count > 0 %} 162 | // MARK: Fetch Requests 163 | 164 | extension {{ entityClassName }} { 165 | {% for fetchRequest in model.fetchRequests[entity.name] %} 166 | {% set resultTypeName %}{% filter removeNewlines:"leading" %} 167 | {% if fetchRequest.resultType == "Object" %} 168 | {{ entityClassName }} 169 | {% elif fetchRequest.resultType == "Object ID" %} 170 | NSManagedObjectID 171 | {% elif fetchRequest.resultType == "Dictionary" %} 172 | [String: Any] 173 | {% endif %} 174 | {% endfilter %}{% endset %} 175 | class func fetch{{ fetchRequest.name | upperFirstLetter }}({% filter removeNewlines:"leading" %} 176 | managedObjectContext: NSManagedObjectContext 177 | {% for variableName, variableType in fetchRequest.substitutionVariables %} 178 | , {{ variableName | lowerFirstWord }}: {{ variableType }} 179 | {% endfor %} 180 | {% endfilter %}) throws -> [{{ resultTypeName }}] { 181 | guard let persistentStoreCoordinator = managedObjectContext.persistentStoreCoordinator else { 182 | fatalError("Managed object context has no persistent store coordinator for getting fetch request templates") 183 | } 184 | let model = persistentStoreCoordinator.managedObjectModel 185 | let substitutionVariables: [String: Any] = [ 186 | {% for variableName, variableType in fetchRequest.substitutionVariables %} 187 | "{{ variableName }}": {{ variableName | lowerFirstWord }}{{ "," if not forloop.last }} 188 | {% empty %} 189 | : 190 | {% endfor %} 191 | ] 192 | 193 | guard let fetchRequest = model.fetchRequestFromTemplate(withName: "{{ fetchRequest.name }}", substitutionVariables: substitutionVariables) else { 194 | fatalError("No fetch request template named '{{ fetchRequest.name }}' found.") 195 | } 196 | 197 | guard let result = try managedObjectContext.fetch(fetchRequest) as? [{{ resultTypeName }}] else { 198 | fatalError("Unable to cast fetch result to correct result type.") 199 | } 200 | 201 | return result 202 | } 203 | 204 | {% endfor %} 205 | } 206 | 207 | {% endif %} 208 | {% endif %} 209 | {% endfor %} 210 | {% endfor %} 211 | // swiftlint:enable identifier_name line_length type_body_length 212 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/coredata/swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | // swiftlint:disable superfluous_disable_command implicit_return 5 | // swiftlint:disable sorted_imports 6 | import CoreData 7 | import Foundation 8 | {% for import in param.extraImports %} 9 | import {{ import }} 10 | {% empty %} 11 | {# If extraImports is a single String instead of an array, `for` considers it empty but we still have to check if there's a single String value #} 12 | {% if param.extraImports %}import {{ param.extraImports }}{% endif %} 13 | {% endfor %} 14 | 15 | // swiftlint:disable attributes file_length vertical_whitespace_closing_braces 16 | // swiftlint:disable identifier_name line_length type_body_length 17 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 18 | 19 | {% for model in models %} 20 | {% for name, entity in model.entities %} 21 | {% set superclass %}{{ model.entities[entity.superEntity].className|default:"NSManagedObject" }}{% endset %} 22 | {% set entityClassName %}{{ entity.className|default:"NSManagedObject" }}{% endset %} 23 | // MARK: - {{ entity.name }} 24 | 25 | {% if not entity.shouldGenerateCode %} 26 | // Note: '{{ entity.name }}' has codegen enabled for Xcode, skipping code generation. 27 | 28 | {% elif entityClassName|contains:"." %} 29 | // Warning: '{{ entityClassName }}' cannot be a valid type name, skipping code generation. 30 | 31 | {% else %} 32 | {% if param.generateObjcName %} 33 | @objc({{ entityClassName }}) 34 | {% endif %} 35 | {{ accessModifier }} class {{ entityClassName }}: {{ superclass }} { 36 | {% set override %}{% if superclass != "NSManagedObject" %}override {% endif %}{% endset %} 37 | {{ override }}{{ accessModifier }} class var entityName: String { 38 | return "{{ entity.name }}" 39 | } 40 | 41 | {{ override }}{{ accessModifier }} class func entity(in managedObjectContext: NSManagedObjectContext) -> NSEntityDescription? { 42 | return NSEntityDescription.entity(forEntityName: entityName, in: managedObjectContext) 43 | } 44 | 45 | @available(*, deprecated, renamed: "makeFetchRequest", message: "To avoid collisions with the less concrete method in `NSManagedObject`, please use `makeFetchRequest()` instead.") 46 | @nonobjc {{ accessModifier }} class func fetchRequest() -> NSFetchRequest<{{ entityClassName }}> { 47 | return NSFetchRequest<{{ entityClassName }}>(entityName: entityName) 48 | } 49 | 50 | @nonobjc {{ accessModifier }} class func makeFetchRequest() -> NSFetchRequest<{{ entityClassName }}> { 51 | return NSFetchRequest<{{ entityClassName }}>(entityName: entityName) 52 | } 53 | 54 | // swiftlint:disable discouraged_optional_boolean discouraged_optional_collection 55 | {% for attribute in entity.attributes %} 56 | {% if attribute.userInfo.RawType %} 57 | {% set rawType attribute.userInfo.RawType %} 58 | {% set unwrapOptional attribute.userInfo.unwrapOptional %} 59 | {{ accessModifier }} var {{ attribute.name }}: {{ rawType }}{% if not unwrapOptional %}?{% endif %} { 60 | get { 61 | let key = "{{ attribute.name }}" 62 | willAccessValue(forKey: key) 63 | defer { didAccessValue(forKey: key) } 64 | 65 | {% if unwrapOptional %} 66 | guard let value = primitiveValue(forKey: key) as? {{ rawType }}.RawValue, 67 | let result = {{ rawType }}(rawValue: value) else { 68 | fatalError("Could not convert value for key '\(key)' to type '{{ rawType }}'") 69 | } 70 | return result 71 | {% else %} 72 | guard let value = primitiveValue(forKey: key) as? {{ rawType }}.RawValue else { 73 | return nil 74 | } 75 | return {{ rawType }}(rawValue: value) 76 | {% endif %} 77 | } 78 | set { 79 | let key = "{{ attribute.name }}" 80 | willChangeValue(forKey: key) 81 | defer { didChangeValue(forKey: key) } 82 | 83 | setPrimitiveValue(newValue{% if not unwrapOptional %}?{% endif %}.rawValue, forKey: key) 84 | } 85 | } 86 | {% elif attribute.usesScalarValueType and attribute.isOptional %} 87 | {{ accessModifier }} var {{ attribute.name }}: {{ attribute.typeName }}? { 88 | get { 89 | let key = "{{ attribute.name }}" 90 | willAccessValue(forKey: key) 91 | defer { didAccessValue(forKey: key) } 92 | 93 | return primitiveValue(forKey: key) as? {{ attribute.typeName }} 94 | } 95 | set { 96 | let key = "{{ attribute.name }}" 97 | willChangeValue(forKey: key) 98 | defer { didChangeValue(forKey: key) } 99 | 100 | setPrimitiveValue(newValue, forKey: key) 101 | } 102 | } 103 | {% else %} 104 | @NSManaged {{ accessModifier }} var {{ attribute.name }}: {{ attribute.typeName }}{% if attribute.isOptional %}?{% endif %} 105 | {% endif %} 106 | {% endfor %} 107 | {% for relationship in entity.relationships %} 108 | {% if relationship.isToMany %} 109 | @NSManaged {{ accessModifier }} var {{ relationship.name }}: {% if relationship.isOrdered %}NSOrderedSet{% else %}Set<{{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}>{% endif %}{% if relationship.isOptional %}?{% endif %} 110 | {% else %} 111 | @NSManaged {{ accessModifier }} var {{ relationship.name }}: {{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}{% if relationship.isOptional %}?{% endif %} 112 | {% endif %} 113 | {% endfor %} 114 | {% for fetchedProperty in entity.fetchedProperties %} 115 | @NSManaged {{ accessModifier }} var {{ fetchedProperty.name }}: [{{ fetchedProperty.fetchRequest.entity }}] 116 | {% endfor %} 117 | // swiftlint:enable discouraged_optional_boolean discouraged_optional_collection 118 | } 119 | 120 | {% for relationship in entity.relationships where relationship.isToMany %} 121 | {% set destinationEntityClassName %}{{ model.entities[relationship.destinationEntity].className|default:"NSManagedObject" }}{% endset %} 122 | {% set collectionClassName %}{% if relationship.isOrdered %}NSOrderedSet{% else %}Set<{{ destinationEntityClassName }}>{% endif %}{% endset %} 123 | {% set relationshipName %}{{ relationship.name | upperFirstLetter }}{% endset %} 124 | // MARK: Relationship {{ relationshipName }} 125 | 126 | extension {{ entityClassName }} { 127 | {% if relationship.isOrdered %} 128 | @objc(insertObject:in{{ relationshipName }}AtIndex:) 129 | @NSManaged public func insertInto{{ relationshipName }}(_ value: {{ destinationEntityClassName }}, at idx: Int) 130 | 131 | @objc(removeObjectFrom{{ relationshipName }}AtIndex:) 132 | @NSManaged public func removeFrom{{ relationshipName }}(at idx: Int) 133 | 134 | @objc(insert{{ relationshipName }}:atIndexes:) 135 | @NSManaged public func insertInto{{ relationshipName }}(_ values: [{{ destinationEntityClassName }}], at indexes: NSIndexSet) 136 | 137 | @objc(remove{{ relationshipName }}AtIndexes:) 138 | @NSManaged public func removeFrom{{ relationshipName }}(at indexes: NSIndexSet) 139 | 140 | @objc(replaceObjectIn{{ relationshipName }}AtIndex:withObject:) 141 | @NSManaged public func replace{{ relationshipName }}(at idx: Int, with value: {{ destinationEntityClassName }}) 142 | 143 | @objc(replace{{ relationshipName }}AtIndexes:with{{ relationshipName }}:) 144 | @NSManaged public func replace{{ relationshipName }}(at indexes: NSIndexSet, with values: [{{ destinationEntityClassName }}]) 145 | 146 | {% endif %} 147 | @objc(add{{ relationshipName }}Object:) 148 | @NSManaged public func addTo{{ relationshipName }}(_ value: {{ destinationEntityClassName }}) 149 | 150 | @objc(remove{{ relationshipName }}Object:) 151 | @NSManaged public func removeFrom{{ relationshipName }}(_ value: {{ destinationEntityClassName }}) 152 | 153 | @objc(add{{ relationshipName }}:) 154 | @NSManaged public func addTo{{ relationshipName }}(_ values: {{ collectionClassName }}) 155 | 156 | @objc(remove{{ relationshipName }}:) 157 | @NSManaged public func removeFrom{{ relationshipName }}(_ values: {{ collectionClassName }}) 158 | } 159 | 160 | {% endfor %} 161 | {% if model.fetchRequests[entity.name].count > 0 %} 162 | // MARK: Fetch Requests 163 | 164 | extension {{ entityClassName }} { 165 | {% for fetchRequest in model.fetchRequests[entity.name] %} 166 | {% set resultTypeName %}{% filter removeNewlines:"leading" %} 167 | {% if fetchRequest.resultType == "Object" %} 168 | {{ entityClassName }} 169 | {% elif fetchRequest.resultType == "Object ID" %} 170 | NSManagedObjectID 171 | {% elif fetchRequest.resultType == "Dictionary" %} 172 | [String: Any] 173 | {% endif %} 174 | {% endfilter %}{% endset %} 175 | class func fetch{{ fetchRequest.name | upperFirstLetter }}({% filter removeNewlines:"leading" %} 176 | managedObjectContext: NSManagedObjectContext 177 | {% for variableName, variableType in fetchRequest.substitutionVariables %} 178 | , {{ variableName | lowerFirstWord }}: {{ variableType }} 179 | {% endfor %} 180 | {% endfilter %}) throws -> [{{ resultTypeName }}] { 181 | guard let persistentStoreCoordinator = managedObjectContext.persistentStoreCoordinator else { 182 | fatalError("Managed object context has no persistent store coordinator for getting fetch request templates") 183 | } 184 | let model = persistentStoreCoordinator.managedObjectModel 185 | let substitutionVariables: [String: Any] = [ 186 | {% for variableName, variableType in fetchRequest.substitutionVariables %} 187 | "{{ variableName }}": {{ variableName | lowerFirstWord }}{{ "," if not forloop.last }} 188 | {% empty %} 189 | : 190 | {% endfor %} 191 | ] 192 | 193 | guard let fetchRequest = model.fetchRequestFromTemplate(withName: "{{ fetchRequest.name }}", substitutionVariables: substitutionVariables) else { 194 | fatalError("No fetch request template named '{{ fetchRequest.name }}' found.") 195 | } 196 | 197 | guard let result = try managedObjectContext.fetch(fetchRequest) as? [{{ resultTypeName }}] else { 198 | fatalError("Unable to cast fetch result to correct result type.") 199 | } 200 | 201 | return result 202 | } 203 | 204 | {% endfor %} 205 | } 206 | 207 | {% endif %} 208 | {% endif %} 209 | {% endfor %} 210 | {% endfor %} 211 | // swiftlint:enable identifier_name line_length type_body_length 212 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/fonts/swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if families %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set fontType %}{{param.fontTypeName|default:"FontConvertible"}}{% endset %} 7 | #if os(OSX) 8 | import AppKit.NSFont 9 | #elseif os(iOS) || os(tvOS) || os(watchOS) 10 | import UIKit.UIFont 11 | #endif 12 | 13 | // Deprecated typealiases 14 | @available(*, deprecated, renamed: "{{fontType}}.Font", message: "This typealias will be removed in SwiftGen 7.0") 15 | {{accessModifier}} typealias {{param.fontAliasName|default:"Font"}} = {{fontType}}.Font 16 | 17 | // swiftlint:disable superfluous_disable_command 18 | // swiftlint:disable file_length 19 | // swiftlint:disable implicit_return 20 | 21 | // MARK: - Fonts 22 | 23 | // swiftlint:disable identifier_name line_length type_body_length 24 | {% macro transformPath path %}{% filter removeNewlines %} 25 | {% if param.preservePath %} 26 | {{path}} 27 | {% else %} 28 | {{path|basename}} 29 | {% endif %} 30 | {% endfilter %}{% endmacro %} 31 | {{accessModifier}} enum {{param.enumName|default:"FontFamily"}} { 32 | {% for family in families %} 33 | {{accessModifier}} enum {{family.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 34 | {% for font in family.fonts %} 35 | {{accessModifier}} static let {{font.style|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{fontType}}(name: "{{font.name}}", family: "{{family.name}}", path: "{% call transformPath font.path %}") 36 | {% endfor %} 37 | {{accessModifier}} static let all: [{{fontType}}] = [{% for font in family.fonts %}{{font.style|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{{ ", " if not forloop.last }}{% endfor %}] 38 | } 39 | {% endfor %} 40 | {{accessModifier}} static let allCustomFonts: [{{fontType}}] = [{% for family in families %}{{family.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}.all{{ ", " if not forloop.last }}{% endfor %}].flatMap { $0 } 41 | {{accessModifier}} static func registerAllCustomFonts() { 42 | allCustomFonts.forEach { $0.register() } 43 | } 44 | } 45 | // swiftlint:enable identifier_name line_length type_body_length 46 | 47 | // MARK: - Implementation Details 48 | 49 | {{accessModifier}} struct {{fontType}} { 50 | {{accessModifier}} let name: String 51 | {{accessModifier}} let family: String 52 | {{accessModifier}} let path: String 53 | 54 | #if os(OSX) 55 | {{accessModifier}} typealias Font = NSFont 56 | #elseif os(iOS) || os(tvOS) || os(watchOS) 57 | {{accessModifier}} typealias Font = UIFont 58 | #endif 59 | 60 | {{accessModifier}} func font(size: CGFloat) -> Font! { 61 | return Font(font: self, size: size) 62 | } 63 | 64 | {{accessModifier}} func register() { 65 | // swiftlint:disable:next conditional_returns_on_newline 66 | guard let url = url else { return } 67 | CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil) 68 | } 69 | 70 | fileprivate var url: URL? { 71 | {% if param.lookupFunction %} 72 | return {{param.lookupFunction}}(name, family, path) 73 | {% else %} 74 | return {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil) 75 | {% endif %} 76 | } 77 | } 78 | 79 | {{accessModifier}} extension {{fontType}}.Font { 80 | convenience init?(font: {{fontType}}, size: CGFloat) { 81 | #if os(iOS) || os(tvOS) || os(watchOS) 82 | if !UIFont.fontNames(forFamilyName: font.family).contains(font.name) { 83 | font.register() 84 | } 85 | #elseif os(OSX) 86 | if let url = font.url, CTFontManagerGetScopeForURL(url as CFURL) == .none { 87 | font.register() 88 | } 89 | #endif 90 | 91 | self.init(name: font.name, size: size) 92 | } 93 | } 94 | {% if not param.bundle and not param.lookupFunction %} 95 | 96 | // swiftlint:disable convenience_type 97 | private final class BundleToken { 98 | static let bundle: Bundle = { 99 | #if SWIFT_PACKAGE 100 | return Bundle.module 101 | #else 102 | return Bundle(for: BundleToken.self) 103 | #endif 104 | }() 105 | } 106 | // swiftlint:enable convenience_type 107 | {% endif %} 108 | {% else %} 109 | // No fonts found 110 | {% endif %} 111 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/fonts/swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if families %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set fontType %}{{param.fontTypeName|default:"FontConvertible"}}{% endset %} 7 | #if os(OSX) 8 | import AppKit.NSFont 9 | #elseif os(iOS) || os(tvOS) || os(watchOS) 10 | import UIKit.UIFont 11 | #endif 12 | 13 | // Deprecated typealiases 14 | @available(*, deprecated, renamed: "{{fontType}}.Font", message: "This typealias will be removed in SwiftGen 7.0") 15 | {{accessModifier}} typealias {{param.fontAliasName|default:"Font"}} = {{fontType}}.Font 16 | 17 | // swiftlint:disable superfluous_disable_command 18 | // swiftlint:disable file_length 19 | 20 | // MARK: - Fonts 21 | 22 | // swiftlint:disable identifier_name line_length type_body_length 23 | {% macro transformPath path %}{% filter removeNewlines %} 24 | {% if param.preservePath %} 25 | {{path}} 26 | {% else %} 27 | {{path|basename}} 28 | {% endif %} 29 | {% endfilter %}{% endmacro %} 30 | {{accessModifier}} enum {{param.enumName|default:"FontFamily"}} { 31 | {% for family in families %} 32 | {{accessModifier}} enum {{family.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 33 | {% for font in family.fonts %} 34 | {{accessModifier}} static let {{font.style|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{fontType}}(name: "{{font.name}}", family: "{{family.name}}", path: "{% call transformPath font.path %}") 35 | {% endfor %} 36 | {{accessModifier}} static let all: [{{fontType}}] = [{% for font in family.fonts %}{{font.style|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{{ ", " if not forloop.last }}{% endfor %}] 37 | } 38 | {% endfor %} 39 | {{accessModifier}} static let allCustomFonts: [{{fontType}}] = [{% for family in families %}{{family.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}.all{{ ", " if not forloop.last }}{% endfor %}].flatMap { $0 } 40 | {{accessModifier}} static func registerAllCustomFonts() { 41 | allCustomFonts.forEach { $0.register() } 42 | } 43 | } 44 | // swiftlint:enable identifier_name line_length type_body_length 45 | 46 | // MARK: - Implementation Details 47 | 48 | {{accessModifier}} struct {{fontType}} { 49 | {{accessModifier}} let name: String 50 | {{accessModifier}} let family: String 51 | {{accessModifier}} let path: String 52 | 53 | #if os(OSX) 54 | {{accessModifier}} typealias Font = NSFont 55 | #elseif os(iOS) || os(tvOS) || os(watchOS) 56 | {{accessModifier}} typealias Font = UIFont 57 | #endif 58 | 59 | {{accessModifier}} func font(size: CGFloat) -> Font { 60 | guard let font = Font(font: self, size: size) else { 61 | fatalError("Unable to initialize font '\(name)' (\(family))") 62 | } 63 | return font 64 | } 65 | 66 | {{accessModifier}} func register() { 67 | // swiftlint:disable:next conditional_returns_on_newline 68 | guard let url = url else { return } 69 | CTFontManagerRegisterFontsForURL(url as CFURL, .process, nil) 70 | } 71 | 72 | fileprivate var url: URL? { 73 | // swiftlint:disable:next implicit_return 74 | {% if param.lookupFunction %} 75 | return {{param.lookupFunction}}(name, family, path) 76 | {% else %} 77 | return {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil) 78 | {% endif %} 79 | } 80 | } 81 | 82 | {{accessModifier}} extension {{fontType}}.Font { 83 | convenience init?(font: {{fontType}}, size: CGFloat) { 84 | #if os(iOS) || os(tvOS) || os(watchOS) 85 | if !UIFont.fontNames(forFamilyName: font.family).contains(font.name) { 86 | font.register() 87 | } 88 | #elseif os(OSX) 89 | if let url = font.url, CTFontManagerGetScopeForURL(url as CFURL) == .none { 90 | font.register() 91 | } 92 | #endif 93 | 94 | self.init(name: font.name, size: size) 95 | } 96 | } 97 | {% if not param.bundle and not param.lookupFunction %} 98 | 99 | // swiftlint:disable convenience_type 100 | private final class BundleToken { 101 | static let bundle: Bundle = { 102 | #if SWIFT_PACKAGE 103 | return Bundle.module 104 | #else 105 | return Bundle(for: BundleToken.self) 106 | #endif 107 | }() 108 | } 109 | // swiftlint:enable convenience_type 110 | {% endif %} 111 | {% else %} 112 | // No fonts found 113 | {% endif %} 114 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/ib/scenes-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if platform and storyboards %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set isAppKit %}{% if platform == "macOS" %}true{% endif %}{% endset %} 7 | {% set prefix %}{% if isAppKit %}NS{% else %}UI{% endif %}{% endset %} 8 | {% set controller %}{% if isAppKit %}Controller{% else %}ViewController{% endif %}{% endset %} 9 | // swiftlint:disable sorted_imports 10 | import Foundation 11 | {% for module in modules where module != env.PRODUCT_MODULE_NAME and module != param.module %} 12 | import {{module}} 13 | {% endfor %} 14 | 15 | // swiftlint:disable superfluous_disable_command 16 | // swiftlint:disable file_length implicit_return 17 | 18 | // MARK: - Storyboard Scenes 19 | 20 | // swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name 21 | {% macro moduleName item %}{% filter removeNewlines %} 22 | {% if item.moduleIsPlaceholder %} 23 | {{ env.PRODUCT_MODULE_NAME|default:param.module }} 24 | {% else %} 25 | {{ item.module }} 26 | {% endif %} 27 | {% endfilter %}{% endmacro %} 28 | {% macro className item %}{% filter removeNewlines %} 29 | {% set module %}{% call moduleName item %}{% endset %} 30 | {% if module and ( not param.ignoreTargetModule or module != env.PRODUCT_MODULE_NAME and module != param.module ) %} 31 | {{module}}. 32 | {% endif %} 33 | {{item.type}} 34 | {% endfilter %}{% endmacro %} 35 | {{accessModifier}} enum {{param.enumName|default:"StoryboardScene"}} { 36 | {% for storyboard in storyboards %} 37 | {% set storyboardName %}{{storyboard.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}{% endset %} 38 | {{accessModifier}} enum {{storyboardName}}: StoryboardType { 39 | {{accessModifier}} static let storyboardName = "{{storyboard.name}}" 40 | {% if storyboard.initialScene %} 41 | 42 | {% set sceneClass %}{% call className storyboard.initialScene %}{% endset %} 43 | {{accessModifier}} static let initialScene = InitialSceneType<{{sceneClass}}>(storyboard: {{storyboardName}}.self) 44 | {% endif %} 45 | {% for scene in storyboard.scenes %} 46 | 47 | {% set sceneID %}{{scene.identifier|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 48 | {% set sceneClass %}{% call className scene %}{% endset %} 49 | {{accessModifier}} static let {{sceneID}} = SceneType<{{sceneClass}}>(storyboard: {{storyboardName}}.self, identifier: "{{scene.identifier}}") 50 | {% endfor %} 51 | } 52 | {% endfor %} 53 | } 54 | // swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name 55 | 56 | // MARK: - Implementation Details 57 | 58 | {{accessModifier}} protocol StoryboardType { 59 | static var storyboardName: String { get } 60 | } 61 | 62 | {{accessModifier}} extension StoryboardType { 63 | static var storyboard: {{prefix}}Storyboard { 64 | let name = {% if isAppKit %}NSStoryboard.Name({% endif %}self.storyboardName{% if isAppKit %}){% endif %} 65 | {% if param.lookupFunction %} 66 | return {{param.lookupFunction}}(name) 67 | {% else %} 68 | return {{prefix}}Storyboard(name: name, bundle: {{param.bundle|default:"BundleToken.bundle"}}) 69 | {% endif %} 70 | } 71 | } 72 | 73 | {{accessModifier}} struct SceneType { 74 | {{accessModifier}} let storyboard: StoryboardType.Type 75 | {{accessModifier}} let identifier: String 76 | 77 | {{accessModifier}} func instantiate() -> T { 78 | let identifier = {% if isAppKit %}NSStoryboard.SceneIdentifier({% endif %}self.identifier{% if isAppKit %}){% endif %} 79 | guard let controller = storyboard.storyboard.instantiate{{controller}}(withIdentifier: identifier) as? T else { 80 | fatalError("{{controller}} '\(identifier)' is not of the expected class \(T.self).") 81 | } 82 | return controller 83 | } 84 | 85 | {% if isAppKit %} 86 | @available(macOS 10.15, *) 87 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSViewController { 88 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 89 | } 90 | 91 | @available(macOS 10.15, *) 92 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSWindowController { 93 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 94 | } 95 | {% else %} 96 | @available(iOS 13.0, tvOS 13.0, *) 97 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T { 98 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 99 | } 100 | {% endif %} 101 | } 102 | 103 | {{accessModifier}} struct InitialSceneType { 104 | {{accessModifier}} let storyboard: StoryboardType.Type 105 | 106 | {{accessModifier}} func instantiate() -> T { 107 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}() as? T else { 108 | fatalError("{{controller}} is not of the expected class \(T.self).") 109 | } 110 | return controller 111 | } 112 | 113 | {% if isAppKit %} 114 | @available(macOS 10.15, *) 115 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSViewController { 116 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 117 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 118 | } 119 | return controller 120 | } 121 | 122 | @available(macOS 10.15, *) 123 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSWindowController { 124 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 125 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 126 | } 127 | return controller 128 | } 129 | {% else %} 130 | @available(iOS 13.0, tvOS 13.0, *) 131 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T { 132 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 133 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 134 | } 135 | return controller 136 | } 137 | {% endif %} 138 | } 139 | {% if not param.bundle and not param.lookupFunction %} 140 | 141 | // swiftlint:disable convenience_type 142 | private final class BundleToken { 143 | static let bundle: Bundle = { 144 | #if SWIFT_PACKAGE 145 | return Bundle.module 146 | #else 147 | return Bundle(for: BundleToken.self) 148 | #endif 149 | }() 150 | } 151 | // swiftlint:enable convenience_type 152 | {% endif %} 153 | {% elif storyboards %} 154 | // Mixed AppKit and UIKit storyboard files found, please invoke swiftgen with these separately 155 | {% else %} 156 | // No storyboard found 157 | {% endif %} 158 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/ib/scenes-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if platform and storyboards %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set isAppKit %}{% if platform == "macOS" %}true{% endif %}{% endset %} 7 | {% set prefix %}{% if isAppKit %}NS{% else %}UI{% endif %}{% endset %} 8 | {% set controller %}{% if isAppKit %}Controller{% else %}ViewController{% endif %}{% endset %} 9 | // swiftlint:disable sorted_imports 10 | import Foundation 11 | {% for module in modules where module != env.PRODUCT_MODULE_NAME and module != param.module %} 12 | import {{module}} 13 | {% endfor %} 14 | 15 | // swiftlint:disable superfluous_disable_command 16 | // swiftlint:disable file_length implicit_return 17 | 18 | // MARK: - Storyboard Scenes 19 | 20 | // swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name 21 | {% macro moduleName item %}{% filter removeNewlines %} 22 | {% if item.moduleIsPlaceholder %} 23 | {{ env.PRODUCT_MODULE_NAME|default:param.module }} 24 | {% else %} 25 | {{ item.module }} 26 | {% endif %} 27 | {% endfilter %}{% endmacro %} 28 | {% macro className item %}{% filter removeNewlines %} 29 | {% set module %}{% call moduleName item %}{% endset %} 30 | {% if module and ( not param.ignoreTargetModule or module != env.PRODUCT_MODULE_NAME and module != param.module ) %} 31 | {{module}}. 32 | {% endif %} 33 | {{item.type}} 34 | {% endfilter %}{% endmacro %} 35 | {{accessModifier}} enum {{param.enumName|default:"StoryboardScene"}} { 36 | {% for storyboard in storyboards %} 37 | {% set storyboardName %}{{storyboard.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}{% endset %} 38 | {{accessModifier}} enum {{storyboardName}}: StoryboardType { 39 | {{accessModifier}} static let storyboardName = "{{storyboard.name}}" 40 | {% if storyboard.initialScene %} 41 | 42 | {% set sceneClass %}{% call className storyboard.initialScene %}{% endset %} 43 | {{accessModifier}} static let initialScene = InitialSceneType<{{sceneClass}}>(storyboard: {{storyboardName}}.self) 44 | {% endif %} 45 | {% for scene in storyboard.scenes %} 46 | 47 | {% set sceneID %}{{scene.identifier|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 48 | {% set sceneClass %}{% call className scene %}{% endset %} 49 | {{accessModifier}} static let {{sceneID}} = SceneType<{{sceneClass}}>(storyboard: {{storyboardName}}.self, identifier: "{{scene.identifier}}") 50 | {% endfor %} 51 | } 52 | {% endfor %} 53 | } 54 | // swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name 55 | 56 | // MARK: - Implementation Details 57 | 58 | {{accessModifier}} protocol StoryboardType { 59 | static var storyboardName: String { get } 60 | } 61 | 62 | {{accessModifier}} extension StoryboardType { 63 | static var storyboard: {{prefix}}Storyboard { 64 | let name = {% if isAppKit %}NSStoryboard.Name({% endif %}self.storyboardName{% if isAppKit %}){% endif %} 65 | {% if param.lookupFunction %} 66 | return {{param.lookupFunction}}(name) 67 | {% else %} 68 | return {{prefix}}Storyboard(name: name, bundle: {{param.bundle|default:"BundleToken.bundle"}}) 69 | {% endif %} 70 | } 71 | } 72 | 73 | {{accessModifier}} struct SceneType { 74 | {{accessModifier}} let storyboard: StoryboardType.Type 75 | {{accessModifier}} let identifier: String 76 | 77 | {{accessModifier}} func instantiate() -> T { 78 | let identifier = {% if isAppKit %}NSStoryboard.SceneIdentifier({% endif %}self.identifier{% if isAppKit %}){% endif %} 79 | guard let controller = storyboard.storyboard.instantiate{{controller}}(withIdentifier: identifier) as? T else { 80 | fatalError("{{controller}} '\(identifier)' is not of the expected class \(T.self).") 81 | } 82 | return controller 83 | } 84 | 85 | {% if isAppKit %} 86 | @available(macOS 10.15, *) 87 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSViewController { 88 | let identifier = NSStoryboard.SceneIdentifier(self.identifier) 89 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 90 | } 91 | 92 | @available(macOS 10.15, *) 93 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSWindowController { 94 | let identifier = NSStoryboard.SceneIdentifier(self.identifier) 95 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 96 | } 97 | {% else %} 98 | @available(iOS 13.0, tvOS 13.0, *) 99 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T { 100 | return storyboard.storyboard.instantiate{{controller}}(identifier: identifier, creator: block) 101 | } 102 | {% endif %} 103 | } 104 | 105 | {{accessModifier}} struct InitialSceneType { 106 | {{accessModifier}} let storyboard: StoryboardType.Type 107 | 108 | {{accessModifier}} func instantiate() -> T { 109 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}() as? T else { 110 | fatalError("{{controller}} is not of the expected class \(T.self).") 111 | } 112 | return controller 113 | } 114 | 115 | {% if isAppKit %} 116 | @available(macOS 10.15, *) 117 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSViewController { 118 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 119 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 120 | } 121 | return controller 122 | } 123 | 124 | @available(macOS 10.15, *) 125 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T where T: NSWindowController { 126 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 127 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 128 | } 129 | return controller 130 | } 131 | {% else %} 132 | @available(iOS 13.0, tvOS 13.0, *) 133 | {{accessModifier}} func instantiate(creator block: @escaping (NSCoder) -> T?) -> T { 134 | guard let controller = storyboard.storyboard.instantiateInitial{{controller}}(creator: block) else { 135 | fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.") 136 | } 137 | return controller 138 | } 139 | {% endif %} 140 | } 141 | {% if not param.bundle and not param.lookupFunction %} 142 | 143 | // swiftlint:disable convenience_type 144 | private final class BundleToken { 145 | static let bundle: Bundle = { 146 | #if SWIFT_PACKAGE 147 | return Bundle.module 148 | #else 149 | return Bundle(for: BundleToken.self) 150 | #endif 151 | }() 152 | } 153 | // swiftlint:enable convenience_type 154 | {% endif %} 155 | {% elif storyboards %} 156 | // Mixed AppKit and UIKit storyboard files found, please invoke swiftgen with these separately 157 | {% else %} 158 | // No storyboard found 159 | {% endif %} 160 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/ib/segues-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if platform and storyboards %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set isAppKit %}{% if platform == "macOS" %}true{% endif %}{% endset %} 7 | // swiftlint:disable sorted_imports 8 | import Foundation 9 | {% for module in modules where module != env.PRODUCT_MODULE_NAME and module != param.module %} 10 | import {{module}} 11 | {% endfor %} 12 | 13 | // swiftlint:disable superfluous_disable_command 14 | // swiftlint:disable file_length 15 | 16 | // MARK: - Storyboard Segues 17 | 18 | // swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name 19 | {{accessModifier}} enum {{param.enumName|default:"StoryboardSegue"}} { 20 | {% for storyboard in storyboards where storyboard.segues %} 21 | {{accessModifier}} enum {{storyboard.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}: String, SegueType { 22 | {% for segue in storyboard.segues %} 23 | {% set segueID %}{{segue.identifier|swiftIdentifier:"pretty"|lowerFirstWord}}{% endset %} 24 | case {{segueID|escapeReservedKeywords}}{% if segueID != segue.identifier %} = "{{segue.identifier}}"{% endif %} 25 | {% endfor %} 26 | } 27 | {% endfor %} 28 | } 29 | // swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name 30 | 31 | // MARK: - Implementation Details 32 | 33 | {{accessModifier}} protocol SegueType: RawRepresentable {} 34 | 35 | {{accessModifier}} extension {% if isAppKit %}NSSeguePerforming{% else %}UIViewController{% endif %} { 36 | func perform(segue: S, sender: Any? = nil) where S.RawValue == String { 37 | let identifier = {% if isAppKit %}NSStoryboardSegue.Identifier({% endif %}segue.rawValue{% if isAppKit %}){% endif %} 38 | performSegue{% if isAppKit %}?{% endif %}(withIdentifier: identifier, sender: sender) 39 | } 40 | } 41 | 42 | {{accessModifier}} extension SegueType where RawValue == String { 43 | init?(_ segue: {% if isAppKit %}NS{% else %}UI{% endif %}StoryboardSegue) { 44 | {% if isAppKit %} 45 | #if swift(>=4.2) 46 | guard let identifier = segue.identifier else { return nil } 47 | #else 48 | guard let identifier = segue.identifier?.rawValue else { return nil } 49 | #endif 50 | {% else %} 51 | guard let identifier = segue.identifier else { return nil } 52 | {% endif %} 53 | self.init(rawValue: identifier) 54 | } 55 | } 56 | {% elif storyboards %} 57 | // Mixed AppKit and UIKit storyboard files found, please invoke swiftgen with these separately 58 | {% else %} 59 | // No storyboard found 60 | {% endif %} 61 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/ib/segues-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if platform and storyboards %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set isAppKit %}{% if platform == "macOS" %}true{% endif %}{% endset %} 7 | // swiftlint:disable sorted_imports 8 | import Foundation 9 | {% for module in modules where module != env.PRODUCT_MODULE_NAME and module != param.module %} 10 | import {{module}} 11 | {% endfor %} 12 | 13 | // swiftlint:disable superfluous_disable_command 14 | // swiftlint:disable file_length 15 | 16 | // MARK: - Storyboard Segues 17 | 18 | // swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name 19 | {{accessModifier}} enum {{param.enumName|default:"StoryboardSegue"}} { 20 | {% for storyboard in storyboards where storyboard.segues %} 21 | {{accessModifier}} enum {{storyboard.name|swiftIdentifier:"pretty"|escapeReservedKeywords}}: String, SegueType { 22 | {% for segue in storyboard.segues %} 23 | {% set segueID %}{{segue.identifier|swiftIdentifier:"pretty"|lowerFirstWord}}{% endset %} 24 | case {{segueID|escapeReservedKeywords}}{% if segueID != segue.identifier %} = "{{segue.identifier}}"{% endif %} 25 | {% endfor %} 26 | } 27 | {% endfor %} 28 | } 29 | // swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name 30 | 31 | // MARK: - Implementation Details 32 | 33 | {{accessModifier}} protocol SegueType: RawRepresentable {} 34 | 35 | {{accessModifier}} extension {% if isAppKit %}NSSeguePerforming{% else %}UIViewController{% endif %} { 36 | func perform(segue: S, sender: Any? = nil) where S.RawValue == String { 37 | let identifier = {% if isAppKit %}NSStoryboardSegue.Identifier({% endif %}segue.rawValue{% if isAppKit %}){% endif %} 38 | performSegue{% if isAppKit %}?{% endif %}(withIdentifier: identifier, sender: sender) 39 | } 40 | } 41 | 42 | {{accessModifier}} extension SegueType where RawValue == String { 43 | init?(_ segue: {% if isAppKit %}NS{% else %}UI{% endif %}StoryboardSegue) { 44 | {% if isAppKit %} 45 | #if swift(>=4.2) 46 | guard let identifier = segue.identifier else { return nil } 47 | #else 48 | guard let identifier = segue.identifier?.rawValue else { return nil } 49 | #endif 50 | {% else %} 51 | guard let identifier = segue.identifier else { return nil } 52 | {% endif %} 53 | self.init(rawValue: identifier) 54 | } 55 | } 56 | {% elif storyboards %} 57 | // Mixed AppKit and UIKit storyboard files found, please invoke swiftgen with these separately 58 | {% else %} 59 | // No storyboard found 60 | {% endif %} 61 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/json/inline-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - JSON Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 19 | {% elif document.metadata.type == "Dictionary" %} 20 | {% for key,value in document.metadata.properties %} 21 | {{accessModifier}} {% call propertyBlock key value document.data %} 22 | {% endfor %} 23 | {% else %} 24 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 25 | {% endif %} 26 | {% endmacro %} 27 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 28 | {% if metadata.type == "Array" %} 29 | [{% call typeBlock metadata.element %}] 30 | {% elif metadata.type == "Dictionary" %} 31 | [String: Any] 32 | {% elif metadata.type == "Optional" %} 33 | Any? 34 | {% else %} 35 | {{metadata.type}} 36 | {% endif %} 37 | {% endfilter %}{% endmacro %} 38 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 39 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 40 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 41 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 42 | {% endfilter %}{% endmacro %} 43 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 44 | {% if metadata.type == "String" %} 45 | "{{ value }}" 46 | {% elif metadata.type == "Optional" %} 47 | nil 48 | {% elif metadata.type == "Array" and value %} 49 | [{% for value in value %} 50 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 51 | {{ ", " if not forloop.last }} 52 | {% endfor %}] 53 | {% elif metadata.type == "Dictionary" %} 54 | [{% for key,value in value %} 55 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 56 | {{ ", " if not forloop.last }} 57 | {% empty %} 58 | : 59 | {% endfor %}] 60 | {% elif metadata.type == "Bool" %} 61 | {% if value %}true{% else %}false{% endif %} 62 | {% else %} 63 | {{ value }} 64 | {% endif %} 65 | {% endfilter %}{% endmacro %} 66 | 67 | // swiftlint:disable identifier_name line_length number_separator type_body_length 68 | {{accessModifier}} enum {{param.enumName|default:"JSONFiles"}} { 69 | {% if files.count > 1 or param.forceFileNameEnum %} 70 | {% for file in files %} 71 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 72 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 73 | } 74 | {% endfor %} 75 | {% else %} 76 | {% call fileBlock files.first %} 77 | {% endif %} 78 | } 79 | // swiftlint:enable identifier_name line_length number_separator type_body_length 80 | {% else %} 81 | // No files found 82 | {% endif %} 83 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/json/inline-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - JSON Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 19 | {% elif document.metadata.type == "Dictionary" %} 20 | {% for key,value in document.metadata.properties %} 21 | {{accessModifier}} {% call propertyBlock key value document.data %} 22 | {% endfor %} 23 | {% else %} 24 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 25 | {% endif %} 26 | {% endmacro %} 27 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 28 | {% if metadata.type == "Array" %} 29 | [{% call typeBlock metadata.element %}] 30 | {% elif metadata.type == "Dictionary" %} 31 | [String: Any] 32 | {% elif metadata.type == "Optional" %} 33 | Any? 34 | {% else %} 35 | {{metadata.type}} 36 | {% endif %} 37 | {% endfilter %}{% endmacro %} 38 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 39 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 40 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 41 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 42 | {% endfilter %}{% endmacro %} 43 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 44 | {% if metadata.type == "String" %} 45 | "{{ value }}" 46 | {% elif metadata.type == "Optional" %} 47 | nil 48 | {% elif metadata.type == "Array" and value %} 49 | [{% for value in value %} 50 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 51 | {{ ", " if not forloop.last }} 52 | {% endfor %}] 53 | {% elif metadata.type == "Dictionary" %} 54 | [{% for key,value in value %} 55 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 56 | {{ ", " if not forloop.last }} 57 | {% empty %} 58 | : 59 | {% endfor %}] 60 | {% elif metadata.type == "Bool" %} 61 | {% if value %}true{% else %}false{% endif %} 62 | {% else %} 63 | {{ value }} 64 | {% endif %} 65 | {% endfilter %}{% endmacro %} 66 | 67 | // swiftlint:disable identifier_name line_length number_separator type_body_length 68 | {{accessModifier}} enum {{param.enumName|default:"JSONFiles"}} { 69 | {% if files.count > 1 or param.forceFileNameEnum %} 70 | {% for file in files %} 71 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 72 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 73 | } 74 | {% endfor %} 75 | {% else %} 76 | {% call fileBlock files.first %} 77 | {% endif %} 78 | } 79 | // swiftlint:enable identifier_name line_length number_separator type_body_length 80 | {% else %} 81 | // No files found 82 | {% endif %} 83 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/json/runtime-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - JSON Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = objectFromJSON(at: "{% call transformPath file.path %}") 19 | {% elif document.metadata.type == "Dictionary" %} 20 | private static let _document = JSONDocument(path: "{% call transformPath file.path %}") 21 | 22 | {% for key,value in document.metadata.properties %} 23 | {{accessModifier}} {% call propertyBlock key value %} 24 | {% endfor %} 25 | {% else %} 26 | {{accessModifier}} static let value: {{rootType}} = objectFromJSON(at: "{% call transformPath file.path %}") 27 | {% endif %} 28 | {% endmacro %} 29 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 30 | {% if metadata.type == "Array" %} 31 | [{% call typeBlock metadata.element %}] 32 | {% elif metadata.type == "Dictionary" %} 33 | [String: Any] 34 | {% elif metadata.type == "Optional" %} 35 | Any? 36 | {% else %} 37 | {{metadata.type}} 38 | {% endif %} 39 | {% endfilter %}{% endmacro %} 40 | {% macro propertyBlock key metadata %}{% filter removeNewlines:"leading" %} 41 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 42 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 43 | static let {{propertyName}}: {{propertyType}} = _document["{{key}}"] 44 | {% endfilter %}{% endmacro %} 45 | {% macro transformPath path %}{% filter removeNewlines %} 46 | {% if param.preservePath %} 47 | {{path}} 48 | {% else %} 49 | {{path|basename}} 50 | {% endif %} 51 | {% endfilter %}{% endmacro %} 52 | 53 | // swiftlint:disable identifier_name line_length type_body_length 54 | {{accessModifier}} enum {{param.enumName|default:"JSONFiles"}} { 55 | {% if files.count > 1 or param.forceFileNameEnum %} 56 | {% for file in files %} 57 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 58 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 59 | } 60 | {% endfor %} 61 | {% else %} 62 | {% call fileBlock files.first %} 63 | {% endif %} 64 | } 65 | // swiftlint:enable identifier_name line_length type_body_length 66 | 67 | // MARK: - Implementation Details 68 | 69 | private func objectFromJSON(at path: String) -> T { 70 | {% if param.lookupFunction %} 71 | guard let url = {{param.lookupFunction}}(path), 72 | {% else %} 73 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 74 | {% endif %} 75 | let json = try? JSONSerialization.jsonObject(with: Data(contentsOf: url), options: []), 76 | let result = json as? T else { 77 | fatalError("Unable to load JSON at path: \(path)") 78 | } 79 | return result 80 | } 81 | 82 | private struct JSONDocument { 83 | let data: [String: Any] 84 | 85 | init(path: String) { 86 | self.data = objectFromJSON(at: path) 87 | } 88 | 89 | subscript(key: String) -> T { 90 | guard let result = data[key] as? T else { 91 | fatalError("Property '\(key)' is not of type \(T.self)") 92 | } 93 | return result 94 | } 95 | } 96 | {% if not param.bundle and not param.lookupFunction %} 97 | 98 | // swiftlint:disable convenience_type 99 | private final class BundleToken { 100 | static let bundle: Bundle = { 101 | #if SWIFT_PACKAGE 102 | return Bundle.module 103 | #else 104 | return Bundle(for: BundleToken.self) 105 | #endif 106 | }() 107 | } 108 | // swiftlint:enable convenience_type 109 | {% endif %} 110 | {% else %} 111 | // No files found 112 | {% endif %} 113 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/json/runtime-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - JSON Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = objectFromJSON(at: "{% call transformPath file.path %}") 19 | {% elif document.metadata.type == "Dictionary" %} 20 | private static let _document = JSONDocument(path: "{% call transformPath file.path %}") 21 | 22 | {% for key,value in document.metadata.properties %} 23 | {{accessModifier}} {% call propertyBlock key value %} 24 | {% endfor %} 25 | {% else %} 26 | {{accessModifier}} static let value: {{rootType}} = objectFromJSON(at: "{% call transformPath file.path %}") 27 | {% endif %} 28 | {% endmacro %} 29 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 30 | {% if metadata.type == "Array" %} 31 | [{% call typeBlock metadata.element %}] 32 | {% elif metadata.type == "Dictionary" %} 33 | [String: Any] 34 | {% elif metadata.type == "Optional" %} 35 | Any? 36 | {% else %} 37 | {{metadata.type}} 38 | {% endif %} 39 | {% endfilter %}{% endmacro %} 40 | {% macro propertyBlock key metadata %}{% filter removeNewlines:"leading" %} 41 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 42 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 43 | static let {{propertyName}}: {{propertyType}} = _document["{{key}}"] 44 | {% endfilter %}{% endmacro %} 45 | {% macro transformPath path %}{% filter removeNewlines %} 46 | {% if param.preservePath %} 47 | {{path}} 48 | {% else %} 49 | {{path|basename}} 50 | {% endif %} 51 | {% endfilter %}{% endmacro %} 52 | 53 | // swiftlint:disable identifier_name line_length type_body_length 54 | {{accessModifier}} enum {{param.enumName|default:"JSONFiles"}} { 55 | {% if files.count > 1 or param.forceFileNameEnum %} 56 | {% for file in files %} 57 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 58 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 59 | } 60 | {% endfor %} 61 | {% else %} 62 | {% call fileBlock files.first %} 63 | {% endif %} 64 | } 65 | // swiftlint:enable identifier_name line_length type_body_length 66 | 67 | // MARK: - Implementation Details 68 | 69 | private func objectFromJSON(at path: String) -> T { 70 | {% if param.lookupFunction %} 71 | guard let url = {{param.lookupFunction}}(path), 72 | {% else %} 73 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 74 | {% endif %} 75 | let json = try? JSONSerialization.jsonObject(with: Data(contentsOf: url), options: []), 76 | let result = json as? T else { 77 | fatalError("Unable to load JSON at path: \(path)") 78 | } 79 | return result 80 | } 81 | 82 | private struct JSONDocument { 83 | let data: [String: Any] 84 | 85 | init(path: String) { 86 | self.data = objectFromJSON(at: path) 87 | } 88 | 89 | subscript(key: String) -> T { 90 | guard let result = data[key] as? T else { 91 | fatalError("Property '\(key)' is not of type \(T.self)") 92 | } 93 | return result 94 | } 95 | } 96 | {% if not param.bundle and not param.lookupFunction %} 97 | 98 | // swiftlint:disable convenience_type 99 | private final class BundleToken { 100 | static let bundle: Bundle = { 101 | #if SWIFT_PACKAGE 102 | return Bundle.module 103 | #else 104 | return Bundle(for: BundleToken.self) 105 | #endif 106 | }() 107 | } 108 | // swiftlint:enable convenience_type 109 | {% endif %} 110 | {% else %} 111 | // No files found 112 | {% endif %} 113 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/plist/inline-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - Plist Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 19 | {% elif document.metadata.type == "Dictionary" %} 20 | {% for key,value in document.metadata.properties %} 21 | {{accessModifier}} {% call propertyBlock key value document.data %} 22 | {% endfor %} 23 | {% else %} 24 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 25 | {% endif %} 26 | {% endmacro %} 27 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 28 | {% if metadata.type == "Array" %} 29 | [{% call typeBlock metadata.element %}] 30 | {% elif metadata.type == "Dictionary" %} 31 | [String: Any] 32 | {% else %} 33 | {{metadata.type}} 34 | {% endif %} 35 | {% endfilter %}{% endmacro %} 36 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 37 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 38 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 39 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 40 | {% endfilter %}{% endmacro %} 41 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 42 | {% if metadata.type == "String" %} 43 | "{{ value }}" 44 | {% elif metadata.type == "Date" %} 45 | Date(timeIntervalSinceReferenceDate: {{ value.timeIntervalSinceReferenceDate }}) 46 | {% elif metadata.type == "Optional" %} 47 | nil 48 | {% elif metadata.type == "Array" and value %} 49 | [{% for value in value %} 50 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 51 | {{ ", " if not forloop.last }} 52 | {% endfor %}] 53 | {% elif metadata.type == "Dictionary" %} 54 | [{% for key,value in value %} 55 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 56 | {{ ", " if not forloop.last }} 57 | {% empty %} 58 | : 59 | {% endfor %}] 60 | {% elif metadata.type == "Bool" %} 61 | {% if value %}true{% else %}false{% endif %} 62 | {% else %} 63 | {{ value }} 64 | {% endif %} 65 | {% endfilter %}{% endmacro %} 66 | 67 | // swiftlint:disable identifier_name line_length number_separator type_body_length 68 | {{accessModifier}} enum {{param.enumName|default:"PlistFiles"}} { 69 | {% if files.count > 1 or param.forceFileNameEnum %} 70 | {% for file in files %} 71 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 72 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 73 | } 74 | {% endfor %} 75 | {% else %} 76 | {% call fileBlock files.first %} 77 | {% endif %} 78 | } 79 | // swiftlint:enable identifier_name line_length number_separator type_body_length 80 | {% else %} 81 | // No files found 82 | {% endif %} 83 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/plist/inline-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - Plist Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 19 | {% elif document.metadata.type == "Dictionary" %} 20 | {% for key,value in document.metadata.properties %} 21 | {{accessModifier}} {% call propertyBlock key value document.data %} 22 | {% endfor %} 23 | {% else %} 24 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 25 | {% endif %} 26 | {% endmacro %} 27 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 28 | {% if metadata.type == "Array" %} 29 | [{% call typeBlock metadata.element %}] 30 | {% elif metadata.type == "Dictionary" %} 31 | [String: Any] 32 | {% else %} 33 | {{metadata.type}} 34 | {% endif %} 35 | {% endfilter %}{% endmacro %} 36 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 37 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 38 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 39 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 40 | {% endfilter %}{% endmacro %} 41 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 42 | {% if metadata.type == "String" %} 43 | "{{ value }}" 44 | {% elif metadata.type == "Date" %} 45 | Date(timeIntervalSinceReferenceDate: {{ value.timeIntervalSinceReferenceDate }}) 46 | {% elif metadata.type == "Optional" %} 47 | nil 48 | {% elif metadata.type == "Array" and value %} 49 | [{% for value in value %} 50 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 51 | {{ ", " if not forloop.last }} 52 | {% endfor %}] 53 | {% elif metadata.type == "Dictionary" %} 54 | [{% for key,value in value %} 55 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 56 | {{ ", " if not forloop.last }} 57 | {% empty %} 58 | : 59 | {% endfor %}] 60 | {% elif metadata.type == "Bool" %} 61 | {% if value %}true{% else %}false{% endif %} 62 | {% else %} 63 | {{ value }} 64 | {% endif %} 65 | {% endfilter %}{% endmacro %} 66 | 67 | // swiftlint:disable identifier_name line_length number_separator type_body_length 68 | {{accessModifier}} enum {{param.enumName|default:"PlistFiles"}} { 69 | {% if files.count > 1 or param.forceFileNameEnum %} 70 | {% for file in files %} 71 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 72 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 73 | } 74 | {% endfor %} 75 | {% else %} 76 | {% call fileBlock files.first %} 77 | {% endif %} 78 | } 79 | // swiftlint:enable identifier_name line_length number_separator type_body_length 80 | {% else %} 81 | // No files found 82 | {% endif %} 83 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/plist/runtime-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - Plist Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = arrayFromPlist(at: "{% call transformPath file.path %}") 19 | {% elif document.metadata.type == "Dictionary" %} 20 | private static let _document = PlistDocument(path: "{% call transformPath file.path %}") 21 | 22 | {% for key,value in document.metadata.properties %} 23 | {{accessModifier}} {% call propertyBlock key value %} 24 | {% endfor %} 25 | {% else %} 26 | // Unsupported root type `{{rootType}}` 27 | {% endif %} 28 | {% endmacro %} 29 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 30 | {% if metadata.type == "Array" %} 31 | [{% call typeBlock metadata.element %}] 32 | {% elif metadata.type == "Dictionary" %} 33 | [String: Any] 34 | {% else %} 35 | {{metadata.type}} 36 | {% endif %} 37 | {% endfilter %}{% endmacro %} 38 | {% macro propertyBlock key metadata %}{% filter removeNewlines:"leading" %} 39 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 40 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 41 | static let {{propertyName}}: {{propertyType}} = _document["{{key}}"] 42 | {% endfilter %}{% endmacro %} 43 | {% macro transformPath path %}{% filter removeNewlines %} 44 | {% if param.preservePath %} 45 | {{path}} 46 | {% else %} 47 | {{path|basename}} 48 | {% endif %} 49 | {% endfilter %}{% endmacro %} 50 | 51 | // swiftlint:disable identifier_name line_length type_body_length 52 | {{accessModifier}} enum {{param.enumName|default:"PlistFiles"}} { 53 | {% if files.count > 1 or param.forceFileNameEnum %} 54 | {% for file in files %} 55 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 56 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 57 | } 58 | {% endfor %} 59 | {% else %} 60 | {% call fileBlock files.first %} 61 | {% endif %} 62 | } 63 | // swiftlint:enable identifier_name line_length type_body_length 64 | 65 | // MARK: - Implementation Details 66 | 67 | private func arrayFromPlist(at path: String) -> [T] { 68 | {% if param.lookupFunction %} 69 | guard let url = {{param.lookupFunction}}(path), 70 | {% else %} 71 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 72 | {% endif %} 73 | let data = NSArray(contentsOf: url) as? [T] else { 74 | fatalError("Unable to load PLIST at path: \(path)") 75 | } 76 | return data 77 | } 78 | 79 | private struct PlistDocument { 80 | let data: [String: Any] 81 | 82 | init(path: String) { 83 | {% if param.lookupFunction %} 84 | guard let url = {{param.lookupFunction}}(path), 85 | {% else %} 86 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 87 | {% endif %} 88 | let data = NSDictionary(contentsOf: url) as? [String: Any] else { 89 | fatalError("Unable to load PLIST at path: \(path)") 90 | } 91 | self.data = data 92 | } 93 | 94 | subscript(key: String) -> T { 95 | guard let result = data[key] as? T else { 96 | fatalError("Property '\(key)' is not of type \(T.self)") 97 | } 98 | return result 99 | } 100 | } 101 | {% if not param.bundle and not param.lookupFunction %} 102 | 103 | // swiftlint:disable convenience_type 104 | private final class BundleToken { 105 | static let bundle: Bundle = { 106 | #if SWIFT_PACKAGE 107 | return Bundle.module 108 | #else 109 | return Bundle(for: BundleToken.self) 110 | #endif 111 | }() 112 | } 113 | // swiftlint:enable convenience_type 114 | {% endif %} 115 | {% else %} 116 | // No files found 117 | {% endif %} 118 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/plist/runtime-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command 9 | // swiftlint:disable file_length 10 | 11 | // MARK: - Plist Files 12 | {% macro fileBlock file %} 13 | {% call documentBlock file file.document %} 14 | {% endmacro %} 15 | {% macro documentBlock file document %} 16 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 17 | {% if document.metadata.type == "Array" %} 18 | {{accessModifier}} static let items: {{rootType}} = arrayFromPlist(at: "{% call transformPath file.path %}") 19 | {% elif document.metadata.type == "Dictionary" %} 20 | private static let _document = PlistDocument(path: "{% call transformPath file.path %}") 21 | 22 | {% for key,value in document.metadata.properties %} 23 | {{accessModifier}} {% call propertyBlock key value %} 24 | {% endfor %} 25 | {% else %} 26 | // Unsupported root type `{{rootType}}` 27 | {% endif %} 28 | {% endmacro %} 29 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 30 | {% if metadata.type == "Array" %} 31 | [{% call typeBlock metadata.element %}] 32 | {% elif metadata.type == "Dictionary" %} 33 | [String: Any] 34 | {% else %} 35 | {{metadata.type}} 36 | {% endif %} 37 | {% endfilter %}{% endmacro %} 38 | {% macro propertyBlock key metadata %}{% filter removeNewlines:"leading" %} 39 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 40 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 41 | static let {{propertyName}}: {{propertyType}} = _document["{{key}}"] 42 | {% endfilter %}{% endmacro %} 43 | {% macro transformPath path %}{% filter removeNewlines %} 44 | {% if param.preservePath %} 45 | {{path}} 46 | {% else %} 47 | {{path|basename}} 48 | {% endif %} 49 | {% endfilter %}{% endmacro %} 50 | 51 | // swiftlint:disable identifier_name line_length type_body_length 52 | {{accessModifier}} enum {{param.enumName|default:"PlistFiles"}} { 53 | {% if files.count > 1 or param.forceFileNameEnum %} 54 | {% for file in files %} 55 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 56 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 57 | } 58 | {% endfor %} 59 | {% else %} 60 | {% call fileBlock files.first %} 61 | {% endif %} 62 | } 63 | // swiftlint:enable identifier_name line_length type_body_length 64 | 65 | // MARK: - Implementation Details 66 | 67 | private func arrayFromPlist(at path: String) -> [T] { 68 | {% if param.lookupFunction %} 69 | guard let url = {{param.lookupFunction}}(path), 70 | {% else %} 71 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 72 | {% endif %} 73 | let data = NSArray(contentsOf: url) as? [T] else { 74 | fatalError("Unable to load PLIST at path: \(path)") 75 | } 76 | return data 77 | } 78 | 79 | private struct PlistDocument { 80 | let data: [String: Any] 81 | 82 | init(path: String) { 83 | {% if param.lookupFunction %} 84 | guard let url = {{param.lookupFunction}}(path), 85 | {% else %} 86 | guard let url = {{param.bundle|default:"BundleToken.bundle"}}.url(forResource: path, withExtension: nil), 87 | {% endif %} 88 | let data = NSDictionary(contentsOf: url) as? [String: Any] else { 89 | fatalError("Unable to load PLIST at path: \(path)") 90 | } 91 | self.data = data 92 | } 93 | 94 | subscript(key: String) -> T { 95 | guard let result = data[key] as? T else { 96 | fatalError("Property '\(key)' is not of type \(T.self)") 97 | } 98 | return result 99 | } 100 | } 101 | {% if not param.bundle and not param.lookupFunction %} 102 | 103 | // swiftlint:disable convenience_type 104 | private final class BundleToken { 105 | static let bundle: Bundle = { 106 | #if SWIFT_PACKAGE 107 | return Bundle.module 108 | #else 109 | return Bundle(for: BundleToken.self) 110 | #endif 111 | }() 112 | } 113 | // swiftlint:enable convenience_type 114 | {% endif %} 115 | {% else %} 116 | // No files found 117 | {% endif %} 118 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/flat-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if tables.count > 0 %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command file_length implicit_return 9 | 10 | // MARK: - Strings 11 | 12 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 13 | {% for type in types %} 14 | {% if type == "String" %} 15 | _ p{{forloop.counter}}: Any 16 | {% else %} 17 | _ p{{forloop.counter}}: {{type}} 18 | {% endif %} 19 | {{ ", " if not forloop.last }} 20 | {% endfor %} 21 | {% endfilter %}{% endmacro %} 22 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 23 | {% for type in types %} 24 | {% if type == "String" %} 25 | String(describing: p{{forloop.counter}}) 26 | {% elif type == "UnsafeRawPointer" %} 27 | Int(bitPattern: p{{forloop.counter}}) 28 | {% else %} 29 | p{{forloop.counter}} 30 | {% endif %} 31 | {{ ", " if not forloop.last }} 32 | {% endfor %} 33 | {% endfilter %}{% endmacro %} 34 | {% macro recursiveBlock table item %} 35 | {% for string in item.strings %} 36 | {% if not param.noComments %} 37 | /// {{string.translation}} 38 | {% endif %} 39 | {% if string.types %} 40 | {{accessModifier}} static func {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}({% call parametersBlock string.types %}) -> String { 41 | return {{enumName}}.tr("{{table}}", "{{string.key}}", {% call argumentsBlock string.types %}) 42 | } 43 | {% elif param.lookupFunction %} 44 | {# custom localization function is mostly used for in-app lang selection, so we want the loc to be recomputed at each call for those (hence the computed var) #} 45 | {{accessModifier}} static var {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}: String { return {{enumName}}.tr("{{table}}", "{{string.key}}") } 46 | {% else %} 47 | {{accessModifier}} static let {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}.tr("{{table}}", "{{string.key}}") 48 | {% endif %} 49 | {% endfor %} 50 | {% for child in item.children %} 51 | {% call recursiveBlock table child %} 52 | {% endfor %} 53 | {% endmacro %} 54 | // swiftlint:disable function_parameter_count identifier_name line_length type_body_length 55 | {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} 56 | {{accessModifier}} enum {{enumName}} { 57 | {% if tables.count > 1 or param.forceFileNameEnum %} 58 | {% for table in tables %} 59 | {{accessModifier}} enum {{table.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 60 | {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} 61 | } 62 | {% endfor %} 63 | {% else %} 64 | {% call recursiveBlock tables.first.name tables.first.levels %} 65 | {% endif %} 66 | } 67 | // swiftlint:enable function_parameter_count identifier_name line_length type_body_length 68 | 69 | // MARK: - Implementation Details 70 | 71 | extension {{enumName}} { 72 | private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { 73 | {% if param.lookupFunction %} 74 | let format = {{ param.lookupFunction }}(key, table) 75 | {% else %} 76 | let format = {{param.bundle|default:"BundleToken.bundle"}}.localizedString(forKey: key, value: nil, table: table) 77 | {% endif %} 78 | return String(format: format, locale: Locale.current, arguments: args) 79 | } 80 | } 81 | {% if not param.bundle and not param.lookupFunction %} 82 | 83 | // swiftlint:disable convenience_type 84 | private final class BundleToken { 85 | static let bundle: Bundle = { 86 | #if SWIFT_PACKAGE 87 | return Bundle.module 88 | #else 89 | return Bundle(for: BundleToken.self) 90 | #endif 91 | }() 92 | } 93 | // swiftlint:enable convenience_type 94 | {% endif %} 95 | {% else %} 96 | // No string found 97 | {% endif %} 98 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/flat-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if tables.count > 0 %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command file_length implicit_return 9 | 10 | // MARK: - Strings 11 | 12 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 13 | {% for type in types %} 14 | {% if type == "String" %} 15 | _ p{{forloop.counter}}: Any 16 | {% else %} 17 | _ p{{forloop.counter}}: {{type}} 18 | {% endif %} 19 | {{ ", " if not forloop.last }} 20 | {% endfor %} 21 | {% endfilter %}{% endmacro %} 22 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 23 | {% for type in types %} 24 | {% if type == "String" %} 25 | String(describing: p{{forloop.counter}}) 26 | {% elif type == "UnsafeRawPointer" %} 27 | Int(bitPattern: p{{forloop.counter}}) 28 | {% else %} 29 | p{{forloop.counter}} 30 | {% endif %} 31 | {{ ", " if not forloop.last }} 32 | {% endfor %} 33 | {% endfilter %}{% endmacro %} 34 | {% macro recursiveBlock table item %} 35 | {% for string in item.strings %} 36 | {% if not param.noComments %} 37 | /// {{string.translation}} 38 | {% endif %} 39 | {% if string.types %} 40 | {{accessModifier}} static func {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}({% call parametersBlock string.types %}) -> String { 41 | return {{enumName}}.tr("{{table}}", "{{string.key}}", {% call argumentsBlock string.types %}) 42 | } 43 | {% elif param.lookupFunction %} 44 | {# custom localization function is mostly used for in-app lang selection, so we want the loc to be recomputed at each call for those (hence the computed var) #} 45 | {{accessModifier}} static var {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}: String { return {{enumName}}.tr("{{table}}", "{{string.key}}") } 46 | {% else %} 47 | {{accessModifier}} static let {{string.key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}.tr("{{table}}", "{{string.key}}") 48 | {% endif %} 49 | {% endfor %} 50 | {% for child in item.children %} 51 | {% call recursiveBlock table child %} 52 | {% endfor %} 53 | {% endmacro %} 54 | // swiftlint:disable function_parameter_count identifier_name line_length type_body_length 55 | {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} 56 | {{accessModifier}} enum {{enumName}} { 57 | {% if tables.count > 1 or param.forceFileNameEnum %} 58 | {% for table in tables %} 59 | {{accessModifier}} enum {{table.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 60 | {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} 61 | } 62 | {% endfor %} 63 | {% else %} 64 | {% call recursiveBlock tables.first.name tables.first.levels %} 65 | {% endif %} 66 | } 67 | // swiftlint:enable function_parameter_count identifier_name line_length type_body_length 68 | 69 | // MARK: - Implementation Details 70 | 71 | extension {{enumName}} { 72 | private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { 73 | {% if param.lookupFunction %} 74 | let format = {{ param.lookupFunction }}(key, table) 75 | {% else %} 76 | let format = {{param.bundle|default:"BundleToken.bundle"}}.localizedString(forKey: key, value: nil, table: table) 77 | {% endif %} 78 | return String(format: format, locale: Locale.current, arguments: args) 79 | } 80 | } 81 | {% if not param.bundle and not param.lookupFunction %} 82 | 83 | // swiftlint:disable convenience_type 84 | private final class BundleToken { 85 | static let bundle: Bundle = { 86 | #if SWIFT_PACKAGE 87 | return Bundle.module 88 | #else 89 | return Bundle(for: BundleToken.self) 90 | #endif 91 | }() 92 | } 93 | // swiftlint:enable convenience_type 94 | {% endif %} 95 | {% else %} 96 | // No string found 97 | {% endif %} 98 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/objc-h.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 2 | 3 | {% if tables.count > 0 %} 4 | #import 5 | 6 | NS_ASSUME_NONNULL_BEGIN 7 | 8 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 9 | {% for type in types %} 10 | ({% call paramTranslate type %})p{{ forloop.counter }}{{ " :" if not forloop.last }} 11 | {% endfor %} 12 | {% endfilter %}{% endmacro %} 13 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 14 | {% for type in types %} 15 | p{{forloop.counter}}{{ ", " if not forloop.last }} 16 | {% endfor %} 17 | {% endfilter %}{% endmacro %} 18 | {% macro paramTranslate swiftType %} 19 | {% if swiftType == "Any" %} 20 | id 21 | {% elif swiftType == "CChar" %} 22 | char 23 | {% elif swiftType == "Float" %} 24 | float 25 | {% elif swiftType == "Int" %} 26 | NSInteger 27 | {% elif swiftType == "String" %} 28 | id 29 | {% elif swiftType == "UnsafePointer" %} 30 | char* 31 | {% elif swiftType == "UnsafeRawPointer" %} 32 | void* 33 | {% else %} 34 | objc-h.stencil is missing '{{swiftType}}' 35 | {% endif %} 36 | {% endmacro %} 37 | {% macro emitOneMethod table item %} 38 | {% for string in item.strings %} 39 | {% if not param.noComments %} 40 | // {{string.key}} --> "{{string.translation}}" 41 | {% endif %} 42 | {% if string.types %} 43 | {% if string.types.count == 1 %} 44 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}}WithValue:{% call parametersBlock string.types %}; 45 | {% else %} 46 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}}WithValues:{% call parametersBlock string.types %}; 47 | {% endif %} 48 | {% else %} 49 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}}; 50 | {% endif %} 51 | {% endfor %} 52 | {% for child in item.children %} 53 | {% call emitOneMethod table child %} 54 | {% endfor %} 55 | {% endmacro %} 56 | {% for table in tables %} 57 | @interface {{ table.name }} : NSObject 58 | {% call emitOneMethod table.name table.levels %} 59 | @end 60 | 61 | {% endfor %} 62 | 63 | NS_ASSUME_NONNULL_END 64 | {% else %} 65 | // No strings found 66 | {% endif %} 67 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/objc-m.stencil: -------------------------------------------------------------------------------- 1 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 2 | 3 | {% if tables.count > 0 %} 4 | #import "{{ param.headerName|default:"Localizable.h" }}" 5 | {% if not param.bundle %} 6 | 7 | @interface BundleToken : NSObject 8 | @end 9 | 10 | @implementation BundleToken 11 | @end 12 | {% endif %} 13 | 14 | #pragma clang diagnostic push 15 | #pragma clang diagnostic ignored "-Wformat-security" 16 | 17 | static NSString* tr(NSString *tableName, NSString *key, ...) { 18 | NSBundle *bundle = {{param.bundle|default:"[NSBundle bundleForClass:BundleToken.class]"}}; 19 | NSString *format = [bundle localizedStringForKey:key value:nil table:tableName]; 20 | NSLocale *locale = [NSLocale currentLocale]; 21 | 22 | va_list args; 23 | va_start(args, key); 24 | NSString *result = [[NSString alloc] initWithFormat:format locale:locale arguments:args]; 25 | va_end(args); 26 | 27 | return result; 28 | }; 29 | #pragma clang diagnostic pop 30 | 31 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 32 | {% for type in types %} 33 | ({% call paramTranslate type %})p{{ forloop.counter }}{{ " :" if not forloop.last }} 34 | {% endfor %} 35 | {% endfilter %}{% endmacro %} 36 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 37 | {% for type in types %} 38 | p{{forloop.counter}}{{ ", " if not forloop.last }} 39 | {% endfor %} 40 | {% endfilter %}{% endmacro %} 41 | {% macro paramTranslate swiftType %} 42 | {% if swiftType == "Any" %} 43 | id 44 | {% elif swiftType == "CChar" %} 45 | char 46 | {% elif swiftType == "Float" %} 47 | float 48 | {% elif swiftType == "Int" %} 49 | NSInteger 50 | {% elif swiftType == "String" %} 51 | id 52 | {% elif swiftType == "UnsafePointer" %} 53 | char* 54 | {% elif swiftType == "UnsafeRawPointer" %} 55 | void* 56 | {% else %} 57 | objc-m.stencil is missing '{{swiftType}}' 58 | {% endif %} 59 | {% endmacro %} 60 | {% macro tableContents table item %} 61 | {% for string in item.strings %} 62 | {% if string.types %} 63 | {% if string.types.count == 1 %} 64 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}}WithValue:{% call parametersBlock string.types %} 65 | {% else %} 66 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}}WithValues:{% call parametersBlock string.types %} 67 | {% endif %} 68 | { 69 | return tr(@"{{table}}", @"{{string.key}}", {% call argumentsBlock string.types %}); 70 | } 71 | {% else %} 72 | + (NSString*){{string.key|swiftIdentifier:"pretty"|lowerFirstWord}} { 73 | return tr(@"{{table}}", @"{{string.key}}"); 74 | } 75 | {% endif %} 76 | {% endfor %} 77 | {% for child in item.children %} 78 | {% call tableContents table child %} 79 | {% endfor %} 80 | {% endmacro %} 81 | {% for table in tables %} 82 | {% set tableName %}{{table.name|default:"Localized"}}{% endset %} 83 | @implementation {{ tableName }} : NSObject 84 | {% call tableContents table.name table.levels %} 85 | @end 86 | 87 | {% endfor %} 88 | {% else %} 89 | // No strings found 90 | {% endif %} 91 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/structured-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if tables.count > 0 %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command file_length implicit_return 9 | 10 | // MARK: - Strings 11 | 12 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 13 | {% for type in types %} 14 | {% if type == "String" %} 15 | _ p{{forloop.counter}}: Any 16 | {% else %} 17 | _ p{{forloop.counter}}: {{type}} 18 | {% endif %} 19 | {{ ", " if not forloop.last }} 20 | {% endfor %} 21 | {% endfilter %}{% endmacro %} 22 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 23 | {% for type in types %} 24 | {% if type == "String" %} 25 | String(describing: p{{forloop.counter}}) 26 | {% elif type == "UnsafeRawPointer" %} 27 | Int(bitPattern: p{{forloop.counter}}) 28 | {% else %} 29 | p{{forloop.counter}} 30 | {% endif %} 31 | {{ ", " if not forloop.last }} 32 | {% endfor %} 33 | {% endfilter %}{% endmacro %} 34 | {% macro recursiveBlock table item %} 35 | {% for string in item.strings %} 36 | {% if not param.noComments %} 37 | /// {{string.translation}} 38 | {% endif %} 39 | {% if string.types %} 40 | {{accessModifier}} static func {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}({% call parametersBlock string.types %}) -> String { 41 | return {{enumName}}.tr("{{table}}", "{{string.key}}", {% call argumentsBlock string.types %}) 42 | } 43 | {% elif param.lookupFunction %} 44 | {# custom localization function is mostly used for in-app lang selection, so we want the loc to be recomputed at each call for those (hence the computed var) #} 45 | {{accessModifier}} static var {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}: String { return {{enumName}}.tr("{{table}}", "{{string.key}}") } 46 | {% else %} 47 | {{accessModifier}} static let {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}.tr("{{table}}", "{{string.key}}") 48 | {% endif %} 49 | {% endfor %} 50 | {% for child in item.children %} 51 | 52 | {{accessModifier}} enum {{child.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 53 | {% filter indent:2 %}{% call recursiveBlock table child %}{% endfilter %} 54 | } 55 | {% endfor %} 56 | {% endmacro %} 57 | // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length 58 | // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces 59 | {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} 60 | {{accessModifier}} enum {{enumName}} { 61 | {% if tables.count > 1 or param.forceFileNameEnum %} 62 | {% for table in tables %} 63 | {{accessModifier}} enum {{table.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 64 | {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} 65 | } 66 | {% endfor %} 67 | {% else %} 68 | {% call recursiveBlock tables.first.name tables.first.levels %} 69 | {% endif %} 70 | } 71 | // swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length 72 | // swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces 73 | 74 | // MARK: - Implementation Details 75 | 76 | extension {{enumName}} { 77 | private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { 78 | {% if param.lookupFunction %} 79 | let format = {{ param.lookupFunction }}(key, table) 80 | {% else %} 81 | let format = {{param.bundle|default:"BundleToken.bundle"}}.localizedString(forKey: key, value: nil, table: table) 82 | {% endif %} 83 | return String(format: format, locale: Locale.current, arguments: args) 84 | } 85 | } 86 | {% if not param.bundle and not param.lookupFunction %} 87 | 88 | // swiftlint:disable convenience_type 89 | private final class BundleToken { 90 | static let bundle: Bundle = { 91 | #if SWIFT_PACKAGE 92 | return Bundle.module 93 | #else 94 | return Bundle(for: BundleToken.self) 95 | #endif 96 | }() 97 | } 98 | // swiftlint:enable convenience_type 99 | {% endif %} 100 | {% else %} 101 | // No string found 102 | {% endif %} 103 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/strings/structured-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if tables.count > 0 %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | import Foundation 7 | 8 | // swiftlint:disable superfluous_disable_command file_length implicit_return 9 | 10 | // MARK: - Strings 11 | 12 | {% macro parametersBlock types %}{% filter removeNewlines:"leading" %} 13 | {% for type in types %} 14 | {% if type == "String" %} 15 | _ p{{forloop.counter}}: Any 16 | {% else %} 17 | _ p{{forloop.counter}}: {{type}} 18 | {% endif %} 19 | {{ ", " if not forloop.last }} 20 | {% endfor %} 21 | {% endfilter %}{% endmacro %} 22 | {% macro argumentsBlock types %}{% filter removeNewlines:"leading" %} 23 | {% for type in types %} 24 | {% if type == "String" %} 25 | String(describing: p{{forloop.counter}}) 26 | {% elif type == "UnsafeRawPointer" %} 27 | Int(bitPattern: p{{forloop.counter}}) 28 | {% else %} 29 | p{{forloop.counter}} 30 | {% endif %} 31 | {{ ", " if not forloop.last }} 32 | {% endfor %} 33 | {% endfilter %}{% endmacro %} 34 | {% macro recursiveBlock table item %} 35 | {% for string in item.strings %} 36 | {% if not param.noComments %} 37 | /// {{string.translation}} 38 | {% endif %} 39 | {% if string.types %} 40 | {{accessModifier}} static func {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}({% call parametersBlock string.types %}) -> String { 41 | return {{enumName}}.tr("{{table}}", "{{string.key}}", {% call argumentsBlock string.types %}) 42 | } 43 | {% elif param.lookupFunction %} 44 | {# custom localization function is mostly used for in-app lang selection, so we want the loc to be recomputed at each call for those (hence the computed var) #} 45 | {{accessModifier}} static var {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}: String { return {{enumName}}.tr("{{table}}", "{{string.key}}") } 46 | {% else %} 47 | {{accessModifier}} static let {{string.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{enumName}}.tr("{{table}}", "{{string.key}}") 48 | {% endif %} 49 | {% endfor %} 50 | {% for child in item.children %} 51 | 52 | {{accessModifier}} enum {{child.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 53 | {% filter indent:2 %}{% call recursiveBlock table child %}{% endfilter %} 54 | } 55 | {% endfor %} 56 | {% endmacro %} 57 | // swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length 58 | // swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces 59 | {% set enumName %}{{param.enumName|default:"L10n"}}{% endset %} 60 | {{accessModifier}} enum {{enumName}} { 61 | {% if tables.count > 1 or param.forceFileNameEnum %} 62 | {% for table in tables %} 63 | {{accessModifier}} enum {{table.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 64 | {% filter indent:2 %}{% call recursiveBlock table.name table.levels %}{% endfilter %} 65 | } 66 | {% endfor %} 67 | {% else %} 68 | {% call recursiveBlock tables.first.name tables.first.levels %} 69 | {% endif %} 70 | } 71 | // swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length 72 | // swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces 73 | 74 | // MARK: - Implementation Details 75 | 76 | extension {{enumName}} { 77 | private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { 78 | {% if param.lookupFunction %} 79 | let format = {{ param.lookupFunction }}(key, table) 80 | {% else %} 81 | let format = {{param.bundle|default:"BundleToken.bundle"}}.localizedString(forKey: key, value: nil, table: table) 82 | {% endif %} 83 | return String(format: format, locale: Locale.current, arguments: args) 84 | } 85 | } 86 | {% if not param.bundle and not param.lookupFunction %} 87 | 88 | // swiftlint:disable convenience_type 89 | private final class BundleToken { 90 | static let bundle: Bundle = { 91 | #if SWIFT_PACKAGE 92 | return Bundle.module 93 | #else 94 | return Bundle(for: BundleToken.self) 95 | #endif 96 | }() 97 | } 98 | // swiftlint:enable convenience_type 99 | {% endif %} 100 | {% else %} 101 | // No string found 102 | {% endif %} 103 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/yaml/inline-swift4.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set documentPrefix %}{{param.documentName|default:"Document"}}{% endset %} 7 | import Foundation 8 | 9 | // swiftlint:disable superfluous_disable_command 10 | // swiftlint:disable file_length 11 | 12 | // MARK: - YAML Files 13 | {% macro fileBlock file %} 14 | {% if file.documents.count > 1 %} 15 | {% for document in file.documents %} 16 | {% set documentName %}{{documentPrefix}}{{forloop.counter}}{% endset %} 17 | {{accessModifier}} enum {{documentName|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 18 | {% filter indent:2 %}{% call documentBlock file document %}{% endfilter %} 19 | } 20 | {% endfor %} 21 | {% else %} 22 | {% call documentBlock file file.documents.first %} 23 | {% endif %} 24 | {% endmacro %} 25 | {% macro documentBlock file document %} 26 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 27 | {% if document.metadata.type == "Array" %} 28 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 29 | {% elif document.metadata.type == "Dictionary" %} 30 | {% for key,value in document.metadata.properties %} 31 | {{accessModifier}} {% call propertyBlock key value document.data %} 32 | {% endfor %} 33 | {% else %} 34 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 35 | {% endif %} 36 | {% endmacro %} 37 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 38 | {% if metadata.type == "Array" %} 39 | [{% call typeBlock metadata.element %}] 40 | {% elif metadata.type == "Dictionary" %} 41 | [String: Any] 42 | {% elif metadata.type == "Optional" %} 43 | Any? 44 | {% else %} 45 | {{metadata.type}} 46 | {% endif %} 47 | {% endfilter %}{% endmacro %} 48 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 49 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 50 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 51 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 52 | {% endfilter %}{% endmacro %} 53 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 54 | {% if metadata.type == "String" %} 55 | "{{ value }}" 56 | {% elif metadata.type == "Optional" %} 57 | nil 58 | {% elif metadata.type == "Array" and value %} 59 | [{% for value in value %} 60 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 61 | {{ ", " if not forloop.last }} 62 | {% endfor %}] 63 | {% elif metadata.type == "Dictionary" %} 64 | [{% for key,value in value %} 65 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 66 | {{ ", " if not forloop.last }} 67 | {% empty %} 68 | : 69 | {% endfor %}] 70 | {% elif metadata.type == "Bool" %} 71 | {% if value %}true{% else %}false{% endif %} 72 | {% else %} 73 | {{ value }} 74 | {% endif %} 75 | {% endfilter %}{% endmacro %} 76 | 77 | // swiftlint:disable identifier_name line_length number_separator type_body_length 78 | {{accessModifier}} enum {{param.enumName|default:"YAMLFiles"}} { 79 | {% if files.count > 1 or param.forceFileNameEnum %} 80 | {% for file in files %} 81 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 82 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 83 | } 84 | {% endfor %} 85 | {% else %} 86 | {% call fileBlock files.first %} 87 | {% endif %} 88 | } 89 | // swiftlint:enable identifier_name line_length number_separator type_body_length 90 | {% else %} 91 | // No files found 92 | {% endif %} 93 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Binaries/SwiftGenBinary.artifactbundle/swiftgen-6.4.0/templates/yaml/inline-swift5.stencil: -------------------------------------------------------------------------------- 1 | // swiftlint:disable all 2 | // Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen 3 | 4 | {% if files %} 5 | {% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %} 6 | {% set documentPrefix %}{{param.documentName|default:"Document"}}{% endset %} 7 | import Foundation 8 | 9 | // swiftlint:disable superfluous_disable_command 10 | // swiftlint:disable file_length 11 | 12 | // MARK: - YAML Files 13 | {% macro fileBlock file %} 14 | {% if file.documents.count > 1 %} 15 | {% for document in file.documents %} 16 | {% set documentName %}{{documentPrefix}}{{forloop.counter}}{% endset %} 17 | {{accessModifier}} enum {{documentName|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 18 | {% filter indent:2 %}{% call documentBlock file document %}{% endfilter %} 19 | } 20 | {% endfor %} 21 | {% else %} 22 | {% call documentBlock file file.documents.first %} 23 | {% endif %} 24 | {% endmacro %} 25 | {% macro documentBlock file document %} 26 | {% set rootType %}{% call typeBlock document.metadata %}{% endset %} 27 | {% if document.metadata.type == "Array" %} 28 | {{accessModifier}} static let items: {{rootType}} = {% call valueBlock document.data document.metadata %} 29 | {% elif document.metadata.type == "Dictionary" %} 30 | {% for key,value in document.metadata.properties %} 31 | {{accessModifier}} {% call propertyBlock key value document.data %} 32 | {% endfor %} 33 | {% else %} 34 | {{accessModifier}} static let value: {{rootType}} = {% call valueBlock document.data document.metadata %} 35 | {% endif %} 36 | {% endmacro %} 37 | {% macro typeBlock metadata %}{% filter removeNewlines:"leading" %} 38 | {% if metadata.type == "Array" %} 39 | [{% call typeBlock metadata.element %}] 40 | {% elif metadata.type == "Dictionary" %} 41 | [String: Any] 42 | {% elif metadata.type == "Optional" %} 43 | Any? 44 | {% else %} 45 | {{metadata.type}} 46 | {% endif %} 47 | {% endfilter %}{% endmacro %} 48 | {% macro propertyBlock key metadata data %}{% filter removeNewlines:"leading" %} 49 | {% set propertyName %}{{key|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}}{% endset %} 50 | {% set propertyType %}{% call typeBlock metadata %}{% endset %} 51 | static let {{propertyName}}: {{propertyType}} = {% call valueBlock data[key] metadata %} 52 | {% endfilter %}{% endmacro %} 53 | {% macro valueBlock value metadata %}{% filter removeNewlines:"leading" %} 54 | {% if metadata.type == "String" %} 55 | "{{ value }}" 56 | {% elif metadata.type == "Optional" %} 57 | nil 58 | {% elif metadata.type == "Array" and value %} 59 | [{% for value in value %} 60 | {% call valueBlock value metadata.element.items[forloop.counter0]|default:metadata.element %} 61 | {{ ", " if not forloop.last }} 62 | {% endfor %}] 63 | {% elif metadata.type == "Dictionary" %} 64 | [{% for key,value in value %} 65 | "{{key}}": {% call valueBlock value metadata.properties[key] %} 66 | {{ ", " if not forloop.last }} 67 | {% empty %} 68 | : 69 | {% endfor %}] 70 | {% elif metadata.type == "Bool" %} 71 | {% if value %}true{% else %}false{% endif %} 72 | {% else %} 73 | {{ value }} 74 | {% endif %} 75 | {% endfilter %}{% endmacro %} 76 | 77 | // swiftlint:disable identifier_name line_length number_separator type_body_length 78 | {{accessModifier}} enum {{param.enumName|default:"YAMLFiles"}} { 79 | {% if files.count > 1 or param.forceFileNameEnum %} 80 | {% for file in files %} 81 | {{accessModifier}} enum {{file.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { 82 | {% filter indent:2 %}{% call fileBlock file %}{% endfilter %} 83 | } 84 | {% endfor %} 85 | {% else %} 86 | {% call fileBlock files.first %} 87 | {% endif %} 88 | } 89 | // swiftlint:enable identifier_name line_length number_separator type_body_length 90 | {% else %} 91 | // No files found 92 | {% endif %} 93 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.6 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "SwiftGenExample", 6 | defaultLocalization: "en", 7 | targets: [ 8 | // A local tool that uses a build tool plugin. 9 | .executableTarget( 10 | name: "SwiftGenExample", 11 | plugins: [ 12 | "SwiftGenPlugin", 13 | ] 14 | ), 15 | // The plugin that generates build tool commands to invoke SwiftGen. 16 | .plugin( 17 | name: "SwiftGenPlugin", 18 | capability: .buildTool(), 19 | dependencies: [ 20 | "SwiftGenBinary", 21 | ] 22 | ), 23 | // The vended executable that generates source files. 24 | .binaryTarget( 25 | name: "SwiftGenBinary", 26 | path: "Binaries/SwiftGenBinary.artifactbundle" 27 | ), 28 | .testTarget( 29 | name: "SwiftGenExampleTests", 30 | dependencies: [ 31 | "SwiftGenExample", 32 | ] 33 | ), 34 | ] 35 | ) 36 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Plugins/SwiftGenPlugin/plugin.swift: -------------------------------------------------------------------------------- 1 | import PackagePlugin 2 | import Foundation 3 | 4 | @main 5 | struct SwiftGenPlugin: BuildToolPlugin { 6 | 7 | func createBuildCommands(context: PluginContext, target: Target) throws -> [Command] { 8 | // This example configures `swiftgen` to take inputs from a `swiftgen.yml` file. 9 | let swiftGenConfigFile = context.package.directory.appending("swiftgen.yml") 10 | 11 | // This example configures `swiftgen` to write to a "SwiftGenOutputs" directory. 12 | let swiftGenOutputsDir = context.pluginWorkDirectory.appending("SwiftGenOutputs") 13 | try FileManager.default.createDirectory(atPath: swiftGenOutputsDir.string, withIntermediateDirectories: true) 14 | 15 | // Return a command to run `swiftgen` as a prebuild command. It will be run before 16 | // every build and generates source files into an output directory provided by the 17 | // build context. 18 | return [.prebuildCommand( 19 | displayName: "Running SwiftGen", 20 | executable: try context.tool(named: "swiftgen").path, 21 | arguments: [ 22 | "config", 23 | "run", 24 | "--verbose", 25 | "--config", "\(swiftGenConfigFile)" 26 | ], 27 | environment: [ 28 | "PROJECT_DIR": "\(context.package.directory)", 29 | "TARGET_NAME": "\(target.name)", 30 | "DERIVED_SOURCES_DIR": "\(swiftGenOutputsDir)", 31 | ], 32 | outputFilesDirectory: swiftGenOutputsDir) 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/README.md: -------------------------------------------------------------------------------- 1 | # Example 1 - SwiftGen 2 | 3 | This example uses a prebuild tool plugin that invokes SwiftGen to generate Swift before a build of a Swift Package. This sample package currently (temporarily) embeds a copy of SwiftGen as a binary executable, but this should eventually come from SwiftGen itself. The plugin uses the convention of looking for a `swiftgen.yml` at the root directory of the package. 4 | 5 | This example requires SwiftPM 5.6 or later. -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Sources/SwiftGenExample/Base.lproj/Foo.strings: -------------------------------------------------------------------------------- 1 | GREETING = "Hello World"; 2 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Sources/SwiftGenExample/SwiftGenExample.swift: -------------------------------------------------------------------------------- 1 | public func GetGreeting() -> String { 2 | return L10n.greeting 3 | } 4 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Sources/SwiftGenExample/main.swift: -------------------------------------------------------------------------------- 1 | print ("\(GetGreeting())!") 2 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/Tests/SwiftGenExampleTests/SwiftGenExampleTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import SwiftGenExample 3 | 4 | final class SwiftGenExampleTests: XCTestCase { 5 | 6 | func testExample() { 7 | XCTAssertEqual(GetGreeting(), "Hello World") 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Example 1 - SwiftGen/swiftgen.yml: -------------------------------------------------------------------------------- 1 | ## Generate constants for your localized strings. 2 | ## Be sure that SwiftGen only parses ONE locale (typically Base.lproj, or en.lproj, or whichever your development region is); otherwise it will generate the same keys multiple times. 3 | ## SwiftGen will parse all `.strings` files found in that folder. 4 | strings: 5 | inputs: 6 | - Sources/SwiftGenExample/Base.lproj 7 | outputs: 8 | - templateName: structured-swift5 9 | output: ${DERIVED_SOURCES_DIR}/Strings+Generated.swift 10 | 11 | ## 12 | ## For more info, use `swiftgen config doc` to open the full documentation on GitHub. 13 | ## https://github.com/SwiftGen/SwiftGen/tree/6.4.0/Documentation/ 14 | -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.6 2 | import PackageDescription 3 | 4 | let package = Package( 5 | name: "swift-protobuf-plugin-example", 6 | dependencies: [ 7 | .package(url: "https://github.com/abertelrud/swift-protobuf.git", branch: "eng/add-build-tool-plugin"), 8 | ], 9 | targets: [ 10 | .executableTarget( 11 | name: "ProtobufExample", 12 | dependencies: [ 13 | .product(name: "SwiftProtobufPluginLibrary", package: "swift-protobuf"), 14 | ], 15 | plugins: [ 16 | .plugin(name: "SwiftProtobufPlugin", package: "swift-protobuf"), 17 | ] 18 | ), 19 | .testTarget( 20 | name: "ProtobufExampleTests", 21 | dependencies: [ 22 | "ProtobufExample", 23 | ] 24 | ), 25 | ] 26 | ) 27 | -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/README.md: -------------------------------------------------------------------------------- 1 | # Example 2 - SwiftProtobuf 2 | 3 | This example uses a build tool plugin to generate Swift code from ``.proto`` files during a build of a Swift Package. It currently requires a modified fork of the `swift-protobuf` which adds a SwiftPM plugin script as well (temporarily) a binary of the `protoc` compiler. 4 | 5 | This example requires SwiftPM 5.6 or later. -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/Sources/ProtobufExample/Foo.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | message Foo { 4 | int64 id = 1; 5 | string name = 2; 6 | } 7 | -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/Sources/ProtobufExample/ProtobufExample.swift: -------------------------------------------------------------------------------- 1 | public func GetFooName() throws -> String { 2 | // Create a Foo. 3 | let foo = Foo.with { $0.name = "Foo" } 4 | 5 | // Serialize it. 6 | let data = try foo.serializedData() 7 | 8 | // Print the bytes. 9 | print("Protobuf data is: \([UInt8](data))") 10 | 11 | // Create another Foo. 12 | let newFoo = try Foo(serializedData: data) 13 | 14 | // Return its name. 15 | return newFoo.name 16 | } 17 | -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/Sources/ProtobufExample/main.swift: -------------------------------------------------------------------------------- 1 | print("\(try GetFooName())!") 2 | -------------------------------------------------------------------------------- /Example 2 - SwiftProtobuf/Tests/ProtobufExampleTests/ProtobufExampleTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import ProtobufExample 3 | 4 | final class ProtobufExampleTests: XCTestCase { 5 | 6 | func testExample() { 7 | XCTAssertEqual(try GetFooName(), "Foo") 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # swiftpm-buildtool-plugin-examples 2 | 3 | Some examples of SwiftPM build tool plugins to go along with SE-0303 + SE-0325. Each directory is its own package (these are not able to be used as dependencies of other packages, but rather intended as standalone examples). --------------------------------------------------------------------------------