Describe the bug
If the product name is defined with a build setting instead of using the productName
param, it's not considered to calculate the TEST_HOST
path in the test target. Due to that, the test target can't find the host application.
To Reproduce
In the manifest define two targets with this config:
let project2 = Project(
name: "TestHostApp",
targets: [
Target(
name: "TestHostApp",
platform: .iOS,
product: .app,
bundleId: "org.juanpecatalan.TestHostApp",
infoPlist: .default,
sources: "App/Sources/**",
resources: "App/Resources/**",
settings: Settings(
configurations: [
.debug(name: "Debug", settings: ["PRODUCT_NAME": "JPTestHostApp"])
]
)
),
Target(
name: "TestHostAppTests",
platform: .iOS,
product: .unitTests,
bundleId: "org.juanpecatalan.TestHostAppTests",
infoPlist: .default,
sources: "App/Tests/**",
dependencies: [
.target(name: "TestHostApp")
]
)
]
)
But if I pass the product name as param in the constructor, it works fine:
let project2 = Project(
name: "TestHostApp",
targets: [
Target(
name: "TestHostApp",
platform: .iOS,
product: .app,
productName: "JPTestHostApp",
bundleId: "org.juanpecatalan.TestHostApp",
infoPlist: .default,
sources: "App/Sources/**",
resources: "App/Resources/**"
),
Target(
name: "TestHostAppTests",
platform: .iOS,
product: .unitTests,
bundleId: "org.juanpecatalan.TestHostAppTests",
infoPlist: .default,
sources: "App/Tests/**",
dependencies: [
.target(name: "TestHostApp")
]
)
]
)
Expected behavior
The test targets have well configured the host application.
Maybe the TargetGenerator
should consider updating the product name after loading the build settings.
Screenshots
Host application well configured
Desktop
Additional context
TestHostAppWithHost.zip
TestHostAppWithoutHost.zip
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