I have a project that utilizes tuist for the main project file and pulls in all its dependencies from nested directories that contain local SPM packages.
Despite (seemingly) supplying all the relevant flags, tuist keeps creating a "Derived" folder with accessor code for the nested bundles. While I appreciate the intent, I do not want my module's namespace polluted.
Here's an excerpt from my Project.swift
let target = Target(
name: "App",
platform: .iOS,
product: .app,
productName: "App",
bundleId: "com.some.bundleId",
sources: [
"App/Sources/**/*.swift"
],
resources: [
"App/Resources/Assets.xcassets"
],
dependencies: [
.external(name: "ModuleA"),
.external(name: "ModuleB")
]
)
let project = Project(
name: "App",
options: .options(
disableBundleAccessors: true,
disableSynthesizedResourceAccessors: true
),
targets: [ target ],
resourceSynthesizers: []
)
Here's my Dependencies.swift
setup:
import ProjectDescription
let projects = [
"ModuleA",
"ModuleB"
]
let dependencies = Dependencies(
swiftPackageManager: SwiftPackageManagerDependencies(
projects.map { .package(path: .relativeToManifest($0)) },
projectOptions: projects.reduce(into: [:], { result, project in
result[project] = .options(
automaticSchemesOptions: .enabled(),
disableBundleAccessors: false,
disableShowEnvironmentVarsInScriptPhases: false,
disableSynthesizedResourceAccessors: false,
textSettings: .textSettings(
usesTabs: false,
indentWidth: 4,
tabWidth: 4,
wrapsLines: false
),
xcodeProjectName: project
)
})
),
platforms: [.iOS, .macOS, .tvOS, .watchOS]
)
Unfortunately this does not work due to the following error:
Target ModuleA_ios cannot contain resources. staticFramework targets do not support resources
Target ModuleB_ios cannot contain resources. staticFramework targets do not support resources
Fatal linting issues found
When I switch disableSynthesizedResourceAccessors
over to true
, generation works but all my SPM modules now have a Derived
folder with files like TuistBundle+ModuleAIos.swift
etc.
What's the recommended way to go about this problem here?
No response
13
3.21.1
14.3.1
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too