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 {
@@ -187,18 +187,34 @@ public final class InitPackage {
187
187
""" )
188
188
189
189
if packageType == . library || packageType == . executable || packageType == . manifest {
190
- pkgParams. append ( """
190
+ var param = " "
191
+
192
+ param += """
191
193
targets: [
192
194
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
193
195
// Targets can depend on other targets in this package, and on products in packages this package depends on.
194
- .target(
196
+
197
+ """
198
+ if packageType == . executable {
199
+ param += """
200
+ .executableTarget(
201
+ """
202
+ } else {
203
+ param += """
204
+ .target(
205
+ """
206
+ }
207
+ param += """
208
+
195
209
name: " \( pkgname) " ,
196
210
dependencies: []),
197
211
.testTarget(
198
212
name: " \( pkgname) Tests " ,
199
213
dependencies: [ " \( pkgname) " ]),
200
214
]
201
- """ )
215
+ """
216
+
217
+ pkgParams. append ( param)
202
218
}
203
219
204
220
stream <<< pkgParams. joined ( separator: " , \n " ) <<< " \n ) \n "
You can’t perform that action at this time.
0 commit comments