Skip to content

Commit 3f80463

Browse files
author
chenliming
committed
添加build脚本
1 parent 8b39f68 commit 3f80463

File tree

2 files changed

+129
-2
lines changed

2 files changed

+129
-2
lines changed

FrameWork/LFLiveKit.xcodeproj/project.pbxproj

+98-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@
66
objectVersion = 46;
77
objects = {
88

9+
/* Begin PBXAggregateTarget section */
10+
84D003751DB8FE1000560583 /* LFLiveKitFramework-universal */ = {
11+
isa = PBXAggregateTarget;
12+
buildConfigurationList = 84D003761DB8FE1000560583 /* Build configuration list for PBXAggregateTarget "LFLiveKitFramework-universal" */;
13+
buildPhases = (
14+
84D0037B1DB8FE1C00560583 /* ShellScript */,
15+
);
16+
dependencies = (
17+
84D0037A1DB8FE1800560583 /* PBXTargetDependency */,
18+
);
19+
name = "LFLiveKitFramework-universal";
20+
productName = "LFLiveKitFramework-universal";
21+
};
22+
/* End PBXAggregateTarget section */
23+
924
/* Begin PBXBuildFile section */
1025
8495F66F1DB8F14600542124 /* LFLiveKitFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 8495F66D1DB8F14600542124 /* LFLiveKitFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
1126
8495F6731DB8F1EE00542124 /* LFAudioCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = 84D8B5851D768B6E00752B56 /* LFAudioCapture.h */; };
@@ -110,6 +125,16 @@
110125
84D8B5EA1D768B6E00752B56 /* NSMutableArray+LFAdd.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D8B5BA1D768B6E00752B56 /* NSMutableArray+LFAdd.m */; };
111126
/* End PBXBuildFile section */
112127

128+
/* Begin PBXContainerItemProxy section */
129+
84D003791DB8FE1800560583 /* PBXContainerItemProxy */ = {
130+
isa = PBXContainerItemProxy;
131+
containerPortal = 84D8B3871D7574D600752B56 /* Project object */;
132+
proxyType = 1;
133+
remoteGlobalIDString = 8495F66A1DB8F14600542124;
134+
remoteInfo = LFLiveKitFramework;
135+
};
136+
/* End PBXContainerItemProxy section */
137+
113138
/* Begin PBXFileReference section */
114139
8495F66B1DB8F14600542124 /* LFLiveKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LFLiveKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
115140
8495F66D1DB8F14600542124 /* LFLiveKitFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LFLiveKitFramework.h; sourceTree = "<group>"; };
@@ -429,6 +454,7 @@
429454
8495F6671DB8F14600542124 /* Frameworks */,
430455
8495F6681DB8F14600542124 /* Headers */,
431456
8495F6691DB8F14600542124 /* Resources */,
457+
84D0037D1DB9023F00560583 /* ShellScript */,
432458
);
433459
buildRules = (
434460
);
@@ -469,6 +495,11 @@
469495
CreatedOnToolsVersion = 8.0;
470496
ProvisioningStyle = Automatic;
471497
};
498+
84D003751DB8FE1000560583 = {
499+
CreatedOnToolsVersion = 8.0;
500+
DevelopmentTeam = G497YX6CBT;
501+
ProvisioningStyle = Automatic;
502+
};
472503
84D8B38F1D7574D600752B56 = {
473504
CreatedOnToolsVersion = 7.3.1;
474505
};
@@ -488,6 +519,7 @@
488519
targets = (
489520
84D8B38F1D7574D600752B56 /* LFLiveKit */,
490521
8495F66A1DB8F14600542124 /* LFLiveKitFramework */,
522+
84D003751DB8FE1000560583 /* LFLiveKitFramework-universal */,
491523
);
492524
};
493525
/* End PBXProject section */
@@ -502,6 +534,35 @@
502534
};
503535
/* End PBXResourcesBuildPhase section */
504536

537+
/* Begin PBXShellScriptBuildPhase section */
538+
84D0037B1DB8FE1C00560583 /* ShellScript */ = {
539+
isa = PBXShellScriptBuildPhase;
540+
buildActionMask = 2147483647;
541+
files = (
542+
);
543+
inputPaths = (
544+
);
545+
outputPaths = (
546+
);
547+
runOnlyForDeploymentPostprocessing = 0;
548+
shellPath = /bin/sh;
549+
shellScript = "../scripts/build-universal-framework.sh\n";
550+
};
551+
84D0037D1DB9023F00560583 /* ShellScript */ = {
552+
isa = PBXShellScriptBuildPhase;
553+
buildActionMask = 2147483647;
554+
files = (
555+
);
556+
inputPaths = (
557+
);
558+
outputPaths = (
559+
);
560+
runOnlyForDeploymentPostprocessing = 0;
561+
shellPath = /bin/sh;
562+
shellScript = "echo \"${env}\"";
563+
};
564+
/* End PBXShellScriptBuildPhase section */
565+
505566
/* Begin PBXSourcesBuildPhase section */
506567
8495F6661DB8F14600542124 /* Sources */ = {
507568
isa = PBXSourcesBuildPhase;
@@ -563,6 +624,14 @@
563624
};
564625
/* End PBXSourcesBuildPhase section */
565626

627+
/* Begin PBXTargetDependency section */
628+
84D0037A1DB8FE1800560583 /* PBXTargetDependency */ = {
629+
isa = PBXTargetDependency;
630+
target = 8495F66A1DB8F14600542124 /* LFLiveKitFramework */;
631+
targetProxy = 84D003791DB8FE1800560583 /* PBXContainerItemProxy */;
632+
};
633+
/* End PBXTargetDependency section */
634+
566635
/* Begin XCBuildConfiguration section */
567636
8495F6711DB8F14600542124 /* Debug */ = {
568637
isa = XCBuildConfiguration;
@@ -588,6 +657,7 @@
588657
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
589658
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
590659
MACH_O_TYPE = staticlib;
660+
OTHER_LDFLAGS = "-ObjC";
591661
PRODUCT_BUNDLE_IDENTIFIER = com.youku.LFLiveKit;
592662
PRODUCT_NAME = LFLiveKit;
593663
SKIP_INSTALL = YES;
@@ -618,12 +688,29 @@
618688
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
619689
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
620690
MACH_O_TYPE = staticlib;
691+
OTHER_LDFLAGS = "-ObjC";
621692
PRODUCT_BUNDLE_IDENTIFIER = com.youku.LFLiveKit;
622693
PRODUCT_NAME = LFLiveKit;
623694
SKIP_INSTALL = YES;
624695
};
625696
name = Release;
626697
};
698+
84D003771DB8FE1000560583 /* Debug */ = {
699+
isa = XCBuildConfiguration;
700+
buildSettings = {
701+
DEVELOPMENT_TEAM = G497YX6CBT;
702+
PRODUCT_NAME = "$(TARGET_NAME)";
703+
};
704+
name = Debug;
705+
};
706+
84D003781DB8FE1000560583 /* Release */ = {
707+
isa = XCBuildConfiguration;
708+
buildSettings = {
709+
DEVELOPMENT_TEAM = G497YX6CBT;
710+
PRODUCT_NAME = "$(TARGET_NAME)";
711+
};
712+
name = Release;
713+
};
627714
84D8B3961D7574D600752B56 /* Debug */ = {
628715
isa = XCBuildConfiguration;
629716
buildSettings = {
@@ -723,7 +810,7 @@
723810
DYLIB_INSTALL_NAME_BASE = "@rpath";
724811
HEADER_SEARCH_PATHS = (
725812
"$(inherited)",
726-
"\"$(SRCROOT)/../LFLiveKitDemo/Pods\"/**",
813+
"\"$(SRCROOT)/../samples/LFLiveKitDemo/Pods\"/**",
727814
);
728815
INFOPLIST_FILE = Info.plist;
729816
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -747,7 +834,7 @@
747834
DYLIB_INSTALL_NAME_BASE = "@rpath";
748835
HEADER_SEARCH_PATHS = (
749836
"$(inherited)",
750-
"\"$(SRCROOT)/../LFLiveKitDemo/Pods\"/**",
837+
"\"$(SRCROOT)/../samples/LFLiveKitDemo/Pods\"/**",
751838
);
752839
INFOPLIST_FILE = Info.plist;
753840
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -774,6 +861,15 @@
774861
defaultConfigurationIsVisible = 0;
775862
defaultConfigurationName = Release;
776863
};
864+
84D003761DB8FE1000560583 /* Build configuration list for PBXAggregateTarget "LFLiveKitFramework-universal" */ = {
865+
isa = XCConfigurationList;
866+
buildConfigurations = (
867+
84D003771DB8FE1000560583 /* Debug */,
868+
84D003781DB8FE1000560583 /* Release */,
869+
);
870+
defaultConfigurationIsVisible = 0;
871+
defaultConfigurationName = Release;
872+
};
777873
84D8B38A1D7574D600752B56 /* Build configuration list for PBXProject "LFLiveKit" */ = {
778874
isa = XCConfigurationList;
779875
buildConfigurations = (

scripts/build-universal-framework.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
UNIVERSAL_OUTPUT_FOLDER="${PROJECT_DIR}/build/"
4+
5+
# make the output directory and delete the framework directory
6+
mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}"
7+
rm -rf "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework"
8+
9+
# Step 1. Build Device and Simulator versions
10+
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
11+
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
12+
13+
# Step 2. Copy the framework structure to the universal folder
14+
echo "==============Step 2=============="
15+
echo "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework"
16+
17+
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUT_FOLDER}/"
18+
19+
# Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory
20+
lipo -create -output "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
21+
22+
echo "==============Completion=============="
23+
echo "${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}"
24+
25+
# Step 4. Copy strings bundle if exists
26+
STRINGS_INPUT_FOLDER="${PROJECT_NAME}Strings.bundle"
27+
if [ -d "${STRINGS_INPUT_FOLDER}" ]; then
28+
STRINGS_OUTPUT_FOLDER="${UNIVERSAL_OUTPUT_FOLDER}/${PROJECT_NAME}Strings.bundle"
29+
rm -rf "${STRINGS_OUTPUT_FOLDER}"
30+
cp -R "${STRINGS_INPUT_FOLDER}" "${STRINGS_OUTPUT_FOLDER}"
31+
fi

0 commit comments

Comments
 (0)