Commit c047d29
committed
Use access level on import in resource_bundle_accessor.swift
When a Swift package specifies a resource as part of a build target,
SwiftPM synthesizes a resource_bundle_accessor.swift to provide runtime
hooks to access the resource. This generated file imports Foundation but
does not specify an access level. With Swift 6.0, access-level-on-import
is part of the language mode, meaning that if a target specified a
resource and contained a non-public import of Foundation, the build
would fail with:
```
error: ambiguous implicit access level for import of 'Foundation'
```
This patch updates the generation logic to include an explicit `public`
access level modifier for the Foundation import in
`bundle_resource_accessor.swift` if the Swift version is >= 6.0.1 parent af813e1 commit c047d29
2 files changed
Lines changed: 69 additions & 4 deletions
File tree
- Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers
- Tests/SWBTaskConstructionTests
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2021 | 2021 | | |
2022 | 2022 | | |
2023 | 2023 | | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
2024 | 2034 | | |
2025 | | - | |
| 2035 | + | |
2026 | 2036 | | |
2027 | 2037 | | |
2028 | 2038 | | |
| |||
2031 | 2041 | | |
2032 | 2042 | | |
2033 | 2043 | | |
2034 | | - | |
2035 | | - | |
2036 | | - | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
2037 | 2047 | | |
2038 | 2048 | | |
2039 | 2049 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
1079 | 1082 | | |
1080 | 1083 | | |
1081 | 1084 | | |
| |||
1129 | 1132 | | |
1130 | 1133 | | |
1131 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1132 | 1187 | | |
1133 | 1188 | | |
1134 | 1189 | | |
| |||
0 commit comments