forked from calabash/DeviceAgent.iOS
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: GemuseBouche dylibs for testing injection
We need some dylibs to test injection on Test Cloud.
- Loading branch information
Showing
10 changed files
with
720 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
DeviceAgent.xcworkspace/xcshareddata/xcschemes/GemuseBouche.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "0920" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F5FEA54F201B1F7D00CEF56A" | ||
BuildableName = "GemuseBouche" | ||
BlueprintName = "GemuseBouche" | ||
ReferencedContainer = "container:DeviceAgent.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
language = "" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
</Testables> | ||
<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"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F5FEA54F201B1F7D00CEF56A" | ||
BuildableName = "GemuseBouche" | ||
BlueprintName = "GemuseBouche" | ||
ReferencedContainer = "container:DeviceAgent.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
<AdditionalOptions> | ||
</AdditionalOptions> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<MacroExpansion> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F5FEA54F201B1F7D00CEF56A" | ||
BuildableName = "GemuseBouche" | ||
BlueprintName = "GemuseBouche" | ||
ReferencedContainer = "container:DeviceAgent.xcodeproj"> | ||
</BuildableReference> | ||
</MacroExpansion> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
extern NSString *const kCBXBetaVulgarisLibVersion; | ||
|
||
@interface CBXBetaVulgaris : NSObject | ||
|
||
+ (NSString *)familyName; | ||
+ (NSArray *)vegetables; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
#import "CBXBetaVulgaris.h" | ||
|
||
NSString *const kCBXBetaVulgarisLibVersion = @"kCBXLibVersion:1.0.0"; | ||
|
||
@implementation CBXBetaVulgaris | ||
|
||
+ (NSString *)familyName { | ||
return @"Beta Vulgaris"; | ||
} | ||
|
||
+ (NSArray *)vegetables { | ||
return @[@"beets", @"chard"]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
extern NSString *const kCBXBrassicaLibVersion; | ||
|
||
@interface CBXBrassica : NSObject | ||
|
||
+ (NSString *)familyName; | ||
+ (NSArray *)vegetables; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
#import "CBXBrassica.h" | ||
|
||
NSString *const kCBXBrassicaLibVersion = @"kCBXLibVersion:1.0.0"; | ||
|
||
@implementation CBXBrassica | ||
|
||
+ (NSString *)familyName { | ||
return @"Brassica"; | ||
} | ||
|
||
+ (NSArray *)vegetables { | ||
return @[@"cabbage", @"broccoli", @"kale", @"pak choi"]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
extern NSString *const kCBXCurcubitsLibVersion; | ||
|
||
@interface CBXCurcubits : NSObject | ||
|
||
+ (NSString *)familyName; | ||
+ (NSArray *)vegetables; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
#import "CBXCurcubits.h" | ||
|
||
NSString *const kCBXCurcubitsLibVersion = @"kCBXLibVersion:1.0.0"; | ||
|
||
@implementation CBXCurcubits | ||
|
||
+ (NSString *)familyName { | ||
return @"Curcubits"; | ||
} | ||
|
||
+ (NSArray *)vegetables { | ||
return @[@"squash", @"pumpkin", @"cucumber", @"melon"]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/usr/bin/env bash | ||
|
||
source bin/log.sh | ||
source bin/ditto.sh | ||
source bin/simctl.sh | ||
|
||
ensure_valid_core_sim_service | ||
|
||
set -e | ||
|
||
banner "Preparing" | ||
|
||
hash xcpretty 2>/dev/null | ||
if [ $? -eq 0 ] && [ "${XCPRETTY}" != "0" ]; then | ||
XC_PIPE='xcpretty -c' | ||
else | ||
XC_PIPE='cat' | ||
fi | ||
|
||
if [ "${1}" = "--upload" ]; then | ||
UPLOAD_TO_S3="1" | ||
fi | ||
|
||
XC_WORKSPACE="DeviceAgent.xcworkspace" | ||
XC_CONFIG=Release | ||
|
||
XC_BUILD_DIR="build/GemuseBouche" | ||
ARM_PRODUCT_DIR="${XC_BUILD_DIR}/Build/Products/Release-iphoneos" | ||
SIM_PRODUCT_DIR="${XC_BUILD_DIR}/Build/Products/Release-iphonesimulator" | ||
mkdir -p "${ARM_PRODUCT_DIR}" | ||
mkdir -p "${SIM_PRODUCT_DIR}" | ||
info "Prepared build directory ${XC_BUILD_DIR}" | ||
|
||
INSTALL_DIR="Products/lib/GemuseBouche" | ||
rm -rf "${INSTALL_DIR}" | ||
mkdir -p "${INSTALL_DIR}" | ||
info "Prepared install directory ${INSTALL_DIR}" | ||
|
||
banner "Building GemuseBouche" | ||
|
||
function build_libs_for_arch { | ||
if [ "${1}" = "sim" ]; then | ||
local arches="i386 x86_64" | ||
local sdk="iphonesimulator" | ||
else | ||
local arches="armv7 armv7s arm64" | ||
local sdk="iphoneos" | ||
fi | ||
|
||
COMMAND_LINE_BUILD=1 xcrun xcodebuild \ | ||
-workspace "${XC_WORKSPACE}" \ | ||
-scheme "GemuseBouche" \ | ||
-derivedDataPath "${XC_BUILD_DIR}" \ | ||
-configuration "${XC_CONFIG}" \ | ||
-sdk "${sdk}" \ | ||
ARCHS="${arches}" \ | ||
VALID_ARCHS="${arches}" \ | ||
ONLY_ACTIVE_ARCH=NO \ | ||
build | $XC_PIPE | ||
|
||
EXIT_CODE=${PIPESTATUS[0]} | ||
|
||
if [ $EXIT_CODE != 0 ]; then | ||
error "Building libraries failed." | ||
exit $EXIT_CODE | ||
fi | ||
} | ||
|
||
build_libs_for_arch "arm" | ||
build_libs_for_arch "sim" | ||
|
||
function fat_lib_with_lipo { | ||
local arm_lib="${ARM_PRODUCT_DIR}/${1}.dylib" | ||
local sim_lib="${SIM_PRODUCT_DIR}/${1}.dylib" | ||
local fat_lib="${INSTALL_DIR}/${1}.dylib" | ||
xcrun lipo -create "${arm_lib}" "${sim_lib}" \ | ||
-output "${fat_lib}" | ||
|
||
"${HOME}/.calabash/calabash-codesign/apple/resign-dylib.sh" \ | ||
"${fat_lib}" | ||
|
||
local version=$(xcrun strings "${fat_lib}" | \ | ||
grep -E 'kCBXLibVersion' | head -n1 | cut -f2- -d":") | ||
info "Installed version $version to ${fat_lib}" | ||
|
||
if [ "${UPLOAD_TO_S3}" = "1" ]; then | ||
aws s3 cp "${fat_lib}" \ | ||
"s3://calabash-files/dylibs/to-test-injection/${1}.dylib" | ||
fi | ||
} | ||
|
||
fat_lib_with_lipo "libCucurbits" | ||
fat_lib_with_lipo "libBetaVulgaris" | ||
fat_lib_with_lipo "libBrassica" | ||
|
||
info "Done!" |