Skip to content

Commit

Permalink
Merge pull request #41 from morganchen12/vendored_framework
Browse files Browse the repository at this point in the history
Pass pod spec lint
  • Loading branch information
1amageek authored May 23, 2017
2 parents 0c35958 + 19dd2e9 commit 0dae62d
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 4466096f17d078f7b8102c193f6ec91a39ef873b

COCOAPODS: 1.1.1
COCOAPODS: 1.2.1
47 changes: 15 additions & 32 deletions Salada.podspec
Original file line number Diff line number Diff line change
@@ -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
8 changes: 6 additions & 2 deletions Salada.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
8DDA53C01ED38684000C1F06 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; };
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 = "<group>"; };
D56A6B69413A3755C5CDB62E /* Pods_Salada.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Salada.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -148,6 +150,7 @@
12D0BE161E6D1ABD008E9AD0 /* Salada */ = {
isa = PBXGroup;
children = (
8DDA53C01ED38684000C1F06 /* Info.plist */,
12D0BE1D1E6D1ADA008E9AD0 /* Referenceable.swift */,
12D0BE1E1E6D1ADA008E9AD0 /* Salada.swift */,
12D0BE1F1E6D1ADA008E9AD0 /* Salada+Datasource.swift */,
Expand Down Expand Up @@ -294,6 +297,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8DDA53C11ED38684000C1F06 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -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 */ = {
Expand All @@ -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 */ = {
Expand Down
38 changes: 38 additions & 0 deletions Salada/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
4 changes: 1 addition & 3 deletions Salada/Referenceable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
// Copyright © 2017年 Stamp. All rights reserved.
//

import Foundation
import FirebaseDatabase
import FirebaseStorage
import Firebase

/**
Protocol that holds a reference Firebase
Expand Down
63 changes: 12 additions & 51 deletions build.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -193,19 +160,14 @@ 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
/// A value type representing an invocation of `lipo -create`.
struct Lipo {
var inputs: [String]
var output: String

func launch() {
print("lipo \(output)")
let task = Process()
Expand All @@ -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)"
}
Expand Down

0 comments on commit 0dae62d

Please sign in to comment.