The Xcode Plugin generate files that are used by the Xcode IDE to open Gradle projects into Xcode (File - Open…). The generated Xcode project delegates build actions to Gradle.
What exactly the xcode plugin generates depends on which other plugins are used:
| Plugin | Description |
|---|---|
None |
Generates minimal solution file. |
Adds a target representing the C++ application to the project file. |
|
Adds a target for each specified linkage representing the shared and/or static library to the project file. |
|
Adds a target representing the Swift application to the project file. |
|
Adds a target for each specified linkage representing the shared and/or static library to the project file. |
|
Adds a target representing the XCTest bundle to the project file. |
Usage
plugins {
id 'xcode'
}
plugins {
xcode
}
Tasks
The Xcode Plugin adds a number of tasks to your project.
The main tasks that you will use are the xcode, cleanXcode and openXcode tasks.
The following diagram shows the relationships between tasks added by this plugin.
Lifecycle Tasks
xcode— Task-
Depends on:
projectNameXcodeWorkspaceand allxcodeProjecttasksGenerates all Xcode configuration files.
cleanXcode— Delete-
Depends on: all Xcode project and workspace file clean tasks
Removes all Xcode configuration files.
openXcode- Task-
Depends on:
xcodeOpen the Xcode workspace inside the IDE.
IDE Workspace Tasks
xcodeWorkspaceWorkspaceSettings- GenerateWorkspaceSettingsFileTask-
Generates the
projectName.xcworkspacefile. This task is only available on the root project. xcodeWorkspace- GenerateXcodeProjectFileTask-
Depends on:
xcodeWorkspaceWorkspaceSettingsGenerates the
projectName.xcworkspacefile. This task is only available on the root project.
IDE Project Tasks
Both the C++ Application Plugin and C++ Library Plugin introduce the same tasks for generating Xcode projects to be included in an Xcode workspace.
xcodeProjectWorkspaceSettings— GenerateWorkspaceSettingsFileTask-
Generates the
projectName.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettingsfile. xcodeScheme— GenerateSchemeFileTask-
Generates the
projectName.xcodeproj/xcshareddata/xcschemes/ProjectName.xcschemefile. xcodeProject— GenerateXcodeProjectFileTask-
Depends on:
xcodeProjectWorkspaceSettingsandxcodeScheme(if buildable binary present)Generates the
projectName.xcodeproj/project.pbxprojfile.
Configuration
The Xcode Plugin doesn’t allows any customization of the generated files.