Merge branch 'master' into feature/current-directory-expander.yml

This commit is contained in:
Ell Neal 2019-01-27 12:37:51 +00:00
commit 032386e41c
No known key found for this signature in database
GPG Key ID: 0AAD6C98BA484C61
18 changed files with 637 additions and 32 deletions

View File

@ -3,12 +3,18 @@
## Master
#### Added
- Added new ability to generate empty directories via `options.generateEmptyDirectories` [#480](https://github.com/yonaskolb/XcodeGen/pull/480) @Beniamiiin
- Added ability to generate empty directories via `options.generateEmptyDirectories` [#480](https://github.com/yonaskolb/XcodeGen/pull/480) @Beniamiiin
- Added support for the `instrumentsPackage` product type [#482](https://github.com/yonaskolb/XcodeGen/pull/482) @ksulliva
- Added support for `inputFileLists` and `outputFileLists` within project build scripts [#500](https://github.com/yonaskolb/XcodeGen/pull/500) @lukewakeford
#### Fixed
- Fixed `--project` argument not taking effect [#487](https://github.com/yonaskolb/XcodeGen/pull/487) @monowerker
- Fixed Sticker Packs from generating an empty Source file phase which caused in error in the new build system [#492](https://github.com/yonaskolb/XcodeGen/pull/492) @rpassis
- Fixed generated schemes for tool targets not setting the executable [#496](https://github.com/yonaskolb/XcodeGen/pull/496) @yonaskolb
- Fixed resolving Carthage dependencies for iOS app with watchOS target. [465](https://github.com/yonaskolb/XcodeGen/pull/465) @raptorxcz
#### Changed
- Updated the Xcode compatability version from 3.2 to 9.3 [#497](https://github.com/yonaskolb/XcodeGen/pull/497) @yonaskolb
## 2.1.0

View File

@ -438,6 +438,8 @@ Each script can contain:
- [ ] **name**: **String** - name of a script. Defaults to `Run Script`
- [ ] **inputFiles**: **[String]** - list of input files
- [ ] **outputFiles**: **[String]** - list of output files
- [ ] **inputFileLists**: **[String]** - list of input .xcfilelist
- [ ] **outputFileLists**: **[String]** - list of output .xcfilelist
- [ ] **shell**: **String** - shell used for the script. Defaults to `/bin/sh`
- [ ] **showEnvVars**: **Bool** - whether the environment variables accessible to the script show be printed to the build log. Defaults to yes
- [ ] **runOnlyWhenInstalling**: **Bool** - whether the script is only run when installing (`runOnlyForDeploymentPostprocessing`). Defaults to no
@ -455,9 +457,13 @@ targets:
inputFiles:
- $(SRCROOT)/file1
- $(SRCROOT)/file2
inputFileLists:
- $(SRCROOT)/inputFiles.xcfilelist
outputFiles:
- $(DERIVED_FILE_DIR)/file1
- $(DERIVED_FILE_DIR)/file2
outputFileLists:
- $(SRCROOT)/outputFiles.xcfilelist
postCompileScripts:
- script: swiftlint
name: Swiftlint
@ -571,7 +577,7 @@ Schemes allows for more control than the convenience [Target Scheme](#target-sch
- [ ] **parallelizeBuild**: **Bool** - Whether or not your targets should be built in parallel. By default this is `true` if not set.
- `true`: Build targets in parallel
- `false`: Build targets serially
- [ ] **buildImplicitDependencies**: **Bool** - Flag to determine if Xcode should be implicit dependencies of this scheme. By default this is `true` if not set.
- [ ] **buildImplicitDependencies**: **Bool** - Flag to determine if Xcode should build implicit dependencies of this scheme. By default this is `true` if not set.
- `true`: Discover implicit dependencies of this scheme
- `false`: Only build explicit dependencies of this scheme

View File

@ -37,7 +37,7 @@ Debug and Release settings will be applied to your project. Targets will also ge
>You can change or disable how these setting presets are applied via the `options.settingPresets` which you can find more about in [Options](#options)
### Settings
The `project` and each `target` have a `settings` object that you can define. This can be a simple map of build settings or can provide build settings per `config` via `configs` or `base`. See [Settings](ProjectSpec#settings) for more details.
The `project` and each `target` have a `settings` object that you can define. This can be a simple map of build settings or can provide build settings per `config` via `configs` or `base`. See [Settings](ProjectSpec.md#settings) for more details.
```yaml
settings:
@ -56,7 +56,7 @@ targets:
```
### Setting Groups
Each `settings` can also reference one or more setting groups which let you reuse groups of build settings across targets or configurations. See [Setting Groups](ProjectSpec#setting-groups) for more details. Note that each setting group is also a full [Settings](ProjectSpec#settings) object, so you can reference other groups or define settings by config.
Each `settings` can also reference one or more setting groups which let you reuse groups of build settings across targets or configurations. See [Setting Groups](ProjectSpec.md#setting-groups) for more details. Note that each setting group is also a full [Settings](ProjectSpec.md#settings) object, so you can reference other groups or define settings by config.
```yaml
settingGroups:
@ -118,14 +118,14 @@ XcodeGen automatically creates the build phase that Carthage requires which list
```yaml
options:
carthageExecutablePath: mint run Carthage/Carthage carthage
carthageExecutablePath: mint run Carthage/Carthage carthage
```
By default XcodeGen looks for carthage frameworks in `Carthage/Build`. You can change this with the `carthageBuildPath` option
```yaml
options:
carthageBuildPath: ../../Carthage/Build
carthageBuildPath: ../../Carthage/Build
```
### SDK

View File

@ -15,7 +15,7 @@ let package = Package(
.package(url: "https://github.com/yonaskolb/JSONUtilities.git", from: "4.1.0"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0"),
.package(url: "https://github.com/onevcat/Rainbow.git", from: "3.0.0"),
.package(url: "https://github.com/tuist/xcodeproj.git", from: "6.3.0"),
.package(url: "https://github.com/tuist/xcodeproj.git", .exact("6.4.0")),
.package(url: "https://github.com/jakeheis/SwiftCLI.git", from: "5.2.0"),
],
targets: [

View File

@ -9,6 +9,8 @@ public struct BuildScript: Equatable {
public var shell: String?
public var inputFiles: [String]
public var outputFiles: [String]
public var inputFileLists: [String]
public var outputFileLists: [String]
public var runOnlyWhenInstalling: Bool
public let showEnvVars: Bool
@ -22,6 +24,8 @@ public struct BuildScript: Equatable {
name: String? = nil,
inputFiles: [String] = [],
outputFiles: [String] = [],
inputFileLists: [String] = [],
outputFileLists: [String] = [],
shell: String? = nil,
runOnlyWhenInstalling: Bool = false,
showEnvVars: Bool = true
@ -30,6 +34,8 @@ public struct BuildScript: Equatable {
self.name = name
self.inputFiles = inputFiles
self.outputFiles = outputFiles
self.inputFileLists = inputFileLists
self.outputFileLists = outputFileLists
self.shell = shell
self.runOnlyWhenInstalling = runOnlyWhenInstalling
self.showEnvVars = showEnvVars
@ -42,7 +48,9 @@ extension BuildScript: JSONObjectConvertible {
name = jsonDictionary.json(atKeyPath: "name")
inputFiles = jsonDictionary.json(atKeyPath: "inputFiles") ?? []
outputFiles = jsonDictionary.json(atKeyPath: "outputFiles") ?? []
inputFileLists = jsonDictionary.json(atKeyPath: "inputFileLists") ?? []
outputFileLists = jsonDictionary.json(atKeyPath: "outputFileLists") ?? []
if let string: String = jsonDictionary.json(atKeyPath: "script") {
script = .script(string)
} else {

View File

@ -35,7 +35,7 @@ extension PBXProductType {
}
public var isExecutable: Bool {
return isApp || isExtension || isTest
return isApp || isExtension || isTest || self == .commandLineTool
}
public var name: String {

View File

@ -27,7 +27,7 @@ public class PBXProjGenerator {
public init(project: Project) {
self.project = project
pbxProj = PBXProj(rootObject: nil, objectVersion: 46)
pbxProj = PBXProj(rootObject: nil, objectVersion: project.objectVersion)
sourceGenerator = SourceGenerator(project: project, pbxProj: pbxProj)
}
@ -88,7 +88,7 @@ public class PBXProjGenerator {
PBXProject(
name: project.name,
buildConfigurationList: buildConfigList,
compatibilityVersion: "Xcode 3.2",
compatibilityVersion: project.compatabilityVersion,
mainGroup: mainGroup,
developmentRegion: project.options.developmentLanguage ?? "en"
)
@ -289,6 +289,8 @@ public class PBXProjGenerator {
name: buildScript.name ?? "Run Script",
inputPaths: buildScript.inputFiles,
outputPaths: buildScript.outputFiles,
inputFileListPaths: buildScript.inputFileLists,
outputFileListPaths: buildScript.outputFileLists,
shellPath: buildScript.shell ?? "/bin/sh",
shellScript: shellScript,
runOnlyForDeploymentPostprocessing: buildScript.runOnlyWhenInstalling,
@ -665,8 +667,13 @@ public class PBXProjGenerator {
}
let sourcesBuildPhaseFiles = getBuildFilesForPhase(.sources)
let sourcesBuildPhase = addObject(PBXSourcesBuildPhase(files: sourcesBuildPhaseFiles))
buildPhases.append(sourcesBuildPhase)
// Sticker packs should not include a compile sources build phase as they
// are purely based on a set of image files, and nothing else.
let shouldSkipSourcesBuildPhase = sourcesBuildPhaseFiles.isEmpty && target.type == .stickerPack
if !shouldSkipSourcesBuildPhase {
let sourcesBuildPhase = addObject(PBXSourcesBuildPhase(files: sourcesBuildPhaseFiles))
buildPhases.append(sourcesBuildPhase)
}
buildPhases += try target.postCompileScripts.map { try generateBuildScript(targetName: target.name, buildScript: $0) }
@ -960,7 +967,13 @@ public class PBXProjGenerator {
frameworks[dependency.reference] = dependency
case .target:
if let projectTarget = project.getProjectTarget(dependency.reference) {
queue.append(projectTarget)
if let dependencyTarget = projectTarget as? Target {
if topLevelTarget.platform == dependencyTarget.platform {
queue.append(projectTarget)
}
} else {
queue.append(projectTarget)
}
}
default:
break

View File

@ -11,6 +11,14 @@ extension Project {
return "1.3"
}
var compatabilityVersion: String {
return "Xcode 9.3"
}
var objectVersion: UInt {
return 50
}
public func validateMinimumXcodeGenVersion(_ xcodeGenVersion: Version) throws {
if let minimumXcodeGenVersion = options.minimumXcodeGenVersion, xcodeGenVersion < minimumXcodeGenVersion {
throw SpecValidationError.ValidationError.invalidXcodeGenVersion(minimumVersion: minimumXcodeGenVersion, version: xcodeGenVersion)

View File

@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXAggregateTarget section */
@ -37,6 +37,7 @@
262B4F15CB0780B21C37D89F5EA9FE80 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A58A16491CDDF968B0D56DE7EB96D92 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
29A79F030DD325754FD2C82C4A6E0AE6 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C5AC2545AE4D4F7F44E2E9B53F03FF0 /* Result.framework */; };
2DE309130A6F5A7E2E7E13169357C316 /* MyFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A58A16491CDDF968B0D56DE7EB96D92 /* MyFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
2DFBC735559B5AC7702C7DD1F54FBFFE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9390121B4ECBB1B796C7CBBDD32C4DD4 /* Assets.xcassets */; };
319B977623307E83E948E9E4CEBB432E /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */; };
3474A5D469F41494C4CB871D75C77106 /* module.modulemap in CopyFiles */ = {isa = PBXBuildFile; fileRef = F2950763C4C568CC85021D185A35C1FB /* module.modulemap */; };
36152E299B36BCA0F25AD1FC9B002835 /* MoreUnder.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA8718C7CD3BE86D9B1F51203A548A51 /* MoreUnder.swift */; };
@ -114,6 +115,7 @@
F04CBE9A3D61F78E4FEE6A09AED606C0 /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */; };
F08C4D2A18A75CC292F45F1FB8E06CDE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 108BB29172D27BE3BD1E7F3536D14EAD /* Assets.xcassets */; };
F7ECF245988DABA0164DFF08607F6C31 /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D296BB7355994040E197A1EE5B41F583 /* Result.framework */; };
F96940D55B77163B7A5B04FB2B8AF458 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C033648A37D95027845BD34562053B /* main.swift */; };
FBDBC020EE959F32F0FF0E6252028356 /* Contacts.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB2B6A77D39CD5602F2125F01DEF025 /* Contacts.framework */; };
FE01CB2392794EC5CD44533920AA051B /* StaticLibrary_ObjC.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */; };
FE4C8407830C0189E1F61AFBEF16398B /* Result.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B76E17CE3574081D5BF45B449F3F46DB /* Result.framework */; };
@ -434,6 +436,7 @@
4BF4D16042A80576D259160C97AD2C2E /* Model 3.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 3.xcdatamodel"; sourceTree = "<group>"; };
4D0BF47DF71A6DBA33ED23FD22D023EF /* StaticLibrary_ObjC.a */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = archive.ar; path = StaticLibrary_ObjC.a; sourceTree = BUILT_PRODUCTS_DIR; };
5116B3B58070BCD09F1487BAFC210EE0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
564E35E83C95F5591345B7722A59AA4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
57FF8864B8EBAB5777DC12E62D66732F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
587B9E9A3533E965CA602B763210583F /* TestProjectUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestProjectUITests.swift; sourceTree = "<group>"; };
5A2B916A11DCC2565241359FD0114B0C /* StaticLibrary_ObjC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StaticLibrary_ObjC.h; sourceTree = "<group>"; };
@ -456,6 +459,8 @@
814822136AF3C64428D69DD62246E8A2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
8A9274BE42A03DC5DA1FAD04992ED6E3 /* Framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
8CAF6C55B555E3E1352645B630CCB23E /* ExtensionDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = "<group>"; };
9390121B4ECBB1B796C7CBBDD32C4DD4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
93C033648A37D95027845BD34562053B /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
9A87A926D563773658FB87FEEE4DD132 /* iMessageApp.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = iMessageApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
9F27382DD66E26C059E26EFE8D6BEF4D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
A0DC40025AB59B688E758829FB7EDB95 /* Framework2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Framework2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@ -469,7 +474,9 @@
B76E17CE3574081D5BF45B449F3F46DB /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = "<group>"; };
BA040F1F7D6CA08878323A551349F18D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
BB178D03E75929F3F5B10C56838882EC /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Result.framework; sourceTree = "<group>"; };
BECEA4A483ADEB8158F640B356D10090 /* Tool */ = {isa = PBXFileReference; includeInIndex = 0; path = Tool; sourceTree = BUILT_PRODUCTS_DIR; };
C2F3574CCEF023755DDB1A06C6FE315C /* Mintfile */ = {isa = PBXFileReference; path = Mintfile; sourceTree = "<group>"; };
C53ACB2962FED621389C36A2E1AE6E28 /* iMessageStickersExtension.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = iMessageStickersExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
C5ABEA2284F13483EFDF7C0E050F0450 /* MessagesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessagesViewController.swift; sourceTree = "<group>"; };
C7809CE9FE9852C2AA87ACE57B5DEF9E /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.module; path = module.modulemap; sourceTree = "<group>"; };
C934C1F7A68CCD0AB6B384782470EE7B /* NotificationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationController.swift; sourceTree = "<group>"; };
@ -641,10 +648,12 @@
1A57D1EE1FBC13598F6B5CB018E7D348 /* Framework */,
B370CE9C04C41EBC52D4E4EA1F3EB767 /* iMessage */,
0A989C35EEBD58B9B98C41A75CE9CE00 /* iMessage MessagesExtension */,
D1B8D50CE1D32597CD569AB52E84F9C2 /* iMessage Stickers */,
9EDF27BB8A57733E6639D36D66958B76 /* Resources */,
9DB22CB08CFAA455518700DBA5CAD7DE /* StandaloneFiles */,
BDA839814AF73F01F771051894A708E8 /* StaticLibrary_ObjC */,
CBDAC144248EE9D3838C6AAA35F55CB5 /* StaticLibrary_Swift */,
8CFD8AD4820FAB9265663F9203506239 /* Tool */,
3FEA12CF227D41EF50E5C2DB21B84FBB /* Vendor */,
80C3A0E524EC1ABCB9149EA22136F282 /* XPC Service */,
FC60FF5527FEDF545816FFCF26619677 /* Folder */,
@ -734,6 +743,14 @@
path = "XPC Service";
sourceTree = "<group>";
};
8CFD8AD4820FAB9265663F9203506239 /* Tool */ = {
isa = PBXGroup;
children = (
93C033648A37D95027845BD34562053B /* main.swift */,
);
path = Tool;
sourceTree = "<group>";
};
912A7321F662FE41BAAEED67F628711F /* Mac */ = {
isa = PBXGroup;
children = (
@ -778,11 +795,13 @@
AB055761199DF36DB0C629A608A4EF3A /* Framework2.framework */,
9A87A926D563773658FB87FEEE4DD132 /* iMessageApp.app */,
D629E142AB87C681D4EC90F7106F7299 /* iMessageExtension.appex */,
C53ACB2962FED621389C36A2E1AE6E28 /* iMessageStickersExtension.appex */,
4D0BF47DF71A6DBA33ED23FD22D023EF /* StaticLibrary_ObjC.a */,
056A43A09CE7E88D578696D83330E45F /* StaticLibrary_ObjC.a */,
1313F043F19B484A5046E0748579814C /* StaticLibrary_ObjC.a */,
EF92E90B6F1D583382BD85BEE4CD1896 /* StaticLibrary_ObjC.a */,
D8D8907E2CDA1295D0D94F53FCD6939F /* StaticLibrary_Swift.a */,
BECEA4A483ADEB8158F640B356D10090 /* Tool */,
22237B8EBD9E6BE8EBC8735F5AA17192 /* XPC Service.xpc */,
);
name = Products;
@ -825,6 +844,15 @@
path = StaticLibrary_Swift;
sourceTree = "<group>";
};
D1B8D50CE1D32597CD569AB52E84F9C2 /* iMessage Stickers */ = {
isa = PBXGroup;
children = (
9390121B4ECBB1B796C7CBBDD32C4DD4 /* Assets.xcassets */,
564E35E83C95F5591345B7722A59AA4E /* Info.plist */,
);
path = "iMessage Stickers";
sourceTree = "<group>";
};
D557819B1EE5B42A0A3DD4D1F3D982C4 /* tvOS */ = {
isa = PBXGroup;
children = (
@ -1013,6 +1041,21 @@
productReference = B1C33BB070583BE3B0EC0E68083FE89C /* App_iOS.app */;
productType = "com.apple.product-type.application";
};
090315A24AC8E8B8F318A709B9288671 /* Tool */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7881E73F05F096623E59204004CF8E23 /* Build configuration list for PBXNativeTarget "Tool" */;
buildPhases = (
2235AD7DEFC8FE534AB91B38BDF26FA4 /* Sources */,
);
buildRules = (
);
dependencies = (
);
name = Tool;
productName = Tool;
productReference = BECEA4A483ADEB8158F640B356D10090 /* Tool */;
productType = "com.apple.product-type.tool";
};
13E8C5AB873CEE21E18E552F5E94B768 /* StaticLibrary_ObjC_iOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = 56BF985F253DD84AD7C3753800E07F6D /* Build configuration list for PBXNativeTarget "StaticLibrary_ObjC_iOS" */;
@ -1029,6 +1072,21 @@
productReference = 4D0BF47DF71A6DBA33ED23FD22D023EF /* StaticLibrary_ObjC.a */;
productType = "com.apple.product-type.library.static";
};
192C574D74079A99AF1AD0B16DEF8F76 /* iMessageStickersExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = B40D2F785317445D9A9C8C122B3BFFD3 /* Build configuration list for PBXNativeTarget "iMessageStickersExtension" */;
buildPhases = (
AA12B5909FEE45016F469C78D3F4941B /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = iMessageStickersExtension;
productName = iMessageStickersExtension;
productReference = C53ACB2962FED621389C36A2E1AE6E28 /* iMessageStickersExtension.appex */;
productType = "com.apple.product-type.app-extension.messages-sticker-pack";
};
19BFB84599B0AA1275A9662DCB5C0E50 /* StaticLibrary_Swift */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4A036BD16A0E9D22AE065AC9D8232B5B /* Build configuration list for PBXNativeTarget "StaticLibrary_Swift" */;
@ -1377,7 +1435,7 @@
};
};
buildConfigurationList = D91E14E36EC0B415578456F264E0161E /* Build configuration list for PBXProject "Project" */;
compatibilityVersion = "Xcode 3.2";
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
@ -1409,9 +1467,11 @@
7D3D92034F4F203C140574F08DF5F38F /* StaticLibrary_ObjC_watchOS */,
19BFB84599B0AA1275A9662DCB5C0E50 /* StaticLibrary_Swift */,
BF3693DCA6182D7AEC410AFC08078F33 /* SuperTarget */,
090315A24AC8E8B8F318A709B9288671 /* Tool */,
E7815F2F0D9CDECF9185AAF3A6B474C1 /* XPC Service */,
834F55973F05AC8A18144DB04FF6F2C7 /* iMessageApp */,
1C26A6A0BC446191F311D470FDFF54F8 /* iMessageExtension */,
192C574D74079A99AF1AD0B16DEF8F76 /* iMessageStickersExtension */,
);
};
/* End PBXProject section */
@ -1468,6 +1528,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
AA12B5909FEE45016F469C78D3F4941B /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2DFBC735559B5AC7702C7DD1F54FBFFE /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
B7B71FA7D279029BF7A7FC7C08E41BB0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@ -1533,9 +1601,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1547,9 +1619,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1561,9 +1637,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Strip Unused Architectures from Frameworks";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 1;
@ -1575,9 +1655,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1589,9 +1673,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1603,9 +1691,15 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
inputList.xcfilelist,
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
outputList.xcfilelist,
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1617,9 +1711,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = MyScript;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
@ -1654,6 +1752,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
2235AD7DEFC8FE534AB91B38BDF26FA4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F96940D55B77163B7A5B04FB2B8AF458 /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
247A4E3947EC2AFB733A1B00BCEF9EC2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@ -2336,6 +2442,16 @@
};
name = "Production Release";
};
18B5349AE18B7183BE4B43630876517C /* Staging Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Staging Release";
};
196FEEE6C4B0DDE53AD16BD6E5645F0E /* Test Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -2640,6 +2756,16 @@
};
name = "Production Debug";
};
436FB4981A66822DAF6F22ACC8B60E23 /* Production Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Production Debug";
};
4621C6C8A78FBB1CF4078178688742F9 /* Production Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -2993,6 +3119,17 @@
};
name = "Production Debug";
};
59416DBF97224D8A1B28D6102CE1A723 /* Production Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Production Release";
};
5A9C67C1F423247AE1541F63C53C88B5 /* Test Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3411,6 +3548,16 @@
};
name = "Test Debug";
};
921EC740167F616C38809275FD6C52C9 /* Production Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Production Release";
};
92602C025633FBA848F91812F4CD6D45 /* Production Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3526,6 +3673,16 @@
};
name = "Production Debug";
};
98A87959E6B746416846959429725DCB /* Staging Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Staging Debug";
};
9A891313A139893990989BDDFA989F3A /* Test Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3557,6 +3714,17 @@
};
name = "Production Release";
};
9E0CC963DE7E2ED71A4C16C1DC243AD9 /* Staging Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Staging Debug";
};
9E38571B33C3CE5CA10C8452AE897DF8 /* Staging Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3604,6 +3772,17 @@
};
name = "Test Debug";
};
A0C50DBBF4AC5D30C92B19F78B9CC141 /* Test Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Test Release";
};
A2EBD902E6DE2B2BD12C4484D36B6B76 /* Production Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3903,6 +4082,17 @@
};
name = "Production Debug";
};
B4297CD61108CE066C29984455AA0CE0 /* Staging Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Staging Release";
};
B928E061A126AC8D17D81D1E4DC11629 /* Staging Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -3962,6 +4152,27 @@
};
name = "Test Release";
};
BF2F04729CC0602591655B251D13DD47 /* Production Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Production Debug";
};
C00DBF60DC8C1A570738241F19D127F9 /* Test Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Test Release";
};
C0D5765142C68AF68B954B3F748538C2 /* Production Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -4136,6 +4347,16 @@
};
name = "Test Release";
};
CA45EC48C1EDE1A41141A103C7CE467A /* Test Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.Tool;
SDKROOT = macosx;
};
name = "Test Debug";
};
CBE9D80AD0719511A13A889E867077CC /* Staging Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -4718,6 +4939,17 @@
};
name = "Staging Release";
};
FC4A8130B924FC04E9190AB603D97A24 /* Test Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
INFOPLIST_FILE = "IMessage Stickers/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.project.iMessageStickersExtension;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = "Test Debug";
};
FE029D76C57D0661E4B8F13B132169CA /* Staging Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
@ -4935,6 +5167,19 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
};
7881E73F05F096623E59204004CF8E23 /* Build configuration list for PBXNativeTarget "Tool" */ = {
isa = XCConfigurationList;
buildConfigurations = (
436FB4981A66822DAF6F22ACC8B60E23 /* Production Debug */,
921EC740167F616C38809275FD6C52C9 /* Production Release */,
98A87959E6B746416846959429725DCB /* Staging Debug */,
18B5349AE18B7183BE4B43630876517C /* Staging Release */,
CA45EC48C1EDE1A41141A103C7CE467A /* Test Debug */,
C00DBF60DC8C1A570738241F19D127F9 /* Test Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
};
7CBF487CACC0BBFB530D79633BC124AA /* Build configuration list for PBXAggregateTarget "SuperTarget" */ = {
isa = XCConfigurationList;
buildConfigurations = (
@ -4987,6 +5232,19 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
};
B40D2F785317445D9A9C8C122B3BFFD3 /* Build configuration list for PBXNativeTarget "iMessageStickersExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BF2F04729CC0602591655B251D13DD47 /* Production Debug */,
59416DBF97224D8A1B28D6102CE1A723 /* Production Release */,
9E0CC963DE7E2ED71A4C16C1DC243AD9 /* Staging Debug */,
B4297CD61108CE066C29984455AA0CE0 /* Staging Release */,
FC4A8130B924FC04E9190AB603D97A24 /* Test Debug */,
A0C50DBBF4AC5D30C92B19F78B9CC141 /* Test Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "";
};
BE0FF81B67730F081F45BC783F30F309 /* Build configuration list for PBXLegacyTarget "Legacy" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "090315A24AC8E8B8F318A709B9288671"
BuildableName = "Tool"
BlueprintName = "Tool"
ReferencedContainer = "container:Project.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Production Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "090315A24AC8E8B8F318A709B9288671"
BuildableName = "Tool"
BlueprintName = "Tool"
ReferencedContainer = "container:Project.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Production Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "090315A24AC8E8B8F318A709B9288671"
BuildableName = "Tool"
BlueprintName = "Tool"
ReferencedContainer = "container:Project.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Production Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "090315A24AC8E8B8F318A709B9288671"
BuildableName = "Tool"
BlueprintName = "Tool"
ReferencedContainer = "container:Project.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Production Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Production Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -112,6 +112,10 @@ targets:
- name: MyScript
script: |
echo "You ran a script!"
inputFileLists:
- inputList.xcfilelist
outputFileLists:
- outputList.xcfilelist
App_watchOS:
type: application.watchapp2
@ -151,6 +155,12 @@ targets:
settings:
PRODUCT_BUNDLE_IDENTIFIER: com.project.iMessageApp.extension
iMessageStickersExtension:
type: app-extension.messages-sticker-pack
platform: iOS
sources:
- path: iMessage Stickers
StaticLibrary_ObjC:
type: library.static
platform: [iOS, tvOS, watchOS, macOS]
@ -206,6 +216,12 @@ targets:
sources:
- path: XPC Service
Tool:
type: tool
platform: macOS
sources: [Tool]
scheme: {}
schemes:
Framework:
build:

View File

@ -552,7 +552,20 @@ class ProjectGeneratorTests: XCTestCase {
iosFrameworkB.filename,
])
let targets = [app, iosFrameworkZ, staticLibrary, resourceBundle, iosFrameworkA, iosFrameworkB, appTest, appTestWithoutTransitive]
let stickerPack = Target(
name: "MyStickerApp",
type: .stickerPack,
platform: .iOS,
dependencies: [
Dependency(type: .sdk, reference: "NotificationCenter.framework")
]
)
expectedResourceFiles[stickerPack.name] = nil
expectedLinkedFiles[stickerPack.name] = Set([
"NotificationCenter.framework"
])
let targets = [app, iosFrameworkZ, staticLibrary, resourceBundle, iosFrameworkA, iosFrameworkB, appTest, appTestWithoutTransitive, stickerPack]
let project = Project(
basePath: "",
@ -566,19 +579,28 @@ class ProjectGeneratorTests: XCTestCase {
guard let nativeTarget = pbxProject.nativeTargets.first(where: { $0.name == target.name }) else {
throw failure("PBXNativeTarget for \(target) not found")
}
let buildPhases = nativeTarget.buildPhases
let resourcesPhases = pbxProject.resourcesBuildPhases.filter { buildPhases.contains($0) }
let frameworkPhases = pbxProject.frameworksBuildPhases.filter { buildPhases.contains($0) }
let copyFilesPhases = pbxProject.copyFilesBuildPhases.filter { buildPhases.contains($0) }
// ensure only the right resources are copies, no more, no less
let expectedResourceFiles = expectedResourceFiles[target.name]!
try expect(resourcesPhases.count) == (expectedResourceFiles.isEmpty ? 0 : 1)
if !expectedResourceFiles.isEmpty {
let resourceFiles = resourcesPhases[0].files
.compactMap { $0.file }
.map { $0.nameOrPath }
try expect(Set(resourceFiles)) == expectedResourceFiles
// All targets should have a compile sources phase,
// except for the sticker pack one
let sourcesPhases = pbxProject.sourcesBuildPhases
try expect(sourcesPhases.count) == targets.count - 1
// ensure only the right resources are copied, no more, no less
if let expectedResourceFiles = expectedResourceFiles[target.name] {
try expect(resourcesPhases.count) == (expectedResourceFiles.isEmpty ? 0 : 1)
if !expectedResourceFiles.isEmpty {
let resourceFiles = resourcesPhases[0].files
.compactMap { $0.file }
.map { $0.nameOrPath }
try expect(Set(resourceFiles)) == expectedResourceFiles
}
} else {
try expect(resourcesPhases.count) == 0
}
// ensure only the right things are linked, no more, no less
@ -591,12 +613,15 @@ class ProjectGeneratorTests: XCTestCase {
}
// ensure only the right things are embedded, no more, no less
let expectedEmbeddedFrameworks = expectedEmbeddedFrameworks[target.name]!
try expect(copyFilesPhases.count) == (expectedEmbeddedFrameworks.isEmpty ? 0 : 1)
if !expectedEmbeddedFrameworks.isEmpty {
let copyFiles = copyFilesPhases[0].files
.compactMap { $0.file?.nameOrPath }
try expect(Set(copyFiles)) == expectedEmbeddedFrameworks
if let expectedEmbeddedFrameworks = expectedEmbeddedFrameworks[target.name] {
try expect(copyFilesPhases.count) == (expectedEmbeddedFrameworks.isEmpty ? 0 : 1)
if !expectedEmbeddedFrameworks.isEmpty {
let copyFiles = copyFilesPhases[0].files
.compactMap { $0.file?.nameOrPath }
try expect(Set(copyFiles)) == expectedEmbeddedFrameworks
}
} else {
try expect(copyFilesPhases.count) == 0
}
}
}

View File

@ -517,6 +517,23 @@ class SourceGeneratorTests: XCTestCase {
try expect(sourcesBuildPhase.files.count) == 1
}
$0.it("add only carthage dependencies with same platform") {
let directories = """
A:
- file.swift
"""
try createDirectories(directories)
let watchTarget = Target(name: "Watch", type: .watch2App, platform: .watchOS, sources: ["A"], dependencies: [Dependency(type: .carthage, reference: "Alamofire_watch")])
let watchDependency = Dependency(type: .target, reference: "Watch")
let target = Target(name: "Test", type: .application, platform: .iOS, sources: ["A"], dependencies: [Dependency(type: .carthage, reference: "Alamofire"), watchDependency])
let project = Project(basePath: directoryPath, name: "Test", targets: [target, watchTarget])
let pbxProj = try project.generatePbxProj()
let carthagePhase = pbxProj.nativeTargets.first(where: { $0.name == "Test" })?.buildPhases.first(where: { $0 is PBXShellScriptBuildPhase }) as? PBXShellScriptBuildPhase
try expect(carthagePhase?.inputPaths) == ["$(SRCROOT)/Carthage/Build/iOS/Alamofire.framework"]
}
$0.it("derived directories are sorted last") {
let directories = """
A:

View File

@ -556,6 +556,8 @@ class SpecLoadingTests: XCTestCase {
["path": "script.sh"],
["script": "shell script\ndo thing", "name": "myscript", "inputFiles": ["file", "file2"], "outputFiles": ["file", "file2"], "shell": "bin/customshell", "runOnlyWhenInstalling": true],
["script": "shell script\ndo thing", "name": "myscript", "inputFiles": ["file", "file2"], "outputFiles": ["file", "file2"], "shell": "bin/customshell", "showEnvVars": false],
["script": "shell script\nwith file lists", "name": "myscript", "inputFileLists": ["inputList.xcfilelist"], "outputFileLists": ["outputList.xcfilelist"], "shell": "bin/customshell", "runOnlyWhenInstalling": true],
["script": "shell script\nwith file lists", "name": "myscript", "inputFileLists": ["inputList.xcfilelist"], "outputFileLists": ["outputList.xcfilelist"], "shell": "bin/customshell", "showEnvVars": false]
]
target["preBuildScripts"] = scripts
target["postCompileScripts"] = scripts
@ -565,6 +567,8 @@ class SpecLoadingTests: XCTestCase {
BuildScript(script: .path("script.sh")),
BuildScript(script: .script("shell script\ndo thing"), name: "myscript", inputFiles: ["file", "file2"], outputFiles: ["file", "file2"], shell: "bin/customshell", runOnlyWhenInstalling: true, showEnvVars: true),
BuildScript(script: .script("shell script\ndo thing"), name: "myscript", inputFiles: ["file", "file2"], outputFiles: ["file", "file2"], shell: "bin/customshell", runOnlyWhenInstalling: false, showEnvVars: false),
BuildScript(script: .script("shell script\nwith file lists"), name: "myscript", inputFileLists: ["inputList.xcfilelist"], outputFileLists: ["outputList.xcfilelist"], shell: "bin/customshell", runOnlyWhenInstalling: true, showEnvVars: true),
BuildScript(script: .script("shell script\nwith file lists"), name: "myscript", inputFileLists: ["inputList.xcfilelist"], outputFileLists: ["outputList.xcfilelist"], shell: "bin/customshell", runOnlyWhenInstalling: false, showEnvVars: false),
]
let parsedTarget = try Target(name: "test", jsonDictionary: target)