Merge pull request #293 from yonaskolb/root_files

Support adding root files
This commit is contained in:
Yonas Kolb
2018-04-12 23:07:10 +10:00
committed by GitHub
6 changed files with 21 additions and 7 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ Required properties are marked with checkbox. Some of the YAML examples don't sh
- [ ] **settings**: **[Settings](#settings)** - Project specific settings. Default base and config type settings will be applied first before any settings defined here
- [ ] **settingGroups**: **[Setting Groups](#setting-groups)** - Setting groups mapped by name
- [ ] **targets**: **[String: [Target](#target)]** - The list of targets in the project mapped by name
- [ ] **fileGroups**: **[String]** - A list of paths to add to the top level groups. These are files that aren't build files but that you'd like in the project hierachy. For example a folder xcconfig files that aren't already added by any target sources.
- [ ] **fileGroups**: **[String]** - A list of paths to add to the root of the project. These aren't files that will be included in your targets, but that you'd like to include in the project hierachy anyway. For example a folder of xcconfig files that aren't already added by any target sources, or a Readme file.
- [ ] **schemes**: **[Scheme](#scheme)** - A list of schemes by name. This allows more control over what is found in [Target Scheme](#target-scheme)
### Include
+12 -6
View File
@@ -48,8 +48,8 @@ class SourceGenerator {
// get groups without build files. Use for Project.fileGroups
func getFileGroups(path: String) throws {
// TODO: call a seperate function that only creates groups not source files
_ = try getGroupSources(targetSource: TargetSource(path: path), path: spec.basePath + path, isBaseGroup: true)
let fullPath = spec.basePath + path
_ = try getSourceFiles(targetSource: TargetSource(path: path), path: fullPath)
}
func generateSourceFile(targetSource: TargetSource, path: Path, buildPhase: BuildPhase? = nil) -> SourceFile {
@@ -440,11 +440,17 @@ class SourceGenerator {
let sourceFile = generateSourceFile(targetSource: targetSource, path: path)
let parentGroup = getGroup(path: parentPath, mergingChildren: [fileReference], createIntermediateGroups: createIntermediateGroups, isBaseGroup: true)
sourcePath = parentPath
if parentPath == spec.basePath {
sourcePath = path
sourceReference = fileReference
rootGroups.insert(fileReference)
} else {
let parentGroup = getGroup(path: parentPath, mergingChildren: [fileReference], createIntermediateGroups: createIntermediateGroups, isBaseGroup: true)
sourcePath = parentPath
sourceReference = parentGroup.reference
}
sourceFiles.append(sourceFile)
sourceReference = parentGroup.reference
case .group:
let (groupSourceFiles, groups) = try getGroupSources(targetSource: targetSource, path: path, isBaseGroup: true)
let group = groups.first!
View File
@@ -141,6 +141,7 @@
FR_172952167809 /* FrameworkFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrameworkFile.swift; sourceTree = "<group>"; };
FR_183521624014 /* MyFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyFramework.h; sourceTree = "<group>"; };
FR_196911129660 /* MoreUnder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoreUnder.swift; sourceTree = "<group>"; };
FR_232605427418 /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = "<group>"; };
FR_238161558082 /* MyBundle.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MyBundle.bundle; sourceTree = "<group>"; };
FR_247808626608 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FR_256263906698 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@@ -181,6 +182,7 @@
FR_748548478992 /* PushNotificationPayload.apns */ = {isa = PBXFileReference; lastKnownFileType = text; path = PushNotificationPayload.apns; sourceTree = "<group>"; };
FR_752394658615 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = "<group>"; };
FR_771029596306 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
FR_775316160345 /* SomeFile */ = {isa = PBXFileReference; path = SomeFile; sourceTree = "<group>"; };
FR_783122899910 /* App_iOS_Tests.xctest */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = App_iOS_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
FR_815403394914 /* Headers */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Headers; sourceTree = SOURCE_ROOT; };
FR_825232110500 /* App_iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = App_iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -414,7 +416,9 @@
G_6651250437419 /* StandaloneFiles */,
FR_479281060337 /* Folder */,
FR_815403394914 /* Headers */,
FR_232605427418 /* Mintfile */,
FR_257073931060 /* ResourceFolder */,
FR_775316160345 /* SomeFile */,
);
indentWidth = 2;
sourceTree = "<group>";
View File
+4
View File
@@ -10,6 +10,7 @@ options:
fileGroups:
- Configs
- FileGroup
- SomeFile
configFiles:
Test Debug: Configs/config.xcconfig
targets:
@@ -42,6 +43,9 @@ targets:
- path: Folder
type: folder
buildPhase: none
- path: Mintfile
type: file
buildPhase: none
settings:
INFOPLIST_FILE: App_iOS/Info.plist
PRODUCT_BUNDLE_IDENTIFIER: com.project.app