Added Struct-based project config

This commit is contained in:
Maxim Khatskevich 2017-08-28 22:16:14 +05:00
parent 40b16b4a7c
commit 64500eeb24
37 changed files with 5283 additions and 125 deletions

125
Cakefile
View File

@ -1,125 +0,0 @@
# https://github.com/jcampbell05/xcake
# http://www.rubydoc.info/github/jcampbell05/xcake/master/file/docs/Cakefile.md
iOSdeploymentTarget = "8.0"
currentSwiftVersion = "3.0"
companyIdentifier = "khatskevich.maxim"
developmentTeamId = "UJA88X59XP"
testSuffix = "Tst"
#===
project.name = "MKHAPIClient"
project.class_prefix = "APC"
project.organization = "Maxim Khatskevich"
#===
project.all_configurations.each do |configuration|
configuration.settings["SDKROOT"] = "iphoneos"
configuration.settings["DEBUG_INFORMATION_FORMAT"] = "dwarf"
configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = ""
configuration.settings["TARGETED_DEVICE_FAMILY"] = "1,2"
configuration.settings["IPHONEOS_DEPLOYMENT_TARGET"] = iOSdeploymentTarget
configuration.settings["VERSIONING_SYSTEM"] = "apple-generic"
configuration.settings["GCC_NO_COMMON_BLOCKS"] = "YES"
configuration.settings["GCC_WARN_ABOUT_RETURN_TYPE"] = "YES_ERROR"
configuration.settings["GCC_WARN_UNINITIALIZED_AUTOS"] = "YES_AGGRESSIVE"
configuration.settings["CLANG_WARN_DIRECT_OBJC_ISA_USAGE"] = "YES_ERROR"
configuration.settings["CLANG_WARN_OBJC_ROOT_CLASS"] = "YES_ERROR"
configuration.settings["SWIFT_OPTIMIZATION_LEVEL"] = "-Onone"
configuration.settings["CURRENT_PROJECT_VERSION"] = "1" # just default non-empty value
configuration.settings["CLANG_WARN_INFINITE_RECURSION"] = "YES" # Xcode 8
configuration.settings["CLANG_WARN_SUSPICIOUS_MOVE"] = "YES" # Xcode 8
configuration.settings["ENABLE_STRICT_OBJC_MSGSEND"] = "YES" # Xcode 8
#===
if configuration.name == "Release"
configuration.settings["DEBUG_INFORMATION_FORMAT"] = "dwarf-with-dsym"
configuration.settings["SWIFT_OPTIMIZATION_LEVEL"] = "-Owholemodule" # Xcode 8
end
end
#=== Targets
target do |target|
target.name = project.name
target.type = :framework
target.language = :swift
target.platform = :ios
target.deployment_target = iOSdeploymentTarget
target.all_configurations.each do |configuration|
#=== Build Settings - Core
configuration.product_bundle_identifier = companyIdentifier + "." + target.name
configuration.settings["INFOPLIST_FILE"] = "Info/" + target.name + ".plist"
configuration.settings["PRODUCT_NAME"] = "$(TARGET_NAME)"
# This will show "Automatic" in Xcode,
# relies on proper/valid "PROVISIONING_PROFILE" value:
# configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = nil
# Xcode 8 automatic code signing support
configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = ""
configuration.settings["DEVELOPMENT_TEAM"] = developmentTeamId
#===
configuration.settings["SWIFT_VERSION"] = currentSwiftVersion # Xcode 8
end
#=== Source Files
target.include_files = ["Src/**/*.*"]
target.include_files << "Src-Extra/**/*.*"
#=== Tests
# unit_tests_for target do |test_target|
# test_target.name = target.name + testSuffix
# test_target.deployment_target = iOSdeploymentTarget
# test_target.all_configurations.each do |configuration|
# configuration.product_bundle_identifier = companyIdentifier + "." + test_target.name
# configuration.settings["INFOPLIST_FILE"] = "Info/" + test_target.name + ".plist"
# configuration.settings["LD_RUNPATH_SEARCH_PATHS"] = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
# configuration.settings["SWIFT_VERSION"] = currentSwiftVersion # Xcode 8
# # Xcode 8 automatic code signing support
# configuration.settings["CODE_SIGN_IDENTITY[sdk=iphoneos*]"] = ""
# configuration.settings["DEVELOPMENT_TEAM"] = developmentTeamId
# configuration.settings["FRAMEWORK_SEARCH_PATHS"] = "$BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/**",
# "$(inherited)"
# end
# #=== Source Files
# testTargetSrcPath = testSuffix + "/**/*.*"
# test_target.include_files = [testTargetSrcPath]
# end
end

1
Cartfile Normal file
View File

@ -0,0 +1 @@
github "XCEssentials/ProjectGenerator" ~> 2.1

1
Cartfile.resolved Normal file
View File

@ -0,0 +1 @@
github "XCEssentials/ProjectGenerator" "2.1.4"

View File

@ -0,0 +1,167 @@
# Created by https://www.gitignore.io/api/osx
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# ================================
# Created by https://www.gitignore.io/api/objective-c
### Objective-C ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
## Other
*.xccheckout
*.moved-aside
*.xcuserstate
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
### Objective-C Patch ###
*.xcscmblueprint
# ================================
# Created by https://www.gitignore.io/api/swift
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/
# ================================
# Generic iOS development
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
Pods/
Podfile.lock
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
fastlane/report.xml
# fastlane/screenshots
# custom fastlane-related addition:
#
Export
# ================================
# Created by https://www.gitignore.io/api/appcode
### AppCode ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
*.iml
## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries
# .idea/shelf
# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml
# Gradle:
# .idea/gradle.xml
# .idea/libraries
# Mongo Explorer plugin:
# .idea/mongoSettings.xml
## File-based project format:
*.ipr
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

View File

@ -0,0 +1,99 @@
import XCEProjectGenerator
//===
let params =
(
repoName: "MyAwesomeFramework",
deploymentTarget: "8.0",
companyIdentifier: "khatskevich.maxim",
developmentTeamId: "UJA88X59XP" // 'Maxim Khatskevich'
)
let bundleId =
(
fwk: "\(params.companyIdentifier).\(params.repoName)",
tst: "\(params.companyIdentifier).\(params.repoName).Tst"
)
//===
let specFormat = Spec.Format.v2_1_0
let project = Project(params.repoName) { project in
project.configurations.all.override(
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"DEVELOPMENT_TEAM" <<< params.developmentTeamId,
"SWIFT_VERSION" <<< "3.0",
"VERSIONING_SYSTEM" <<< "apple-generic"
)
project.configurations.debug.override(
"SWIFT_OPTIMIZATION_LEVEL" <<< "-Onone"
)
//---
project.target("App", .iOS, .framework) { app in
app.include("Src")
//---
app.configurations.all.override(
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< bundleId.fwk,
"INFOPLIST_FILE" <<< "Info/Fwk.plist",
//--- iOS related:
"SDKROOT" <<< "iphoneos",
"TARGETED_DEVICE_FAMILY" <<< DeviceFamily.iOS.universal,
//--- Framework related:
"DEFINES_MODULE" <<< "NO",
"SKIP_INSTALL" <<< "YES"
)
app.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
//---
app.unitTests { appTests in
appTests.include("Tst")
//---
appTests.configurations.all.override(
// very important for unit tests,
// prevents the error when unit test do not start at all
"LD_RUNPATH_SEARCH_PATHS" <<<
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks",
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< bundleId.tst,
"INFOPLIST_FILE" <<< "Info/Tst.plist",
"FRAMEWORK_SEARCH_PATHS" <<< "$(inherited) $(BUILT_PRODUCTS_DIR)"
)
appTests.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
}
}
}

View File

@ -0,0 +1,26 @@
<?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>en</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>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.4</string>
<key>CFBundleVersion</key>
<string>17</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017 Maxim Khatskevich. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Maxim Khatskevich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,26 @@
//
// main.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/15/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
import XCEProjectGenerator
//===
let specData =
Manager.prepareSpec(specFormat, for: project)
.data(using: .utf8)
let targetPath = "\(CommandLine.arguments[1])/project.yml"
FileManager
.default
.createFile(
atPath: targetPath,
contents: specData,
attributes: nil)

View File

@ -0,0 +1,687 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
943179991E7D82D500F3796D /* Project.Struct.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943179981E7D820C00F3796D /* Project.Struct.swift */; };
943C0C291E7B14CB00C8DF86 /* MKHProjGen.h in Headers */ = {isa = PBXBuildFile; fileRef = 943C0C141E7B141400C8DF86 /* MKHProjGen.h */; settings = {ATTRIBUTES = (Public, ); }; };
943C0C4C1E7B198D00C8DF86 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C0C4A1E7B198D00C8DF86 /* main.swift */; };
9479E3351EDD4AA5006CCC68 /* Spec.2.0.0.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9479E3341EDD4AA5006CCC68 /* Spec.2.0.0.swift */; };
94848C011EF994E300EA3F4C /* Spec.2.1.0.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94848C001EF994E300EA3F4C /* Spec.2.1.0.swift */; };
949521F41E7B2A2C00812390 /* XCEProjectGenerator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 943C0C021E7B134500C8DF86 /* XCEProjectGenerator.framework */; };
9495220B1E7BF62A00812390 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C0C4A1E7B198D00C8DF86 /* main.swift */; };
9495220D1E7BF62A00812390 /* XCEProjectGenerator.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 943C0C021E7B134500C8DF86 /* XCEProjectGenerator.framework */; };
949522131E7BF66C00812390 /* Spec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C0C481E7B198D00C8DF86 /* Spec.swift */; };
949BB45C1E87E43E008F599B /* Device.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4491E87E43E008F599B /* Device.swift */; };
949BB45D1E87E43E008F599B /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB44A1E87E43E008F599B /* Manager.swift */; };
949BB45E1E87E43E008F599B /* Misc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB44B1E87E43E008F599B /* Misc.swift */; };
949BB45F1E87E43E008F599B /* Platform.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB44C1E87E43E008F599B /* Platform.swift */; };
949BB4601E87E43E008F599B /* Project.BuildConfig.Defaults.General.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB44E1E87E43E008F599B /* Project.BuildConfig.Defaults.General.swift */; };
949BB4611E87E43E008F599B /* Project.BuildConfig.Defaults.iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB44F1E87E43E008F599B /* Project.BuildConfig.Defaults.iOS.swift */; };
949BB4621E87E43E008F599B /* Project.BuildConfig.Defaults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4501E87E43E008F599B /* Project.BuildConfig.Defaults.swift */; };
949BB4631E87E43E008F599B /* Project.BuildConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4511E87E43E008F599B /* Project.BuildConfig.swift */; };
949BB4641E87E43E008F599B /* Project.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4521E87E43E008F599B /* Project.swift */; };
949BB4651E87E43E008F599B /* Spec.1.2.1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4541E87E43E008F599B /* Spec.1.2.1.swift */; };
949BB4661E87E43E008F599B /* Spec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4551E87E43E008F599B /* Spec.swift */; };
949BB4671E87E43E008F599B /* Target.BuildConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4571E87E43E008F599B /* Target.BuildConfig.swift */; };
949BB4681E87E43E008F599B /* Target.Dependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4581E87E43E008F599B /* Target.Dependencies.swift */; };
949BB4691E87E43E008F599B /* Target.Script.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB4591E87E43E008F599B /* Target.Script.swift */; };
949BB46A1E87E43E008F599B /* Target.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB45A1E87E43E008F599B /* Target.swift */; };
949BB46B1E87E43E008F599B /* Target.Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB45B1E87E43E008F599B /* Target.Type.swift */; };
949BB46D1E87E96A008F599B /* Spec.1.3.0.swift in Sources */ = {isa = PBXBuildFile; fileRef = 949BB46C1E87E96A008F599B /* Spec.1.3.0.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
949521F21E7B2A2600812390 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 943C0BF91E7B134500C8DF86 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 943C0C011E7B134500C8DF86;
remoteInfo = MKHProjGen;
};
949522091E7BF62A00812390 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 943C0BF91E7B134500C8DF86 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 943C0C011E7B134500C8DF86;
remoteInfo = MKHProjGen;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
943C0C3E1E7B196200C8DF86 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
9495220E1E7BF62A00812390 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
943179981E7D820C00F3796D /* Project.Struct.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Project.Struct.swift; path = ../../../../Project.Struct.swift; sourceTree = "<group>"; };
943C0C021E7B134500C8DF86 /* XCEProjectGenerator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XCEProjectGenerator.framework; sourceTree = BUILT_PRODUCTS_DIR; };
943C0C141E7B141400C8DF86 /* MKHProjGen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MKHProjGen.h; sourceTree = "<group>"; };
943C0C401E7B196200C8DF86 /* Launcher */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Launcher; sourceTree = BUILT_PRODUCTS_DIR; };
943C0C481E7B198D00C8DF86 /* Spec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.swift; sourceTree = "<group>"; };
943C0C4A1E7B198D00C8DF86 /* main.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
9479E3341EDD4AA5006CCC68 /* Spec.2.0.0.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.2.0.0.swift; sourceTree = "<group>"; };
94848C001EF994E300EA3F4C /* Spec.2.1.0.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.2.1.0.swift; sourceTree = "<group>"; };
949522121E7BF62A00812390 /* Example */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Example; sourceTree = BUILT_PRODUCTS_DIR; };
949BB4491E87E43E008F599B /* Device.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Device.swift; sourceTree = "<group>"; };
949BB44A1E87E43E008F599B /* Manager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = "<group>"; };
949BB44B1E87E43E008F599B /* Misc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Misc.swift; sourceTree = "<group>"; };
949BB44C1E87E43E008F599B /* Platform.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Platform.swift; sourceTree = "<group>"; };
949BB44E1E87E43E008F599B /* Project.BuildConfig.Defaults.General.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Project.BuildConfig.Defaults.General.swift; sourceTree = "<group>"; };
949BB44F1E87E43E008F599B /* Project.BuildConfig.Defaults.iOS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Project.BuildConfig.Defaults.iOS.swift; sourceTree = "<group>"; };
949BB4501E87E43E008F599B /* Project.BuildConfig.Defaults.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Project.BuildConfig.Defaults.swift; sourceTree = "<group>"; };
949BB4511E87E43E008F599B /* Project.BuildConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Project.BuildConfig.swift; sourceTree = "<group>"; };
949BB4521E87E43E008F599B /* Project.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Project.swift; sourceTree = "<group>"; };
949BB4541E87E43E008F599B /* Spec.1.2.1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.1.2.1.swift; sourceTree = "<group>"; };
949BB4551E87E43E008F599B /* Spec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.swift; sourceTree = "<group>"; };
949BB4571E87E43E008F599B /* Target.BuildConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Target.BuildConfig.swift; sourceTree = "<group>"; };
949BB4581E87E43E008F599B /* Target.Dependencies.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Target.Dependencies.swift; sourceTree = "<group>"; };
949BB4591E87E43E008F599B /* Target.Script.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Target.Script.swift; sourceTree = "<group>"; };
949BB45A1E87E43E008F599B /* Target.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Target.swift; sourceTree = "<group>"; };
949BB45B1E87E43E008F599B /* Target.Type.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Target.Type.swift; sourceTree = "<group>"; };
949BB46C1E87E96A008F599B /* Spec.1.3.0.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Spec.1.3.0.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
943C0BFE1E7B134500C8DF86 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
943C0C3D1E7B196200C8DF86 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
949521F41E7B2A2C00812390 /* XCEProjectGenerator.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9495220C1E7BF62A00812390 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9495220D1E7BF62A00812390 /* XCEProjectGenerator.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
943C0BF81E7B134500C8DF86 = {
isa = PBXGroup;
children = (
943C0C471E7B198D00C8DF86 /* Example */,
943C0C491E7B198D00C8DF86 /* Launcher */,
949BB4481E87E43E008F599B /* Src */,
943C0C131E7B141400C8DF86 /* Src-Extra */,
943C0C031E7B134500C8DF86 /* Products */,
);
sourceTree = "<group>";
};
943C0C031E7B134500C8DF86 /* Products */ = {
isa = PBXGroup;
children = (
943C0C021E7B134500C8DF86 /* XCEProjectGenerator.framework */,
943C0C401E7B196200C8DF86 /* Launcher */,
949522121E7BF62A00812390 /* Example */,
);
name = Products;
sourceTree = "<group>";
};
943C0C131E7B141400C8DF86 /* Src-Extra */ = {
isa = PBXGroup;
children = (
943C0C141E7B141400C8DF86 /* MKHProjGen.h */,
);
path = "Src-Extra";
sourceTree = "<group>";
};
943C0C471E7B198D00C8DF86 /* Example */ = {
isa = PBXGroup;
children = (
943C0C481E7B198D00C8DF86 /* Spec.swift */,
);
path = Example;
sourceTree = "<group>";
};
943C0C491E7B198D00C8DF86 /* Launcher */ = {
isa = PBXGroup;
children = (
943C0C4A1E7B198D00C8DF86 /* main.swift */,
943179981E7D820C00F3796D /* Project.Struct.swift */,
);
path = Launcher;
sourceTree = "<group>";
};
949BB4481E87E43E008F599B /* Src */ = {
isa = PBXGroup;
children = (
949BB4491E87E43E008F599B /* Device.swift */,
949BB44A1E87E43E008F599B /* Manager.swift */,
949BB44B1E87E43E008F599B /* Misc.swift */,
949BB44C1E87E43E008F599B /* Platform.swift */,
949BB44D1E87E43E008F599B /* Project */,
949BB4531E87E43E008F599B /* Spec */,
949BB4561E87E43E008F599B /* Target */,
);
path = Src;
sourceTree = "<group>";
};
949BB44D1E87E43E008F599B /* Project */ = {
isa = PBXGroup;
children = (
949BB44E1E87E43E008F599B /* Project.BuildConfig.Defaults.General.swift */,
949BB44F1E87E43E008F599B /* Project.BuildConfig.Defaults.iOS.swift */,
949BB4501E87E43E008F599B /* Project.BuildConfig.Defaults.swift */,
949BB4511E87E43E008F599B /* Project.BuildConfig.swift */,
949BB4521E87E43E008F599B /* Project.swift */,
);
path = Project;
sourceTree = "<group>";
};
949BB4531E87E43E008F599B /* Spec */ = {
isa = PBXGroup;
children = (
949BB4551E87E43E008F599B /* Spec.swift */,
949BB4541E87E43E008F599B /* Spec.1.2.1.swift */,
949BB46C1E87E96A008F599B /* Spec.1.3.0.swift */,
9479E3341EDD4AA5006CCC68 /* Spec.2.0.0.swift */,
94848C001EF994E300EA3F4C /* Spec.2.1.0.swift */,
);
path = Spec;
sourceTree = "<group>";
};
949BB4561E87E43E008F599B /* Target */ = {
isa = PBXGroup;
children = (
949BB4571E87E43E008F599B /* Target.BuildConfig.swift */,
949BB4581E87E43E008F599B /* Target.Dependencies.swift */,
949BB4591E87E43E008F599B /* Target.Script.swift */,
949BB45A1E87E43E008F599B /* Target.swift */,
949BB45B1E87E43E008F599B /* Target.Type.swift */,
);
path = Target;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
943C0BFF1E7B134500C8DF86 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
943C0C291E7B14CB00C8DF86 /* MKHProjGen.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
943C0C011E7B134500C8DF86 /* ProjectGenerator */ = {
isa = PBXNativeTarget;
buildConfigurationList = 943C0C0A1E7B134500C8DF86 /* Build configuration list for PBXNativeTarget "ProjectGenerator" */;
buildPhases = (
943C0BFD1E7B134500C8DF86 /* Sources */,
943C0BFE1E7B134500C8DF86 /* Frameworks */,
943C0BFF1E7B134500C8DF86 /* Headers */,
943C0C001E7B134500C8DF86 /* Resources */,
943C0C791E7B258700C8DF86 /* BuildStatic */,
);
buildRules = (
);
dependencies = (
);
name = ProjectGenerator;
productName = MKHProjGen;
productReference = 943C0C021E7B134500C8DF86 /* XCEProjectGenerator.framework */;
productType = "com.apple.product-type.framework";
};
943C0C3F1E7B196200C8DF86 /* Launcher */ = {
isa = PBXNativeTarget;
buildConfigurationList = 943C0C441E7B196200C8DF86 /* Build configuration list for PBXNativeTarget "Launcher" */;
buildPhases = (
943C0C3C1E7B196200C8DF86 /* Sources */,
943C0C3D1E7B196200C8DF86 /* Frameworks */,
943C0C3E1E7B196200C8DF86 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
949521F31E7B2A2600812390 /* PBXTargetDependency */,
);
name = Launcher;
productName = MKHProjGenLauncher;
productReference = 943C0C401E7B196200C8DF86 /* Launcher */;
productType = "com.apple.product-type.tool";
};
949522071E7BF62A00812390 /* Example */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9495220F1E7BF62A00812390 /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
9495220A1E7BF62A00812390 /* Sources */,
9495220C1E7BF62A00812390 /* Frameworks */,
9495220E1E7BF62A00812390 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
949522081E7BF62A00812390 /* PBXTargetDependency */,
);
name = Example;
productName = MKHProjGenLauncher;
productReference = 949522121E7BF62A00812390 /* Example */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
943C0BF91E7B134500C8DF86 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = "Maxim Khatskevich";
TargetAttributes = {
943C0C011E7B134500C8DF86 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = UJA88X59XP;
ProvisioningStyle = Automatic;
};
943C0C3F1E7B196200C8DF86 = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = UJA88X59XP;
ProvisioningStyle = Automatic;
};
949522071E7BF62A00812390 = {
DevelopmentTeam = UJA88X59XP;
};
};
};
buildConfigurationList = 943C0BFC1E7B134500C8DF86 /* Build configuration list for PBXProject "ProjectGenerator" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 943C0BF81E7B134500C8DF86;
productRefGroup = 943C0C031E7B134500C8DF86 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
943C0C011E7B134500C8DF86 /* ProjectGenerator */,
943C0C3F1E7B196200C8DF86 /* Launcher */,
949522071E7BF62A00812390 /* Example */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
943C0C001E7B134500C8DF86 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
943C0C791E7B258700C8DF86 /* BuildStatic */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"$(LD_DEPENDENCY_INFO_FILE)",
);
name = BuildStatic;
outputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(EXECUTABLE_PATH)",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/bin/sh\n\ncd \"$BUILT_PRODUCTS_DIR\"\n\narchs=( $ARCHS ) lfls=()\nfor v in \"${archs[@]/#/LINK_FILE_LIST_${CURRENT_VARIANT}_}\"; do\nlfls+=( -filelist \"${!v}\" )\ndone\n\nlibtool -static -syslibroot \"$SDKROOT\" -L. \"${lfls[@]}\" -o \"$EXECUTABLE_PATH\"";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
943C0BFD1E7B134500C8DF86 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
949BB45D1E87E43E008F599B /* Manager.swift in Sources */,
949BB46D1E87E96A008F599B /* Spec.1.3.0.swift in Sources */,
9479E3351EDD4AA5006CCC68 /* Spec.2.0.0.swift in Sources */,
949BB45F1E87E43E008F599B /* Platform.swift in Sources */,
94848C011EF994E300EA3F4C /* Spec.2.1.0.swift in Sources */,
949BB45C1E87E43E008F599B /* Device.swift in Sources */,
949BB45E1E87E43E008F599B /* Misc.swift in Sources */,
949BB46A1E87E43E008F599B /* Target.swift in Sources */,
949BB4671E87E43E008F599B /* Target.BuildConfig.swift in Sources */,
949BB4681E87E43E008F599B /* Target.Dependencies.swift in Sources */,
949BB4691E87E43E008F599B /* Target.Script.swift in Sources */,
949BB46B1E87E43E008F599B /* Target.Type.swift in Sources */,
949BB4641E87E43E008F599B /* Project.swift in Sources */,
949BB4631E87E43E008F599B /* Project.BuildConfig.swift in Sources */,
949BB4621E87E43E008F599B /* Project.BuildConfig.Defaults.swift in Sources */,
949BB4611E87E43E008F599B /* Project.BuildConfig.Defaults.iOS.swift in Sources */,
949BB4601E87E43E008F599B /* Project.BuildConfig.Defaults.General.swift in Sources */,
949BB4661E87E43E008F599B /* Spec.swift in Sources */,
949BB4651E87E43E008F599B /* Spec.1.2.1.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
943C0C3C1E7B196200C8DF86 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
943C0C4C1E7B198D00C8DF86 /* main.swift in Sources */,
943179991E7D82D500F3796D /* Project.Struct.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9495220A1E7BF62A00812390 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
949522131E7BF66C00812390 /* Spec.swift in Sources */,
9495220B1E7BF62A00812390 /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
949521F31E7B2A2600812390 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 943C0C011E7B134500C8DF86 /* ProjectGenerator */;
targetProxy = 949521F21E7B2A2600812390 /* PBXContainerItemProxy */;
};
949522081E7BF62A00812390 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 943C0C011E7B134500C8DF86 /* ProjectGenerator */;
targetProxy = 949522091E7BF62A00812390 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin XCBuildConfiguration section */
943C0C081E7B134500C8DF86 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 17;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
943C0C091E7B134500C8DF86 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 17;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
943C0C0B1E7B134500C8DF86 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UJA88X59XP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 17;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Info/Fwk.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.XCEssentials.ProjectGenerator;
PRODUCT_NAME = XCEProjectGenerator;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Debug;
};
943C0C0C1E7B134500C8DF86 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UJA88X59XP;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 17;
DYLIB_INSTALL_NAME_BASE = "@rpath";
FRAMEWORK_VERSION = A;
INFOPLIST_FILE = Info/Fwk.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.XCEssentials.ProjectGenerator;
PRODUCT_NAME = XCEProjectGenerator;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
};
name = Release;
};
943C0C451E7B196200C8DF86 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
DEVELOPMENT_TEAM = UJA88X59XP;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
943C0C461E7B196200C8DF86 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
DEVELOPMENT_TEAM = UJA88X59XP;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
949522101E7BF62A00812390 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
DEVELOPMENT_TEAM = UJA88X59XP;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
949522111E7BF62A00812390 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
DEVELOPMENT_TEAM = UJA88X59XP;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
);
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-all_load",
);
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
943C0BFC1E7B134500C8DF86 /* Build configuration list for PBXProject "ProjectGenerator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
943C0C081E7B134500C8DF86 /* Debug */,
943C0C091E7B134500C8DF86 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
943C0C0A1E7B134500C8DF86 /* Build configuration list for PBXNativeTarget "ProjectGenerator" */ = {
isa = XCConfigurationList;
buildConfigurations = (
943C0C0B1E7B134500C8DF86 /* Debug */,
943C0C0C1E7B134500C8DF86 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
943C0C441E7B196200C8DF86 /* Build configuration list for PBXNativeTarget "Launcher" */ = {
isa = XCConfigurationList;
buildConfigurations = (
943C0C451E7B196200C8DF86 /* Debug */,
943C0C461E7B196200C8DF86 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9495220F1E7BF62A00812390 /* Build configuration list for PBXNativeTarget "Example" */ = {
isa = XCConfigurationList;
buildConfigurations = (
949522101E7BF62A00812390 /* Debug */,
949522111E7BF62A00812390 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 943C0BF91E7B134500C8DF86 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:/Users/maxim/Dev/XCEssentials/ProjectGenerator/ProjectGenerator.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "943C0C3F1E7B196200C8DF86"
BuildableName = "Launcher"
BlueprintName = "Launcher"
ReferencedContainer = "container:ProjectGenerator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "943C0C3F1E7B196200C8DF86"
BuildableName = "Launcher"
BlueprintName = "Launcher"
ReferencedContainer = "container:ProjectGenerator.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "943C0C3F1E7B196200C8DF86"
BuildableName = "Launcher"
BlueprintName = "Launcher"
ReferencedContainer = "container:ProjectGenerator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "&quot;$(SRCROOT)/../../..&quot;"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "943C0C3F1E7B196200C8DF86"
BuildableName = "Launcher"
BlueprintName = "Launcher"
ReferencedContainer = "container:ProjectGenerator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,92 @@
[![GitHub tag](https://img.shields.io/github/tag/XCEssentials/ProjectGenerator.svg)](https://github.com/XCEssentials/FunctionalState/releases)
[![license](https://img.shields.io/github/license/XCEssentials/ProjectGenerator.svg)](https://opensource.org/licenses/MIT)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
# Introduction
Describe Xcode project declaratively in pure Swift.
# Problem
Xcode uses an undocumented proprietary format for describing project structure, settings, etc. in **`*.xcodeproj`** files. That kind of file is hard to read and understand for a human, impossible to merge without merge conflicts if changes were made on two different local copies of the same repo/project, or even on different branches inside the same repo on the same workstation. That makes working together on the same Xcode project file a nightmare, when you need to merge changes "*.xcodeproj" always has conflicts and developers have to resolve them manually, wasting lots of time for routine that might be done by computer. We need a better solution!
# Existing solution
There is a command line tool that allows developer to write project specification in a form of plain text configuration file (using Ruby or YAML) and then generate **`*.xcodeproj`** file on the fly from this specification - [Struct](https://github.com/workshop/struct).
The specification file format features very concise hierarchic notation that's easy and intuitive, and you only need to specify explicitly settings which can not be inferred somehow or you need a value that differs from defaults (provided by the tool itself or, most often, by Xcode).
For vast majority of iOS developers, this tool should be already a good enough solution, but there are still few inconveniences:
- you have to learn a new language/syntax (not every iOS developer knows Ruby and feel comfortable to deal with it on daily basis);
- you need to leave Xcode and switch to another text editor with proper syntax highlight for Ruby/YAML to edit the specification file, because Xcode does not support YAML and have limited syntax highligh for Ruby;
- due to nature of Ruby/YAML, you do not have development time syntax check, you have to try to run the tool in order to disciover a syntax error in your specification.
# Wishlist
Based on the downsides of Struct listed above, here is a list of wishes for an "ideal" tool like that:
- write project specification in pure Swift;
- use Xcode to edit specification file;
- get full syntax highlight and real time syntax check in specification file.
# About this tool
To archive the goals listed above, this project has been made. Think of it as a thin wrapper on top of [Struct](https://github.com/workshop/struct) CLI tool. It brings no extra functionality in comparison with [Struct](https://github.com/workshop/struct), but adds some convenience to writing project file specification.
# How to install
Use [Carthage](https://github.com/Carthage/Carthage) to install the tool into your project. Put into your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile):
```ruby
github "XCEssentials/ProjectGenerator" ~> 2.1
```
The project folder will be downloaded by [Carthage](https://github.com/Carthage/Carthage), but nothing will be built, that's expected behavior, ignor warnings from Carthage.
# How it is organized
**Remember**, you are not supposed to make any changes in the project, except your project specification file.
The poject consists of 3 main parts, each of them has its own scheme:
1. Scheme **"Fwk"** - macOS framework that implements functionality related to parsing your Swift specification file and writing target specification file in YAML for [Struct](https://github.com/workshop/struct).
2. Scheme **"Launcher"** - a command line tool that gets the job done. It includes the framework module as dependency and starts the process of parsing your Swift specification file into [Struct](https://github.com/workshop/struct) YAML spec file. This target contains just 2 source files. First one is the **`main.swift`** file, it will be executed when the target will be run in Xcode. Second file is **`Project.Struct.swift`** and it's missing in the project out of the box intentinonally. It's expected location is in your project root directory (given that `ProjectGenerator` is installed with [Carthage](https://github.com/Carthage/Carthage)) and it's your responsibility to put this file there.
3. Scheme **"Example"** - very similar to the "Launcher" scheme, with only difference that it contains a sample Swift project specification file with all the necessery statements isnside. Use this sample Swift specification file as starting point for your project specification.
# How to start using
If using first time:
1. copy the [sample file](https://github.com/XCEssentials/ProjectGenerator/blob/master/Example/Spec.swift) from [Example](https://github.com/XCEssentials/ProjectGenerator/tree/master/Example) folder to your project root folder and rename it with **`Project.Struct.swift`**;
2. open the project (from your project root folder, go to `./Carthage/Checkouts/ProjectGenerator`, open file `ProjectGenerator.xcodeproj`), make sure that you have the `Launcher` scheme selected (notice, that if you've done everything correctly at the previous step, the `Project.Struct.swift` under `Launcher` group on Project Navigator panel will be in place, not missing);
3. make initial editing of the `Project.Struct.swift` file to describe at least basic structure for your project;
4. when project specification is ready, just hit "Cmd+R" hotkey in Xcode (Run the scheme), Xcode will build and run the scheme, a new file named `project.yml` will be created at project root folder. That's it!
To actually generate project file from the created `project.yml` file - use Struct itself from your project root folder.
# How to use
When yoiu need to make a change into your project configuration:
1. open the project (from your project root folder, go to `./Carthage/Checkouts/ProjectGenerator`, open file `ProjectGenerator.xcodeproj`), make sure that you have the `Launcher` scheme selected;
2. make the necessary changes in the `Project.Struct.swift` file;
3. run the scheme, a new file named `project.yml` will be created at project root folder (will override previous version).
To actually (re)generate project file from the newly created `project.yml` file - use Struct itself from your project root folder.
# Notes on versioning
This project follows [Semantic Versioning](http://semver.org), its MAJOR (and MINOR, when possible) version number is syncronized with corresponding version numbers of the [Struct](https://github.com/workshop/struct) specification format, which is used as blueprint for the output YAML project specification file.
For example, if this project has version number `2.1.0`, that means the output specification file `project.yml` will be generated using [Spec format: v2.0](https://github.com/workshop/struct/wiki/Spec-format:-v2.0).
## Future plans
This project will be kept up to date with latest MAJOR version of [Struct](https://github.com/workshop/struct). Also there is a chance that the execution of [Struct](https://github.com/workshop/struct) CLI tool after (re)generation of `project.yml` file will by automated as well, but so far it seems to be a bit out of scope for the tool.
## Contribution, feedback, questions...
If you want to contirbute to the project - feel free to open a pull request.
If you have any questions, suggestions, feedback or believe you found a bug - feel free to create an issue.

View File

@ -0,0 +1,19 @@
//
// MKHProjGen.h
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
#import <Cocoa/Cocoa.h>
//! Project version number for MKHProjGen.
FOUNDATION_EXPORT double MKHProjGenVersionNumber;
//! Project version string for MKHProjGen.
FOUNDATION_EXPORT const unsigned char MKHProjGenVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <MKHProjGen/PublicHeader.h>

View File

@ -0,0 +1,31 @@
//
// Device.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/18/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
//===
public
enum DeviceFamily
{
public
enum iOS
{
public
static
let universal = "1,2"
public
static
let phone = "1" // iPhone and iPod Touch
public
static
let pad = "2" // iPad
}
}

View File

@ -0,0 +1,44 @@
//
// Manager.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
public
enum Manager
{
public
static
func prepareSpec(
_ format: Spec.Format,
for project: Project
) -> String
{
let rawSpec: RawSpec
//===
switch format
{
case .v1_2_1:
rawSpec = Spec_1_2_1.generate(for: project)
case .v1_3_0:
rawSpec = Spec_1_3_0.generate(for: project)
case .v2_0_0:
rawSpec = Spec_2_0_0.generate(for: project)
case .v2_1_0:
rawSpec = Spec_2_1_0.generate(for: project)
}
//===
return rawSpec
.map { "\(Spec.ident($0))\($1)" }
.joined(separator: "\n")
}
}

View File

@ -0,0 +1,30 @@
//
// Misc.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/15/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
public
typealias KeyValuePair = (key: String, value: Any)
//===
infix operator <<<
public
func <<< (keyName: String, value: Any) -> KeyValuePair
{
return (keyName, value)
}
//===
//infix operator </
//
//public
//func </ (keyName: String, value: Any) -> KeyValuePair
//{
// return (keyName, value)
//}

View File

@ -0,0 +1,19 @@
//
// Platform.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/15/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
public
extension Project
{
public
enum Platform: String
{
case
iOS = "ios" /*,
macOS = "mac" */
}
}

View File

@ -0,0 +1,31 @@
//
// Project.BuildConfig.Defaults.General.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
extension Project.BuildConfiguration.Defaults
{
enum General
{
static
func debug(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration
.Defaults
.debug(["general:debug"] + profiles)
}
static
func release(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration
.Defaults
.release(["general:release"] + profiles)
}
}
}

View File

@ -0,0 +1,39 @@
//
// Project.BuildConfig.Defaults.iOS.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
extension Project.BuildConfiguration.Defaults
{
enum iOS
{
static
func base(_ profiles: [String] = []) -> Project.BuildConfiguration.Base
{
return
Project.BuildConfiguration
.Base(["platform:ios"] + profiles)
}
static
func debug(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration
.Defaults
.debug(["ios:debug"] + profiles)
}
static
func release(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration
.Defaults
.release(["ios:release"] + profiles)
}
}
}

View File

@ -0,0 +1,35 @@
//
// Project.BuildConfig.Defaults.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
extension Project.BuildConfiguration
{
enum Defaults
{
static
func debug(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration(
"Debug",
.debug,
profiles
)
}
static
func release(_ profiles: [String] = []) -> Project.BuildConfiguration
{
return
Project.BuildConfiguration(
"Release",
.release,
profiles
)
}
}
}

View File

@ -0,0 +1,98 @@
//
// Project.BuildConfig.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/18/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
//===
public
extension Project
{
public
struct BuildConfiguration
{
public
struct Base
{
public
let profiles: [String]
//===
// internal
init(_ profiles: [String] = [])
{
self.profiles = profiles
}
//===
public private(set)
var overrides: [KeyValuePair] = []
public
mutating
func override(_ pairs: KeyValuePair...)
{
overrides.append(contentsOf: pairs)
}
}
//===
public
enum InternalType: String
{
case
debug,
release
}
//===
public
let name: String
public
let type: InternalType
public
let profiles: [String]
//---
public
var externalConfig: String? = nil // *.xcconfig file
//---
public private(set)
var overrides: [KeyValuePair] = []
public
mutating
func override(_ pairs: KeyValuePair...)
{
overrides.append(contentsOf: pairs)
}
//---
// internal
init(
_ name: String,
_ type: InternalType,
_ profiles: [String] = []
)
{
self.name = name
self.type = type
self.profiles = profiles
}
}
}

View File

@ -0,0 +1,73 @@
//
// Project.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/15/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
public
struct Project
{
public
typealias BuildConfigurations =
(
all: BuildConfiguration.Base,
debug: BuildConfiguration,
release: BuildConfiguration
)
//---
public
let name: String
//---
public
var configurations: BuildConfigurations =
(
BuildConfiguration.Base(
// nothing on this level
),
BuildConfiguration.Defaults.General.debug(
//
),
BuildConfiguration.Defaults.General.release(
//
)
)
public private(set)
var targets: [Target] = []
//---
public
init(
_ name: String,
_ configureProject: (inout Project) -> Void
)
{
self.name = name
//---
configureProject(&self)
}
//===
public
mutating
func target(
_ name: String,
_ platform: Platform,
_ type: Target.InternalType,
_ configureTarget: (inout Target) -> Void
)
{
targets
.append(Target(platform, name, type, configureTarget))
}
}

View File

@ -0,0 +1,699 @@
import Foundation
//===
enum Spec_1_2_1
{
static
func generate(for p: Project) -> RawSpec
{
var result: RawSpec = []
var idention: Int = 0
//===
result <<< (idention, "# generated with MKHProjGen")
result <<< (idention, "# https://github.com/maximkhatskevich/MKHProjGen")
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#version-number
result <<< (idention, Spec.key("version") + " \(Spec.Format.v1_2_1.rawValue)")
//===
result <<< process(&idention, p.configurations)
//===
result <<< process(&idention, p.targets)
//===
result <<< (idention, Spec.key("variants"))
idention += 1
result <<< (idention, Spec.key("$base"))
idention += 1
result <<< (idention, Spec.key("abstract") + " true")
idention -= 1
result <<< (idention, Spec.key(p.name))
idention -= 1
//===
result <<< (0, "") // empty line in the EOF
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.BuildConfiguration.Base,
_ c: Project.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
result <<< (idention, Spec.key("type") + Spec.value(c.type))
//===
if
let externalConfig = c.externalConfig
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#xcconfig-references
// NOTE: when using xcconfig files,
// any overrides or profiles will be ignored.
result <<< (idention, Spec.key("source") + Spec.value(externalConfig) )
}
else
{
// NO source/xcconfig provided
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#profiles
result <<< (idention, Spec.key("profiles"))
for p in b.profiles + c.profiles
{
result <<< (idention, "-" + Spec.value(p))
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
result <<< (idention, Spec.key("overrides"))
idention += 1
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
idention -= 1
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ targets: [Project.Target]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("targets"))
//===
idention += 1
//===
for t in targets
{
result <<< process(&idention, t)
//===
for tst in t.tests
{
result <<< process(&idention, tst)
}
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ t: Project.Target
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(t.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#platform
result <<< (idention, Spec.key("platform") + Spec.value(t.platform.rawValue))
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#type
result <<< (idention, Spec.key("type") + Spec.value(t.type.rawValue))
//===
result <<< process(&idention, t.dependencies)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#sources
if
!t.includes.isEmpty
{
result <<< (idention, "sources:")
for path in t.includes
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#excludes
if
!t.excludes.isEmpty
{
result <<< (idention, Spec.key("excludes"))
idention += 1
result <<< (idention, Spec.key("files"))
for path in t.excludes
{
result <<< (idention, "-" + Spec.value(path))
}
idention -= 1
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#i18n-resources
if
!t.i18nResources.isEmpty
{
result <<< (idention, Spec.key("i18n-resources"))
for path in t.i18nResources
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
result <<< process(&idention, t.configurations)
//===
result <<< process(&idention, scripts: t.scripts)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#cocoapods
if
t.includeCocoapods
{
result <<<
(idention,
Spec.key("includes_cocoapods") + Spec.value(t.includeCocoapods))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ deps: Project.Target.Dependencies
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
if
!deps.fromSDKs.isEmpty ||
!deps.otherTargets.isEmpty ||
!deps.binaries.isEmpty ||
!deps.projects.isEmpty
{
result <<< (idention, Spec.key("references"))
//===
result <<< processDependencies(&idention, fromSDK: deps.fromSDKs)
result <<< processDependencies(&idention, targets: deps.otherTargets)
result <<< processDependencies(&idention, binaries: deps.binaries)
result <<< processDependencies(&idention, projects: deps.projects)
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
fromSDK: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for dep in fromSDK
{
result <<< (idention, "-" + Spec.value("sdkroot:\(dep)"))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
targets: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for t in targets
{
result <<< (idention, "-" + Spec.value(t))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
binaries: [Project.Target.BinaryDependency]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for b in binaries
{
result <<< (idention, Spec.key("- location") + Spec.value(b.location))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(b.codeSignOnCopy))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
projects: [Project.Target.ProjectDependencies]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for p in projects
{
result <<< (idention, Spec.key("- location") + Spec.value(p.location))
result <<< (idention, Spec.key(" frameworks"))
for f in p.frameworks
{
result <<< (idention, Spec.key(" - name") + Spec.value(f.name))
result <<< (idention, Spec.key(" copy") + Spec.value(f.copy))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(f.codeSignOnCopy))
}
}
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.Target.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.Target.BuildConfiguration.Base,
_ c: Project.Target.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
scripts: Project.Target.Scripts
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
if
!scripts.regulars.isEmpty ||
!scripts.beforeBuilds.isEmpty ||
!scripts.afterBuilds.isEmpty
{
result <<< (idention, Spec.key("scripts"))
//===
idention += 1
//===
if
!scripts.regulars.isEmpty
{
result <<< processScripts(&idention, regulars: scripts.regulars)
}
if
!scripts.beforeBuilds.isEmpty
{
result <<< processScripts(&idention, beforeBuild: scripts.beforeBuilds)
}
if
!scripts.afterBuilds.isEmpty
{
result <<< processScripts(&idention, afterBuild: scripts.afterBuilds)
}
//===
idention -= 1
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
regulars: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
for s in regulars
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
beforeBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("prebuild"))
for s in beforeBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
afterBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("postbuild"))
for s in afterBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
}

View File

@ -0,0 +1,718 @@
import Foundation
//===
enum Spec_1_3_0
{
static
func generate(for p: Project) -> RawSpec
{
var result: RawSpec = []
var idention: Int = 0
//===
result <<< (idention, "# generated with MKHProjGen")
result <<< (idention, "# https://github.com/maximkhatskevich/MKHProjGen")
result <<< (idention, "# https://github.com/workshop/struct/wiki/Spec-format:-v1.3")
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v1.3#version-number
result <<< (idention, Spec.key("version") + " \(Spec.Format.v1_3_0.rawValue)")
//===
result <<< process(&idention, p.configurations)
//===
result <<< process(&idention, p.targets)
//===
result <<< (idention, Spec.key("variants"))
idention += 1
result <<< (idention, Spec.key("$base"))
idention += 1
result <<< (idention, Spec.key("abstract") + " true")
idention -= 1
result <<< (idention, Spec.key(p.name))
idention -= 1
//===
result <<< (0, "") // empty line in the EOF
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.BuildConfiguration.Base,
_ c: Project.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
result <<< (idention, Spec.key("type") + Spec.value(c.type))
//===
if
let externalConfig = c.externalConfig
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#xcconfig-references
// NOTE: when using xcconfig files,
// any overrides or profiles will be ignored.
result <<< (idention, Spec.key("source") + Spec.value(externalConfig) )
}
else
{
// NO source/xcconfig provided
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#profiles
result <<< (idention, Spec.key("profiles"))
for p in b.profiles + c.profiles
{
result <<< (idention, "-" + Spec.value(p))
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
result <<< (idention, Spec.key("overrides"))
idention += 1
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
idention -= 1
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ targets: [Project.Target]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("targets"))
//===
idention += 1
//===
for t in targets
{
result <<< process(&idention, t)
//===
for tst in t.tests
{
result <<< process(&idention, tst)
}
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ t: Project.Target
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(t.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#platform
result <<< (idention, Spec.key("platform") + Spec.value(t.platform.rawValue))
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#type
result <<< (idention, Spec.key("type") + Spec.value(t.type.rawValue))
//===
result <<< process(&idention, t.dependencies)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#sources
if
!t.includes.isEmpty
{
result <<< (idention, "sources:")
for path in t.includes
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#excludes
if
!t.excludes.isEmpty
{
result <<< (idention, Spec.key("excludes"))
idention += 1
result <<< (idention, Spec.key("files"))
for path in t.excludes
{
result <<< (idention, "-" + Spec.value(path))
}
idention -= 1
}
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v1.3#options
if
!t.sourceOptions.isEmpty
{
result <<< (idention, "source_options:")
idention += 1
for (path, opt) in t.sourceOptions
{
result <<< (idention, Spec.key(path) + Spec.value(opt))
}
idention -= 1
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#i18n-resources
if
!t.i18nResources.isEmpty
{
result <<< (idention, Spec.key("i18n-resources"))
for path in t.i18nResources
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
result <<< process(&idention, t.configurations)
//===
result <<< process(&idention, scripts: t.scripts)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#cocoapods
if
t.includeCocoapods
{
result <<<
(idention,
Spec.key("includes_cocoapods") + Spec.value(t.includeCocoapods))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ deps: Project.Target.Dependencies
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
if
!deps.fromSDKs.isEmpty ||
!deps.otherTargets.isEmpty ||
!deps.binaries.isEmpty ||
!deps.projects.isEmpty
{
result <<< (idention, Spec.key("references"))
//===
result <<< processDependencies(&idention, fromSDK: deps.fromSDKs)
result <<< processDependencies(&idention, targets: deps.otherTargets)
result <<< processDependencies(&idention, binaries: deps.binaries)
result <<< processDependencies(&idention, projects: deps.projects)
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
fromSDK: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for dep in fromSDK
{
result <<< (idention, "-" + Spec.value("sdkroot:\(dep)"))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
targets: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for t in targets
{
result <<< (idention, "-" + Spec.value(t))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
binaries: [Project.Target.BinaryDependency]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for b in binaries
{
result <<< (idention, Spec.key("- location") + Spec.value(b.location))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(b.codeSignOnCopy))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
projects: [Project.Target.ProjectDependencies]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#references
//===
var result: RawSpec = []
//===
for p in projects
{
result <<< (idention, Spec.key("- location") + Spec.value(p.location))
result <<< (idention, Spec.key(" frameworks"))
for f in p.frameworks
{
result <<< (idention, Spec.key(" - name") + Spec.value(f.name))
result <<< (idention, Spec.key(" copy") + Spec.value(f.copy))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(f.codeSignOnCopy))
}
}
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.Target.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.Target.BuildConfiguration.Base,
_ c: Project.Target.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
scripts: Project.Target.Scripts
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
if
!scripts.regulars.isEmpty ||
!scripts.beforeBuilds.isEmpty ||
!scripts.afterBuilds.isEmpty
{
result <<< (idention, Spec.key("scripts"))
//===
idention += 1
//===
if
!scripts.regulars.isEmpty
{
result <<< processScripts(&idention, regulars: scripts.regulars)
}
if
!scripts.beforeBuilds.isEmpty
{
result <<< processScripts(&idention, beforeBuild: scripts.beforeBuilds)
}
if
!scripts.afterBuilds.isEmpty
{
result <<< processScripts(&idention, afterBuild: scripts.afterBuilds)
}
//===
idention -= 1
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
regulars: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
for s in regulars
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
beforeBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("prebuild"))
for s in beforeBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
afterBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("postbuild"))
for s in afterBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
}

View File

@ -0,0 +1,712 @@
import Foundation
//===
enum Spec_2_0_0
{
static
func generate(for p: Project) -> RawSpec
{
var result: RawSpec = []
var idention: Int = 0
//===
result <<< (idention, "# generated with XCEProjectGenerator")
result <<< (idention, "# https://github.com/XCEssentials/ProjectGenerator")
result <<< (idention, "# https://github.com/workshop/struct/wiki/Spec-format:-v2.0")
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v2.0#version-number
result <<< (idention, Spec.key("version") + " \(Spec.Format.v2_0_0.rawValue)")
//===
result <<< process(&idention, p.configurations)
//===
result <<< process(&idention, p.targets)
//===
result <<< (idention, Spec.key("variants"))
idention += 1
result <<< (idention, Spec.key("$base"))
idention += 1
result <<< (idention, Spec.key("abstract") + " true")
idention -= 1
result <<< (idention, Spec.key(p.name))
idention -= 1
//===
result <<< (0, "") // empty line in the EOF
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.BuildConfiguration.Base,
_ c: Project.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
result <<< (idention, Spec.key("type") + Spec.value(c.type))
//===
if
let externalConfig = c.externalConfig
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#xcconfig-references
// NOTE: when using xcconfig files,
// any overrides or profiles will be ignored.
result <<< (idention, Spec.key("source") + Spec.value(externalConfig) )
}
else
{
// NO source/xcconfig provided
//===
// NO profiles anymore
// https://github.com/workshop/struct/wiki/Migrating-from-Spec-1.3.1-to-Spec-2.0.0
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#overrides
result <<< (idention, Spec.key("overrides"))
idention += 1
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
idention -= 1
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ targets: [Project.Target]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("targets"))
//===
idention += 1
//===
for t in targets
{
result <<< process(&idention, t)
//===
for tst in t.tests
{
result <<< process(&idention, tst)
}
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ t: Project.Target
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(t.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#platform
result <<< (idention, Spec.key("platform") + Spec.value(t.platform.rawValue))
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#type
result <<< (idention, Spec.key("type") + Spec.value(t.type.rawValue))
//===
result <<< process(&idention, t.dependencies)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#sources
if
!t.includes.isEmpty
{
result <<< (idention, "sources:")
for path in t.includes
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#excludes
if
!t.excludes.isEmpty
{
result <<< (idention, Spec.key("excludes"))
idention += 1
result <<< (idention, Spec.key("files"))
for path in t.excludes
{
result <<< (idention, "-" + Spec.value(path))
}
idention -= 1
}
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v2.0#options
if
!t.sourceOptions.isEmpty
{
result <<< (idention, "source_options:")
idention += 1
for (path, opt) in t.sourceOptions
{
result <<< (idention, Spec.key(path) + Spec.value(opt))
}
idention -= 1
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#i18n-resources
if
!t.i18nResources.isEmpty
{
result <<< (idention, Spec.key("i18n-resources"))
for path in t.i18nResources
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
result <<< process(&idention, t.configurations)
//===
result <<< process(&idention, scripts: t.scripts)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#cocoapods
if
t.includeCocoapods
{
result <<<
(idention,
Spec.key("includes_cocoapods") + Spec.value(t.includeCocoapods))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ deps: Project.Target.Dependencies
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
if
!deps.fromSDKs.isEmpty ||
!deps.otherTargets.isEmpty ||
!deps.binaries.isEmpty ||
!deps.projects.isEmpty
{
result <<< (idention, Spec.key("references"))
//===
result <<< processDependencies(&idention, fromSDK: deps.fromSDKs)
result <<< processDependencies(&idention, targets: deps.otherTargets)
result <<< processDependencies(&idention, binaries: deps.binaries)
result <<< processDependencies(&idention, projects: deps.projects)
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
fromSDK: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for dep in fromSDK
{
result <<< (idention, "-" + Spec.value("sdkroot:\(dep)"))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
targets: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for t in targets
{
result <<< (idention, "-" + Spec.value(t))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
binaries: [Project.Target.BinaryDependency]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for b in binaries
{
result <<< (idention, Spec.key("- location") + Spec.value(b.location))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(b.codeSignOnCopy))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
projects: [Project.Target.ProjectDependencies]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for p in projects
{
result <<< (idention, Spec.key("- location") + Spec.value(p.location))
result <<< (idention, Spec.key(" frameworks"))
for f in p.frameworks
{
result <<< (idention, Spec.key(" - name") + Spec.value(f.name))
result <<< (idention, Spec.key(" copy") + Spec.value(f.copy))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(f.codeSignOnCopy))
}
}
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.Target.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.Target.BuildConfiguration.Base,
_ c: Project.Target.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
scripts: Project.Target.Scripts
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
if
!scripts.regulars.isEmpty ||
!scripts.beforeBuilds.isEmpty ||
!scripts.afterBuilds.isEmpty
{
result <<< (idention, Spec.key("scripts"))
//===
idention += 1
//===
if
!scripts.regulars.isEmpty
{
result <<< processScripts(&idention, regulars: scripts.regulars)
}
if
!scripts.beforeBuilds.isEmpty
{
result <<< processScripts(&idention, beforeBuild: scripts.beforeBuilds)
}
if
!scripts.afterBuilds.isEmpty
{
result <<< processScripts(&idention, afterBuild: scripts.afterBuilds)
}
//===
idention -= 1
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
regulars: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
for s in regulars
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
beforeBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("prebuild"))
for s in beforeBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
afterBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("postbuild"))
for s in afterBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
}

View File

@ -0,0 +1,712 @@
import Foundation
//===
enum Spec_2_1_0
{
static
func generate(for p: Project) -> RawSpec
{
var result: RawSpec = []
var idention: Int = 0
//===
result <<< (idention, "# generated with XCEProjectGenerator")
result <<< (idention, "# https://github.com/XCEssentials/ProjectGenerator")
result <<< (idention, "# https://github.com/workshop/struct/wiki/Spec-format:-v2.0")
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v2.0#version-number
result <<< (idention, Spec.key("version") + " \(Spec.Format.v2_1_0.rawValue)")
//===
result <<< process(&idention, p.configurations)
//===
result <<< process(&idention, p.targets)
//===
result <<< (idention, Spec.key("variants"))
idention += 1
result <<< (idention, Spec.key("$base"))
idention += 1
result <<< (idention, Spec.key("abstract") + " true")
idention -= 1
result <<< (idention, Spec.key(p.name))
idention -= 1
//===
result <<< (0, "") // empty line in the EOF
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.BuildConfiguration.Base,
_ c: Project.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#configurations
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
result <<< (idention, Spec.key("type") + Spec.value(c.type))
//===
if
let externalConfig = c.externalConfig
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#xcconfig-references
// NOTE: when using xcconfig files,
// any overrides or profiles will be ignored.
result <<< (idention, Spec.key("source") + Spec.value(externalConfig) )
}
else
{
// NO source/xcconfig provided
//===
// NO profiles anymore
// https://github.com/workshop/struct/wiki/Migrating-from-Spec-1.3.1-to-Spec-2.0.0
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#overrides
result <<< (idention, Spec.key("overrides"))
idention += 1
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
idention -= 1
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ targets: [Project.Target]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("targets"))
//===
idention += 1
//===
for t in targets
{
result <<< process(&idention, t)
//===
for tst in t.tests
{
result <<< process(&idention, tst)
}
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ t: Project.Target
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#targets
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(t.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#platform
result <<< (idention, Spec.key("platform") + Spec.value(t.platform.rawValue))
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#type
result <<< (idention, Spec.key("type") + Spec.value(t.type.rawValue))
//===
result <<< process(&idention, t.dependencies)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#sources
if
!t.includes.isEmpty
{
result <<< (idention, "sources:")
for path in t.includes
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#excludes
if
!t.excludes.isEmpty
{
result <<< (idention, Spec.key("excludes"))
idention += 1
result <<< (idention, Spec.key("files"))
for path in t.excludes
{
result <<< (idention, "-" + Spec.value(path))
}
idention -= 1
}
//===
// https://github.com/workshop/struct/wiki/Spec-format:-v2.0#options
if
!t.sourceOptions.isEmpty
{
result <<< (idention, "source_options:")
idention += 1
for (path, opt) in t.sourceOptions
{
result <<< (idention, Spec.key(path) + Spec.value(opt))
}
idention -= 1
}
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#i18n-resources
if
!t.i18nResources.isEmpty
{
result <<< (idention, Spec.key("i18n-resources"))
for path in t.i18nResources
{
result <<< (idention, "-" + Spec.value(path))
}
}
//===
result <<< process(&idention, t.configurations)
//===
result <<< process(&idention, scripts: t.scripts)
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#cocoapods
if
t.includeCocoapods
{
result <<<
(idention,
Spec.key("includes_cocoapods") + Spec.value(t.includeCocoapods))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ deps: Project.Target.Dependencies
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
if
!deps.fromSDKs.isEmpty ||
!deps.otherTargets.isEmpty ||
!deps.binaries.isEmpty ||
!deps.projects.isEmpty
{
result <<< (idention, Spec.key("references"))
//===
result <<< processDependencies(&idention, fromSDK: deps.fromSDKs)
result <<< processDependencies(&idention, targets: deps.otherTargets)
result <<< processDependencies(&idention, binaries: deps.binaries)
result <<< processDependencies(&idention, projects: deps.projects)
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
fromSDK: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for dep in fromSDK
{
result <<< (idention, "-" + Spec.value("sdkroot:\(dep)"))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
targets: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for t in targets
{
result <<< (idention, "-" + Spec.value(t))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
binaries: [Project.Target.BinaryDependency]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for b in binaries
{
result <<< (idention, Spec.key("- location") + Spec.value(b.location))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(b.codeSignOnCopy))
}
//===
return result
}
//===
static
func processDependencies(
_ idention: inout Int,
projects: [Project.Target.ProjectDependencies]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#references
//===
var result: RawSpec = []
//===
for p in projects
{
result <<< (idention, Spec.key("- location") + Spec.value(p.location))
result <<< (idention, Spec.key(" frameworks"))
for f in p.frameworks
{
result <<< (idention, Spec.key(" - name") + Spec.value(f.name))
result <<< (idention, Spec.key(" copy") + Spec.value(f.copy))
result <<< (idention, Spec.key(" codeSignOnCopy") + Spec.value(f.codeSignOnCopy))
}
}
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ set: Project.Target.BuildConfigurations
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("configurations"))
//===
idention += 1
//===
result <<< process(&idention, set.all, set.debug)
result <<< process(&idention, set.all, set.release)
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
_ b: Project.Target.BuildConfiguration.Base,
_ c: Project.Target.BuildConfiguration
) -> RawSpec
{
// https://github.com/lyptt/struct/issues/77#issuecomment-287573381
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key(c.name))
//===
idention += 1
//===
// https://github.com/lyptt/struct/wiki/Spec-format:-v1.2#overrides
for o in b.overrides + c.overrides
{
result <<< (idention, Spec.key(o.key) + Spec.value(o.value))
}
//===
idention -= 1
//===
return result
}
//===
static
func process(
_ idention: inout Int,
scripts: Project.Target.Scripts
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
if
!scripts.regulars.isEmpty ||
!scripts.beforeBuilds.isEmpty ||
!scripts.afterBuilds.isEmpty
{
result <<< (idention, Spec.key("scripts"))
//===
idention += 1
//===
if
!scripts.regulars.isEmpty
{
result <<< processScripts(&idention, regulars: scripts.regulars)
}
if
!scripts.beforeBuilds.isEmpty
{
result <<< processScripts(&idention, beforeBuild: scripts.beforeBuilds)
}
if
!scripts.afterBuilds.isEmpty
{
result <<< processScripts(&idention, afterBuild: scripts.afterBuilds)
}
//===
idention -= 1
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
regulars: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
for s in regulars
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
beforeBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("prebuild"))
for s in beforeBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
//===
static
func processScripts(
_ idention: inout Int,
afterBuild: [String]
) -> RawSpec
{
// https://github.com/lyptt/struct/wiki/Spec-format:-v2.0#scripts
//===
var result: RawSpec = []
//===
result <<< (idention, Spec.key("postbuild"))
for s in afterBuild
{
result <<< (idention, "-" + Spec.value(s))
}
//===
return result
}
}

View File

@ -0,0 +1,57 @@
import Foundation
//===
typealias SpecLine = (idention: Int, line: String)
typealias RawSpec = [SpecLine]
//===
func <<< (list: inout RawSpec, element: SpecLine)
{
list.append(element)
}
func <<< (list: inout RawSpec, elements: RawSpec)
{
list.append(contentsOf: elements)
}
//===
public
enum Spec
{
public
enum Format: String
{
case
v1_2_1 = "1.2.1",
v1_3_0 = "1.3.0",
v2_0_0 = "2.0.0",
v2_1_0 = "2.1.0"
}
}
//===
extension Spec
{
static
func ident(_ idention: Int) -> String
{
return Array(repeating: " ", count: idention).joined()
}
static
func key(_ v: Any) -> String
{
return "\(v):"
}
static
func value(_ v: Any) -> String
{
return " \"\(v)\""
}
}

View File

@ -0,0 +1,68 @@
//
// Project.BuildConfig.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/18/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
//===
public
extension Project.Target
{
public
struct BuildConfiguration
{
public
struct Base
{
// internal
init(_ overrides: [KeyValuePair] = [])
{
self.overrides = overrides
}
//===
public private(set)
var overrides: [KeyValuePair] = []
public
mutating
func override(_ pairs: KeyValuePair...)
{
overrides.append(contentsOf: pairs)
}
}
//===
public
let name: String
//---
public private(set)
var overrides: [KeyValuePair] = []
public
mutating
func override(_ pairs: KeyValuePair...)
{
overrides.append(contentsOf: pairs)
}
//---
// internal
init(
_ name: String
)
{
self.name = name
}
}
}

View File

@ -0,0 +1,97 @@
//
// Target.Dependencies.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/17/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
//===
public
extension Project.Target
{
public
typealias BinaryDependency =
(
location: String,
codeSignOnCopy: Bool
)
public
typealias ProjectDependencies =
(
location: String,
frameworks: [ProjectDependency]
)
public
typealias ProjectDependency =
(
name: String,
copy: Bool,
codeSignOnCopy: Bool
)
//===
public
struct Dependencies
{
public private(set)
var fromSDKs: [String] = []
public
mutating
func fromSDK(_ element: String...)
{
fromSDKs.append(contentsOf: element)
}
//===
public private(set)
var otherTargets: [String] = []
public
mutating
func otherTarget(_ element: String...)
{
otherTargets.append(contentsOf: element)
}
//===
public private(set)
var binaries: [BinaryDependency] = []
public
mutating
func binary(_ element: BinaryDependency...)
{
binaries.append(contentsOf: element)
}
//===
public private(set)
var projects: [ProjectDependencies] = []
public
mutating
func project(_ element: ProjectDependencies...)
{
projects.append(contentsOf: element)
}
//===
// internal
init()
{
//
}
}
}

View File

@ -0,0 +1,53 @@
//
// Target.Script.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/18/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
import Foundation
//===
public
extension Project.Target
{
public
struct Scripts
{
public private(set)
var regulars: [String] = []
public
mutating
func regular(_ paths: String...)
{
regulars.append(contentsOf: paths)
}
//---
public private(set)
var beforeBuilds: [String] = []
public
mutating
func beforeBuild(_ paths: String...)
{
beforeBuilds.append(contentsOf: paths)
}
//---
public private(set)
var afterBuilds: [String] = []
public
mutating
func afterBuild(_ paths: String...)
{
afterBuilds.append(contentsOf: paths)
}
}
}

View File

@ -0,0 +1,34 @@
//
// Target.Type.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
extension Project.Target
{
public
enum InternalType: String
{
case
app = ":application",
framework = ":framework",
dynamicLibrary = ":library.dynamic",
staticLibrary = ":library.static",
bundle = ":bundle",
unitTest = ":bundle.unit-test",
uiTest = ":bundle.ui-testing",
appExtension = ":app-extension",
tool = ":tool",
watchApp = ":application.watchapp",
watchApp2 = ":application.watchapp2",
watchKitExtension = ":watchkit-extension",
watchKit2Extension = ":watchkit2-extension",
tvAppExtension = ":tv-app-extension",
messagesApp = ":application.messages",
appExtensionMessages = ":app-extension.messages",
appExtensionMessagesStickers = ":app-extension.messages-sticker-pack",
xpcService = ":xpc-service"
}
}

View File

@ -0,0 +1,169 @@
//
// Target.swift
// MKHProjGen
//
// Created by Maxim Khatskevich on 3/16/17.
// Copyright © 2017 Maxim Khatskevich. All rights reserved.
//
public
extension Project
{
public
struct Target
{
public
typealias BuildConfigurations =
(
all: BuildConfiguration.Base,
debug: BuildConfiguration,
release: BuildConfiguration
)
//---
public
let name: String
public
let platform: Platform
public
let type: InternalType
//---
public private(set)
var includes: [String] = []
public
mutating
func include(_ paths: String...)
{
includes.append(contentsOf: paths)
}
//---
public private(set)
var excludes: [String] = []
public
mutating
func exclude(_ patterns: String...)
{
excludes.append(contentsOf: patterns)
}
//---
public
var sourceOptions: [String: String] = [:]
//---
public private(set)
var i18nResources: [String] = []
public
mutating
func i18nResource(_ paths: String...)
{
i18nResources.append(contentsOf: paths)
}
//---
public
var configurations: BuildConfigurations =
(
Project.Target.BuildConfiguration.Base(
//
),
Project.Target.BuildConfiguration(
Project.BuildConfiguration.Defaults.iOS.debug().name
),
Project.Target.BuildConfiguration(
Project.BuildConfiguration.Defaults.iOS.release().name
)
)
public
var dependencies = Dependencies()
public
var scripts = Scripts()
public
var includeCocoapods = false
//---
public private(set)
var tests: [Target] = []
public
mutating
func unitTests(
_ name: String = "Tests",
_ configureTarget: (inout Target) -> Void
)
{
var ut = Target(self.platform, name, .unitTest, configureTarget)
//===
ut.dependencies.otherTarget(self.name)
if
type == .app
{
ut.configurations.all.override(
// https://github.com/workshop/struct/blob/master/examples/iOS_Application/project.yml#L115
"TEST_HOST"
<<< "$(BUILT_PRODUCTS_DIR)/\(self.name).app/\(self.name)"
)
}
//===
tests.append(ut)
}
public
mutating
func uiTests(
_ name: String = "UITests",
_ configureTarget: (inout Target) -> Void
)
{
var uit = Target(self.platform, name, .uiTest, configureTarget)
uit.dependencies.otherTarget(self.name)
//===
tests.append(uit)
}
//---
// internal
init(
_ platform: Platform,
_ name: String,
_ type: InternalType,
_ configureTarget: (inout Target) -> Void
)
{
self.name = name
self.platform = platform
self.type = type
//---
configureTarget(&self)
}
}
}

View File

@ -0,0 +1 @@
theme: jekyll-theme-cayman

View File

@ -0,0 +1,103 @@
# Customise this file, documentation can be found here:
# https://github.com/KrauseFx/fastlane/tree/master/docs
# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# By default, fastlane will send which actions are used
# No personal data is shared, more information on https://github.com/fastlane/enhancer
# Uncomment the following line to opt out
# opt_out_usage
# If you want to automatically update fastlane if a new version is available:
# update_fastlane
# This is the minimum version number required.
# Update this, if you use features of a newer version
fastlane_version '1.100.0'
default_platform :ios
#===
projName = 'ProjectGenerator'
projFileName = projName + '.xcodeproj'
#===
platform :ios do
lane :inc_version_and_commit do
ensure_git_status_clean
# ===
versionNumber = get_version_number(xcodeproj: projFileName)
puts 'Current VERSION number: ' + versionNumber
# === Infer new version number, suppose we are using GitFlow
currentBranch = git_branch
if currentBranch.include? 'release/'
# we are on a release branch
defaultNewVersion = currentBranch.split('/').last
else
# we are NOT on a release branch
defaultNewVersion = ''
end
# === Define new version number
useInferredNEWVersionNumber = prompt(
text: 'Proceed with inferred NEW version number (' + defaultNewVersion + ')?',
boolean: true
)
if useInferredNEWVersionNumber
newVersionNumber = defaultNewVersion
else
newVersionNumber = prompt(text: 'New VERSION number:')
end
# === Apply NEW version number and increment build number
increment_version_number(
xcodeproj: projFileName,
version_number: newVersionNumber
)
increment_build_number(
xcodeproj: projFileName
)
# ===
newBuildNumber = get_build_number(xcodeproj: projFileName)
commit_version_bump( # it will fail if more than version bump
xcodeproj: projFileName,
message: 'Version Bump to ' + newVersionNumber + ' (' + newBuildNumber + ')'
)
end
end
# More information about multiple platforms in fastlane: https://github.com/KrauseFx/fastlane/blob/master/docs/Platforms.md
# All available actions: https://github.com/KrauseFx/fastlane/blob/master/docs/Actions.md

View File

@ -0,0 +1,43 @@
fastlane documentation
================
# Installation
Make sure you have the latest version of the Xcode command line tools installed:
```
xcode-select --install
```
## Choose your installation method:
<table width="100%" >
<tr>
<th width="33%"><a href="http://brew.sh">Homebrew</a></td>
<th width="33%">Installer Script</td>
<th width="33%">Rubygems</td>
</tr>
<tr>
<td width="33%" align="center">macOS</td>
<td width="33%" align="center">macOS</td>
<td width="33%" align="center">macOS or Linux with Ruby 2.0.0 or above</td>
</tr>
<tr>
<td width="33%"><code>brew cask install fastlane</code></td>
<td width="33%"><a href="https://download.fastlane.tools">Download the zip file</a>. Then double click on the <code>install</code> script (or run it in a terminal window).</td>
<td width="33%"><code>sudo gem install fastlane -NV</code></td>
</tr>
</table>
# Available Actions
## iOS
### ios inc_version_and_commit
```
fastlane ios inc_version_and_commit
```
----
This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

101
Project.Struct.swift Normal file
View File

@ -0,0 +1,101 @@
import XCEProjectGenerator
//===
let params =
(
repoName: "APIClient",
deploymentTarget: "8.0",
companyIdentifier: "io.XCEssentials",
companyPrefix: "XCE"
)
let bundleId =
(
fwk: "\(params.companyIdentifier).\(params.repoName)",
tst: "\(params.companyIdentifier).\(params.repoName).Tst"
)
//===
let specFormat = Spec.Format.v2_1_0
let project = Project("Main") { project in
project.configurations.all.override(
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"SWIFT_VERSION" <<< "3.0",
"VERSIONING_SYSTEM" <<< "apple-generic",
"CURRENT_PROJECT_VERSION" <<< "0" // just a default non-empty value
)
project.configurations.debug.override(
"SWIFT_OPTIMIZATION_LEVEL" <<< "-Onone"
)
//---
project.target("Fwk", .iOS, .framework) { target in
target.include("Sources")
//---
target.configurations.all.override(
"PRODUCT_NAME" <<< "\(params.companyPrefix)\(params.repoName)",
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< bundleId.fwk,
"INFOPLIST_FILE" <<< "Info/Fwk.plist",
//--- iOS related:
"SDKROOT" <<< "iphoneos",
"TARGETED_DEVICE_FAMILY" <<< DeviceFamily.iOS.universal,
//--- Framework related:
"DEFINES_MODULE" <<< "NO",
"SKIP_INSTALL" <<< "YES"
)
target.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
//---
target.unitTests { unitTests in
unitTests.include("Tests")
//---
unitTests.configurations.all.override(
// very important for unit tests,
// prevents the error when unit test do not start at all
"LD_RUNPATH_SEARCH_PATHS" <<<
"$(inherited) @executable_path/Frameworks @loader_path/Frameworks",
"IPHONEOS_DEPLOYMENT_TARGET" <<< params.deploymentTarget, // bug wokraround
"PRODUCT_BUNDLE_IDENTIFIER" <<< bundleId.tst,
"INFOPLIST_FILE" <<< "Info/Tst.plist",
"FRAMEWORK_SEARCH_PATHS" <<< "$(inherited) $(BUILT_PRODUCTS_DIR)"
)
unitTests.configurations.debug.override(
"MTL_ENABLE_DEBUG_INFO" <<< true
)
}
}
}

71
project.yml Normal file
View File

@ -0,0 +1,71 @@
# generated with XCEProjectGenerator
# https://github.com/XCEssentials/ProjectGenerator
# https://github.com/workshop/struct/wiki/Spec-format:-v2.0
version: 2.1.0
configurations:
Debug:
type: "debug"
overrides:
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
SWIFT_VERSION: "3.0"
VERSIONING_SYSTEM: "apple-generic"
CURRENT_PROJECT_VERSION: "0"
SWIFT_OPTIMIZATION_LEVEL: "-Onone"
Release:
type: "release"
overrides:
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
SWIFT_VERSION: "3.0"
VERSIONING_SYSTEM: "apple-generic"
CURRENT_PROJECT_VERSION: "0"
targets:
Fwk:
platform: "ios"
type: ":framework"
sources:
- "Sources"
configurations:
Debug:
PRODUCT_NAME: "XCEAPIClient"
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
PRODUCT_BUNDLE_IDENTIFIER: "io.XCEssentials.APIClient"
INFOPLIST_FILE: "Info/Fwk.plist"
SDKROOT: "iphoneos"
TARGETED_DEVICE_FAMILY: "1,2"
DEFINES_MODULE: "NO"
SKIP_INSTALL: "YES"
MTL_ENABLE_DEBUG_INFO: "true"
Release:
PRODUCT_NAME: "XCEAPIClient"
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
PRODUCT_BUNDLE_IDENTIFIER: "io.XCEssentials.APIClient"
INFOPLIST_FILE: "Info/Fwk.plist"
SDKROOT: "iphoneos"
TARGETED_DEVICE_FAMILY: "1,2"
DEFINES_MODULE: "NO"
SKIP_INSTALL: "YES"
Tests:
platform: "ios"
type: ":bundle.unit-test"
references:
- "Fwk"
sources:
- "Tests"
configurations:
Debug:
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
PRODUCT_BUNDLE_IDENTIFIER: "io.XCEssentials.APIClient.Tst"
INFOPLIST_FILE: "Info/Tst.plist"
FRAMEWORK_SEARCH_PATHS: "$(inherited) $(BUILT_PRODUCTS_DIR)"
MTL_ENABLE_DEBUG_INFO: "true"
Release:
LD_RUNPATH_SEARCH_PATHS: "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"
IPHONEOS_DEPLOYMENT_TARGET: "8.0"
PRODUCT_BUNDLE_IDENTIFIER: "io.XCEssentials.APIClient.Tst"
INFOPLIST_FILE: "Info/Tst.plist"
FRAMEWORK_SEARCH_PATHS: "$(inherited) $(BUILT_PRODUCTS_DIR)"
variants:
$base:
abstract: true
Main: