未验证 提交 6ba6d812 编写于 作者: D Dan Field 提交者: GitHub

Ocmock dylib (#21786)

- Build OCMock as a dylib for iOS tests
- Set install_name for ios_flutter_test and ocmock dylibs
- Copy and sign dylibs during build process
上级 0332d5e6
......@@ -105,7 +105,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'f83d1d75216e97fb696434bca1cb9a4e7a570fb6',
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'e5b7a41ce43f8a00d5fcb9c55cb16b9c7697e8aa',
# Fuchsia compatibility
#
......
......@@ -158,7 +158,6 @@ source_set("flutter_framework_source") {
}
}
ios_test_flutter_path = rebase_path("$root_out_dir/libios_test_flutter.dylib")
platform_frameworks_path =
rebase_path("$ios_sdk_path/../../Library/Frameworks/")
......@@ -181,15 +180,12 @@ source_set("ios_test_flutter_mrc") {
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/third_party/tonic",
"//flutter/third_party/txt",
"//third_party/ocmock:ocmock",
"//third_party/ocmock:ocmock_shared",
"//third_party/rapidjson",
"//third_party/skia",
]
}
# NOTE: This currently only supports simulator targets because of the install_name.
# TODO(54504): Switch the install_name and make the test runner copy the dynamic
# library into the testing bundle.
shared_library("ios_test_flutter") {
visibility = [ ":*" ]
cflags = [
......@@ -200,9 +196,9 @@ shared_library("ios_test_flutter") {
]
ldflags = [
"-F$platform_frameworks_path",
"-Wl,-framework,XCTest",
"-Wl,-install_name,$ios_test_flutter_path",
"-Wl,-install_name,@rpath/Frameworks/libios_test_flutter.dylib",
]
libs = [ "XCTest.framework" ]
configs -= [
"//build/config/gcc:symbol_visibility_hidden",
"//build/config:symbol_visibility_hidden",
......@@ -223,7 +219,7 @@ shared_library("ios_test_flutter") {
"//flutter/shell/platform/darwin/common:framework_shared",
"//flutter/third_party/tonic",
"//flutter/third_party/txt",
"//third_party/ocmock:ocmock",
"//third_party/ocmock:ocmock_shared",
"//third_party/rapidjson",
"//third_party/skia",
]
......
......@@ -27,6 +27,19 @@
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
24EBCE9E2534C400008D1687 /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 12;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
0AC232F424BA71D300A85907 /* SemanticsObjectTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SemanticsObjectTest.mm; sourceTree = "<group>"; };
0AC232F724BA71D300A85907 /* FlutterEngineTest.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FlutterEngineTest.mm; sourceTree = "<group>"; };
......@@ -158,8 +171,10 @@
buildConfigurationList = 0D6AB6D222BB05E200EEE540 /* Build configuration list for PBXNativeTarget "IosUnitTests" */;
buildPhases = (
0D6AB6AD22BB05E100EEE540 /* Sources */,
242904382534E32900F90C97 /* ShellScript */,
0D6AB6AE22BB05E100EEE540 /* Frameworks */,
0D6AB6AF22BB05E100EEE540 /* Resources */,
24EBCE9E2534C400008D1687 /* Embed Libraries */,
);
buildRules = (
);
......@@ -246,6 +261,26 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
242904382534E32900F90C97 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -ex\nxcode_frameworks_dir=\"${TARGET_BUILD_DIR}/${PlugIns/IosUnitTestsTests.xctest/Frameworks/}\"\nmkdir -p \"${xcode_frameworks_dir}\"\nflutter_engine_rel_path=\"../../../../out/${FLUTTER_ENGINE}\"\ncp -f \"${flutter_engine_rel_path}/libios_test_flutter.dylib\" \"${xcode_frameworks_dir}\"\ncp -f \"${flutter_engine_rel_path}/libocmock_shared.dylib\" \"${xcode_frameworks_dir}\"\nif [[ -n \"${EXPANDED_CODE_SIGN_IDENTITY:-}\" ]]; then\n codesign --force --verbose --sign \"${EXPANDED_CODE_SIGN_IDENTITY}\" -- \"${xcode_frameworks_dir}/libocmock_shared.dylib\"\n codesign --force --verbose --sign \"${EXPANDED_CODE_SIGN_IDENTITY}\" -- \"${xcode_frameworks_dir}/libios_test_flutter.dylib\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
0D6AB6AD22BB05E100EEE540 /* Sources */ = {
isa = PBXSourcesBuildPhase;
......@@ -475,9 +510,11 @@
../../../../out/$FLUTTER_ENGINE,
../../../../out/$FLUTTER_ENGINE/obj/flutter/shell/platform/darwin/ios/,
../../../../out/$FLUTTER_ENGINE/obj/third_party/ocmock/,
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = (
"-locmock",
"-L../../../../out/$FLUTTER_ENGINE",
"-locmock_shared",
"-ObjC",
"-lios_test_flutter",
);
......@@ -517,9 +554,11 @@
../../../../out/$FLUTTER_ENGINE,
../../../../out/$FLUTTER_ENGINE/obj/flutter/shell/platform/darwin/ios/,
../../../../out/$FLUTTER_ENGINE/obj/third_party/ocmock/,
"$(PROJECT_DIR)",
);
OTHER_LDFLAGS = (
"-locmock",
"-L../../../../out/$FLUTTER_ENGINE",
"-locmock_shared",
"-ObjC",
"-lios_test_flutter",
);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册