File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import PackageModel
15
15
/// Create an initial template package.
16
16
public final class InitPackage {
17
17
/// The tool version to be used for new packages.
18
- public static let newPackageToolsVersion = ToolsVersion ( version : " 5.3.0 " )
18
+ public static let newPackageToolsVersion = ToolsVersion . currentToolsVersion
19
19
20
20
/// Options for the template package.
21
21
public struct InitPackageOptions {
@@ -186,18 +186,34 @@ public final class InitPackage {
186
186
""" )
187
187
188
188
if packageType == . library || packageType == . executable || packageType == . manifest {
189
- pkgParams. append ( """
189
+ var param = " "
190
+
191
+ param += """
190
192
targets: [
191
193
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
192
194
// Targets can depend on other targets in this package, and on products in packages this package depends on.
193
- .target(
195
+
196
+ """
197
+ if packageType == . executable {
198
+ param += """
199
+ .executableTarget(
200
+ """
201
+ } else {
202
+ param += """
203
+ .target(
204
+ """
205
+ }
206
+ param += """
207
+
194
208
name: " \( pkgname) " ,
195
209
dependencies: []),
196
210
.testTarget(
197
211
name: " \( pkgname) Tests " ,
198
212
dependencies: [ " \( pkgname) " ]),
199
213
]
200
- """ )
214
+ """
215
+
216
+ pkgParams. append ( param)
201
217
}
202
218
203
219
stream <<< pkgParams. joined ( separator: " , \n " ) <<< " \n ) \n "
You can’t perform that action at this time.
0 commit comments