Comments (3)
Hey 👋
The best way to do this is to use a setting variable: #2521 (comment)
In this issue, there's a description why what you're trying to do does not work.
I am closing this because there's no action item for us.
from tuist.
@christoschadjikyriakou have you tried to pass "" to bundleId in Target init?
from tuist.
@christoschadjikyriakou here is a working example of what, I believe, you are trying to reach. This is a simplified version of the project that I'm working on to migrate from "multiple targets" to "one target with multiple configurations" way (I also supply configurations with xcconfigs, pass different AppIcon's per config etc.)
Project.swift
import ProjectDescription
// Use Debug & Release instead of Debug-Prod & Release-Prod
let configurations: [Configuration] = [
.debug(name: "Debug-Dev", settings: ["PRODUCT_BUNDLE_IDENTIFIER": "com.mycompany.myapp.dev"]),
.debug(name: "Debug", settings: ["PRODUCT_BUNDLE_IDENTIFIER": "com.mycompany.myapp"]),
.release(name: "Release-Dev", settings: ["PRODUCT_BUNDLE_IDENTIFIER": "com.mycompany.myapp.dev"]),
.release(name: "Release", settings: ["PRODUCT_BUNDLE_IDENTIFIER": "com.mycompany.myapp"])
]
let project = Project(
name: "MyApp",
settings: .settings(configurations: configurations), // configs array must go here
targets: [
.target(
name: "MyApp",
destinations: .iOS,
product: .app,
bundleId: "",
infoPlist: "Info.plist",
sources: ["MyApp/Sources/**"],
resources: ["MyApp/Resources/**"],
dependencies: [],
settings: .settings(configurations: configurations) // and here
)
],
schemes: [
.scheme(
name: "Development",
buildAction: .buildAction(targets: ["MyApp"]),
testAction: .targets(["MyApp"]),
runAction: .runAction(configuration: "Debug-Dev"),
archiveAction: .archiveAction(configuration: "Release-Dev")
),
.scheme(
name: "Production",
buildAction: .buildAction(targets: ["MyApp"]),
testAction: .targets(["MyApp"]),
runAction: .runAction(configuration: "Debug"),
archiveAction: .archiveAction(configuration: "Release")
)
]
)
Workspace.swift (to prevent Tuist from autogenerating extra schemes)
import ProjectDescription
let workspace = Workspace(
name: "MyApp",
projects: [
"."
],
generationOptions: .options(autogeneratedWorkspaceSchemes: .disabled)
)
Also, if you have SPM dependencies, you have to describe the same list of configurations in the package manifest.
Package.swift
#if TUIST
import struct ProjectDescription.PackageSettings
let packageSettings = PackageSettings(baseSettings: .settings(configurations: [
.debug(name: "Debug-dev"),
.release(name: "Release-dev"),
.debug(name: "Debug"),
.release(name: "Release"),
]))
#endif
@fortmarek fyi
from tuist.
Related Issues (20)
- Preprocessor Macros (Release and Debug) HOT 1
- Tuist generate fails when Tuist Cloud is configured and the server is down or local workstation facing network issue
- tuist generate fails when using cached binaries built with different macos version HOT 3
- Generated TuistBundle+* files have bad formatting HOT 4
- App extensions can't have bundles as dependencies HOT 2
- mise no tasks `lint:fix` found, which is migrated to `lint-fix`
- The xcframework supports archive formats, such as `.zip`, `.tar`... HOT 5
- Mono repo - App + Framework + Macro HOT 2
- Running `tuist clean` no longer seems to clean anything
- Using Tuist with a Swift Package could not locate project HOT 3
- Is it possible to support multiple platforms for test target HOT 1
- error: missing required module 'RxCocoaRuntime' HOT 1
- ObjC code not linked unless `-ObjC` flag is manually added HOT 3
- Upload .xcresult bundle after tuist cache
- Fix selective testing when run for a specific target
- Pass environment through mapper
- Not output the report URL when a command outputs machine-readable content
- Unable to delete Tuist Cloud project when specifying project in format `<org_name>/<project_name>`
- Error thrown when trying to delete a project in Tuist Cloud HOT 5
- Quick's QuickObjcRuntime target is not included in the list of targets that need testing search paths
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tuist.