TemplateInfo.plist for target in subdirectory

Hello,


I want to create an Xcode project template (Target only) but i don't know how to do.


I just want to create my Target in a subdirectory, not in the root directory of the project.

(When i say "subdirectory", i want my target inside a "Finder" directory, not inside Xcode Group)


I don't know how to do it, if it's possible.


Someone can help me ??

Where can i find TemplateInfo.plist complete documentation ?


Thanks

Replies

Are you trying to build a project template, or a target template? A project can be placed anywhere in the file system. Targets are placed in sub-directories (real sub-directories) in the project directory.


There are resources on the Internet, including references to Apple's archive, for understanding TemplateInfo plists. But, the best way to learn is to look at the Apple templates.

I have created a Xcode Target template (Project template inside '~/Library/Developer/Xcode/Templates/Project Templates/iOS/Framework & Library/My Component Template.xctemplate' with


TargetOnly

in my TemplateInfo.plist)


The context is the follow :

I write many application with the same Design. So I have writted a common UI framework (an extension of Material Design Components) used by all my application.

In my UI framework, i have many component and one target by component ( + one target "Core" for common classes of all component). For more visibility, I use the same architecture than Material Components :

All my target are in a subdirectory called "components" (but in the root directory in Xcode)



.

├── My UI Project.xcodeproj

└── components

├── Core

│ ├── Core.h

│ ├── Info.plist

│ ├── src

│ └── tests

│ ├── CoreTests.swift

│ └── Info.plist

├── Component1

│ ├── Component1.h

│ ├── Info.plist

│ ├── src

│ └── tests

│ ├── Component1Tests.swift

│ └── Info.plist

├── Component2

│ ├── Component2.h

│ ├── Info.plist

│ ├── src

│ └── tests

│ ├── Component2Tests.swift

│ └── Info.plist

└── Component3

├── Info.plist

├── Component3.h

├── src

└── tests

├── Info.plist

└── Component3Tests.swift



My problem: today, whene a want create new component, I need create new target in Xcode, move manualy the folder creeated in the components directory, and edit the 'My UI Project.xcodeproj/project.pbxproj' file for correct the path of Info.plist.


I want something to automate these actions. I prefere an Xcode template but if it's not possible, i will write a fastlane/ruby script for this.