Commit dc2e33f
authored
Explicitly set the Swift language mode on package init (#9263)
Explicitly set the Swift language mode on package init
### Motivation:
When a package is created using `swift package init` no language mode is
specified and defaults to using Swift 5.
New packages should be written in Swift 6, so explicitly set the
language mode to 6 on package init.
### Modifications:
Include a language mode on package init
### Result:
New packages created using `swift package init` will include the
following by default: swiftLanguageModes: [.v6]
```
let package = Package(
name: "tmp",
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "tmp",
targets: ["tmp"]
),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "tmp"
),
.testTarget(
name: "tmpTests",
dependencies: ["tmp"]
),
],
swiftLanguageModes: [.v6]
)
```1 parent da5df4c commit dc2e33f
File tree
3 files changed
+40
-3
lines changed- Sources
- Workspace
- _InternalTestSupport
- Tests/WorkspaceTests
3 files changed
+40
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
41 | | - | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| 50 | + | |
46 | 51 | | |
47 | 52 | | |
48 | 53 | | |
| |||
432 | 437 | | |
433 | 438 | | |
434 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
435 | 446 | | |
436 | 447 | | |
437 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
| 670 | + | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
673 | | - | |
| 674 | + | |
674 | 675 | | |
675 | 676 | | |
676 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
513 | 538 | | |
514 | 539 | | |
515 | 540 | | |
| |||
0 commit comments