mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Move buildable module test to a module test (#36102)
This commit is contained in:
parent
8ec730c3a3
commit
2d08fec368
@ -32,7 +32,7 @@ Future<void> main() async {
|
||||
});
|
||||
await prepareProvisioningCertificates(projectDir.path);
|
||||
|
||||
section('Build ephemeral host app without CocoaPods');
|
||||
section('Build ephemeral host app in release mode without CocoaPods');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter(
|
||||
@ -41,18 +41,96 @@ Future<void> main() async {
|
||||
);
|
||||
});
|
||||
|
||||
final bool ephemeralHostAppBuilt = exists(Directory(path.join(
|
||||
final Directory ephemeralReleaseHostApp = Directory(path.join(
|
||||
projectDir.path,
|
||||
'build',
|
||||
'ios',
|
||||
'iphoneos',
|
||||
'Runner.app',
|
||||
)));
|
||||
));
|
||||
|
||||
if (!ephemeralHostAppBuilt) {
|
||||
if (!exists(ephemeralReleaseHostApp)) {
|
||||
return TaskResult.failure('Failed to build ephemeral host .app');
|
||||
}
|
||||
|
||||
if (!await _isAppAotBuild(ephemeralReleaseHostApp)) {
|
||||
return TaskResult.failure(
|
||||
'Ephemeral host app ${ephemeralReleaseHostApp.path} was not a release build as expected'
|
||||
);
|
||||
}
|
||||
|
||||
section('Clean build');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter('clean');
|
||||
});
|
||||
|
||||
section('Build ephemeral host app in profile mode without CocoaPods');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter(
|
||||
'build',
|
||||
options: <String>['ios', '--no-codesign', '--profile'],
|
||||
);
|
||||
});
|
||||
|
||||
final Directory ephemeralProfileHostApp = Directory(path.join(
|
||||
projectDir.path,
|
||||
'build',
|
||||
'ios',
|
||||
'iphoneos',
|
||||
'Runner.app',
|
||||
));
|
||||
|
||||
if (!exists(ephemeralProfileHostApp)) {
|
||||
return TaskResult.failure('Failed to build ephemeral host .app');
|
||||
}
|
||||
|
||||
if (!await _isAppAotBuild(ephemeralProfileHostApp)) {
|
||||
return TaskResult.failure(
|
||||
'Ephemeral host app ${ephemeralProfileHostApp.path} was not a profile build as expected'
|
||||
);
|
||||
}
|
||||
|
||||
section('Clean build');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter('clean');
|
||||
});
|
||||
|
||||
section('Build ephemeral host app in debug mode for simulator without CocoaPods');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
await flutter(
|
||||
'build',
|
||||
options: <String>['ios', '--no-codesign', '--simulator', '--debug'],
|
||||
);
|
||||
});
|
||||
|
||||
final Directory ephemeralDebugHostApp = Directory(path.join(
|
||||
projectDir.path,
|
||||
'build',
|
||||
'ios',
|
||||
'iphonesimulator',
|
||||
'Runner.app',
|
||||
));
|
||||
|
||||
if (!exists(ephemeralDebugHostApp)) {
|
||||
return TaskResult.failure('Failed to build ephemeral host .app');
|
||||
}
|
||||
|
||||
if (!exists(File(path.join(
|
||||
ephemeralDebugHostApp.path,
|
||||
'Frameworks',
|
||||
'App.framework',
|
||||
'flutter_assets',
|
||||
'isolate_snapshot_data',
|
||||
)))) {
|
||||
return TaskResult.failure(
|
||||
'Ephemeral host app ${ephemeralDebugHostApp.path} was not a debug build as expected'
|
||||
);
|
||||
}
|
||||
|
||||
section('Clean build');
|
||||
|
||||
await inDirectory(projectDir, () async {
|
||||
@ -179,3 +257,22 @@ Future<void> main() async {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<bool> _isAppAotBuild(Directory app) async {
|
||||
final String binary = path.join(
|
||||
app.path,
|
||||
'Frameworks',
|
||||
'App.framework',
|
||||
'App'
|
||||
);
|
||||
|
||||
final String symbolTable = await eval(
|
||||
'nm',
|
||||
<String> [
|
||||
'-gU',
|
||||
binary,
|
||||
],
|
||||
);
|
||||
|
||||
return symbolTable.contains('kDartIsolateSnapshotInstructions');
|
||||
}
|
||||
|
@ -5,13 +5,7 @@ set -e
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
pushd flutterapp
|
||||
../../../../bin/flutter build ios --debug --no-codesign -v
|
||||
|
||||
pushd .ios
|
||||
xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Debug CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
|
||||
xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Profile CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
|
||||
xcodebuild -workspace Runner.xcworkspace -scheme Runner -destination generic/platform=iOS -configuration Release CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" CODE_SIGNING_ALLOWED=NO
|
||||
popd
|
||||
../../../../bin/flutter build ios --debug --simulator --no-codesign
|
||||
popd
|
||||
|
||||
pod install
|
||||
|
Loading…
Reference in New Issue
Block a user