diff --git a/Podfile.lock b/Podfile.lock index 656fca0..36e5071 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -43,4 +43,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 4466096f17d078f7b8102c193f6ec91a39ef873b -COCOAPODS: 1.1.1 +COCOAPODS: 1.2.1 diff --git a/Salada.podspec b/Salada.podspec index ab03368..2cfdb28 100644 --- a/Salada.podspec +++ b/Salada.podspec @@ -1,37 +1,20 @@ Pod::Spec.new do |s| - s.name = "Salada" - s.version = "2.0" - s.summary = "Salada is OR Mapper for Firebase." - s.homepage = "https://github.com/1amageek/Salada" - s.license = { :type => "BSD" } - s.author = "1amageek" - s.social_media_url = "https://twitter.com/1amageek" - s.platform = :ios - s.ios.deployment_target = "8.0" - s.ios.framework = "UIKit" - s.requires_arc = true - s.source = { :git => "https://github.com/1amageek/Salada.git", :tag => "#{s.version}" } - s.source_files = "Salada/**/*.swift" - - s.dependency 'Firebase/Core' - s.dependency "Firebase/Database" - s.dependency "Firebase/Storage" - - s.pod_target_xcconfig = { - "OTHER_LDFLAGS" => '$(inherited) ' + - '-framework "FirebaseCore" ' + - '-framework "FirebaseDatabase" ' + - '-framework "FirebaseStorage" ' + - '-framework "FirebaseInstanceID" ', + s.name = "Salada" + s.version = "2.0" + s.summary = "Salada is OR Mapper for Firebase." + s.homepage = "https://github.com/1amageek/Salada" + s.license = { :type => 'BSD', :file => 'SaladaFrameworks/LICENSE' } + s.author = "1amageek" + s.social_media_url = "https://twitter.com/1amageek" + s.platform = :ios + s.ios.deployment_target = "8.0" + s.ios.framework = "UIKit" + s.requires_arc = true + s.source = { :http => "https://github.com/1amageek/Salada/releases/download/2.1/SaladaFrameworks.zip" } + s.ios.vendored_frameworks = 'SaladaFrameworks/Salada/Frameworks/Salada.framework' - "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES" => 'YES', - - "FRAMEWORK_SEARCH_PATHS" => '$(inherited) ' + - '"${PODS_ROOT}/FirebaseCore/Frameworks" ' + - '"${PODS_ROOT}/FirebaseDatabase/Frameworks" ' + - '"${PODS_ROOT}/FirebaseStorage/Frameworks" ' + - '"${PODS_ROOT}/FirebaseInstanceID/Frameworks" ' - } + s.dependency "Firebase/Database" + s.dependency "Firebase/Storage" end diff --git a/Salada.xcodeproj/project.pbxproj b/Salada.xcodeproj/project.pbxproj index 09a89a8..d750a6c 100644 --- a/Salada.xcodeproj/project.pbxproj +++ b/Salada.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 12F6446F1E8CF49F0014CB4C /* Salada.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D0BE1E1E6D1ADA008E9AD0 /* Salada.swift */; }; 12F644701E8CF49F0014CB4C /* Salada+Datasource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D0BE1F1E6D1ADA008E9AD0 /* Salada+Datasource.swift */; }; 12F644711E8CF49F0014CB4C /* Salada+Relation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D0BE201E6D1ADA008E9AD0 /* Salada+Relation.swift */; }; + 8DDA53C11ED38684000C1F06 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8DDA53C01ED38684000C1F06 /* Info.plist */; }; 9088C4FC448D53572D030044 /* Pods_SaladBar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 265B3FF55EA9541C849D9365 /* Pods_SaladBar.framework */; }; B2DAD0D9709B23A30CB0EE7E /* Pods_Salada.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D56A6B69413A3755C5CDB62E /* Pods_Salada.framework */; }; /* End PBXBuildFile section */ @@ -65,6 +66,7 @@ 358EA389C352FB0DBF611EBD /* Pods-SaladaTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SaladaTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SaladaTests/Pods-SaladaTests.debug.xcconfig"; sourceTree = ""; }; 788D92D6A77F55576E11BEF0 /* Pods-SaladaTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SaladaTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SaladaTests/Pods-SaladaTests.release.xcconfig"; sourceTree = ""; }; 7B9402518CF51E7EAFB4ED63 /* Pods-SaladBar.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SaladBar.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SaladBar/Pods-SaladBar.debug.xcconfig"; sourceTree = ""; }; + 8DDA53C01ED38684000C1F06 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B527BBE07E11D96C847178F4 /* Pods-Salada.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Salada.release.xcconfig"; path = "Pods/Target Support Files/Pods-Salada/Pods-Salada.release.xcconfig"; sourceTree = ""; }; CACFF8A827AF5750D7560F54 /* Pods-Salada.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Salada.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Salada/Pods-Salada.debug.xcconfig"; sourceTree = ""; }; D56A6B69413A3755C5CDB62E /* Pods_Salada.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Salada.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -148,6 +150,7 @@ 12D0BE161E6D1ABD008E9AD0 /* Salada */ = { isa = PBXGroup; children = ( + 8DDA53C01ED38684000C1F06 /* Info.plist */, 12D0BE1D1E6D1ADA008E9AD0 /* Referenceable.swift */, 12D0BE1E1E6D1ADA008E9AD0 /* Salada.swift */, 12D0BE1F1E6D1ADA008E9AD0 /* Salada+Datasource.swift */, @@ -294,6 +297,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8DDA53C11ED38684000C1F06 /* Info.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -312,7 +316,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 5695729C28C4EED4932F010E /* [CP] Check Pods Manifest.lock */ = { @@ -327,7 +331,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; 7E89B42D6FC7A99CB29625F5 /* [CP] Copy Pods Resources */ = { diff --git a/Salada/Info.plist b/Salada/Info.plist new file mode 100644 index 0000000..38e98af --- /dev/null +++ b/Salada/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Salada/Referenceable.swift b/Salada/Referenceable.swift index 009da8b..f94d67c 100644 --- a/Salada/Referenceable.swift +++ b/Salada/Referenceable.swift @@ -6,9 +6,7 @@ // Copyright © 2017年 Stamp. All rights reserved. // -import Foundation -import FirebaseDatabase -import FirebaseStorage +import Firebase /** Protocol that holds a reference Firebase diff --git a/build.swift b/build.swift index 734850c..83568d4 100755 --- a/build.swift +++ b/build.swift @@ -10,10 +10,6 @@ let schemes = [ "Salada" ] -let staticLibs = [ - "Salada": "Salada", -] - // TODO: Use NSFileManager instead of all these awful // manual path appendings and mkdir/mv/cp let DerivedDataDir = "artifacts/" @@ -91,31 +87,17 @@ func buildTask(args: [String] = []) -> Process { return task } -//let test = buildTask(args: [ -// "-workspace", "Salada.xcworkspace", -// "-scheme", "Salada", -// "-sdk", "iphonesimulator", -// "-destination", "platform=iOS Simulator,name=iPhone 7", -// "test", -// "ONLY_ACTIVE_ARCH=YES", "CODE_SIGNING_REQUIRED=NO" -//]) -//test.launch() -//test.waitUntilExit() -//guard test.terminationStatus == 0 else { -// exit(test.terminationStatus) -//} - /// A value type representing an xcodebuild call. /// param keys are parameters and expect leading dashes, /// i.e. `-workspace` struct Build { - + var params: [String: String] - + init(_ params: [String: String]) { self.params = params } - + var args: [String] { var params: [String] = [] let keys = self.params.keys @@ -130,10 +112,10 @@ struct Build { // files are built with bitcode, hope for // no consequences later params.append("BITCODE_GENERATION_MODE=bitcode") - params.append("ONLY_ACTIVE_ARCH=YES") + params.append("ONLY_ACTIVE_ARCH=NO") return params } - + func launch() { let task = buildTask(args: self.args) task.launch() @@ -153,23 +135,8 @@ schemes.forEach { scheme in mkdir(schemeDir + "/Frameworks") } -// Invoke xcodebuild, building each scheme in -// release for each target sdk. Building -// dynamic frameworks so we don't have to do -// the asset bundling and folder structures manually, -// at the costs of lots of duplication. Not sure if ideal. -let builds = schemes.map { scheme in - return Build([ - "-workspace" : "Salada.xcworkspace", - "-scheme" : scheme, - "-configuration" : "Release", - "-sdk" : sdks[0], - "-derivedDataPath": DerivedDataDir, - ]) -} - -let staticBuilds: [Build] = sdks.flatMap { sdk -> [Build] in - let schemeNames = Array(staticLibs.keys) +let builds: [Build] = sdks.flatMap { sdk -> [Build] in + let schemeNames = schemes return schemeNames.map { scheme -> Build in return Build([ "-workspace" : "Salada.xcworkspace", @@ -181,8 +148,8 @@ let staticBuilds: [Build] = sdks.flatMap { sdk -> [Build] in } } +// builds.forEach { $0.launch() } builds.forEach { $0.launch() } -staticBuilds.forEach { $0.launch() } // Copy frameworks into built products dir. Don't really // care about sdk here since we're gonna lipo everything later @@ -193,11 +160,6 @@ schemes.forEach { scheme in let framework = scheme let frameworkPath = "\(DerivedDataDir)Build/Products/Release-\(sdk)/\(framework).framework" cp(from: frameworkPath, to: frameworkDir) - -// let frameworkModulePath = "\(frameworkPath)/Modules/\(framework).swiftmodule" -// let frameworkModuleDir = "\(frameworkDir)/\(framework).framework/Modules/\(framework).swiftmodule" -// mkdir(frameworkModuleDir) -// cp(from: frameworkModulePath, to: frameworkModuleDir) } // Lipo @@ -205,7 +167,7 @@ schemes.forEach { scheme in struct Lipo { var inputs: [String] var output: String - + func launch() { print("lipo \(output)") let task = Process() @@ -226,11 +188,10 @@ let productsPaths = sdks.map { } // create lipo tasks from built products -let lipos: [Lipo] = Array(staticLibs.keys).map { scheme in - let product = staticLibs[scheme]! +let lipos: [Lipo] = schemes.map { scheme in + let product = scheme let framework = "\(product).framework" - // let binary = "lib\(scheme).a" - + let chunks = productsPaths.map { path in return "\(path)/\(framework)/\(product)" }