This reverts commit 2054f37aaf476bfff32fb2a04651a183f43cbf76.
This commit is contained in:
parent
7c22057f60
commit
2ece1c3a17
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
|
|||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
await task(() async {
|
await task(() async {
|
||||||
section('Copy app with watchOS companion and Swift Package');
|
section('Copy test Flutter App with WatchOS Companion');
|
||||||
|
|
||||||
String watchDeviceID;
|
String watchDeviceID;
|
||||||
String phoneDeviceID;
|
String phoneDeviceID;
|
||||||
@ -47,7 +47,7 @@ Future<void> main() async {
|
|||||||
|
|
||||||
if (!appReleaseBuilt) {
|
if (!appReleaseBuilt) {
|
||||||
return TaskResult.failure(
|
return TaskResult.failure(
|
||||||
'Failed to build flutter iOS app with watchOS companion and Swift Package in release mode.');
|
'Failed to build flutter iOS app with WatchOS companion in release mode.');
|
||||||
}
|
}
|
||||||
|
|
||||||
section('Create debug build');
|
section('Create debug build');
|
||||||
@ -69,7 +69,7 @@ Future<void> main() async {
|
|||||||
|
|
||||||
if (!appDebugBuilt) {
|
if (!appDebugBuilt) {
|
||||||
return TaskResult.failure(
|
return TaskResult.failure(
|
||||||
'Failed to build flutter iOS app with watchOS companion and Swift Package in debug mode.');
|
'Failed to build flutter iOS app with WatchOS companion in debug mode.');
|
||||||
}
|
}
|
||||||
|
|
||||||
section('Create build for a simulator device');
|
section('Create build for a simulator device');
|
||||||
@ -183,7 +183,7 @@ Future<void> main() async {
|
|||||||
|
|
||||||
if (!appSimulatorBuilt) {
|
if (!appSimulatorBuilt) {
|
||||||
return TaskResult.failure(
|
return TaskResult.failure(
|
||||||
'Failed to build flutter iOS app with watchOS companion and Swift Package in debug mode for simulated device.');
|
'Failed to build flutter iOS app with WatchOS companion in debug mode for simulated device.');
|
||||||
}
|
}
|
||||||
|
|
||||||
section('Run app on simulator device');
|
section('Run app on simulator device');
|
||||||
@ -229,7 +229,7 @@ Future<void> main() async {
|
|||||||
|
|
||||||
if (exitCode != 0)
|
if (exitCode != 0)
|
||||||
return TaskResult.failure(
|
return TaskResult.failure(
|
||||||
'Failed to start flutter iOS app with watchOS companion and Swift Package on simulated device.');
|
'Failed to start flutter iOS app with WatchOS companion on simulated device.');
|
||||||
|
|
||||||
return TaskResult.success(null);
|
return TaskResult.success(null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -262,14 +262,9 @@
|
|||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
|
||||||
"${PODS_ROOT}/../Flutter/Flutter.framework",
|
|
||||||
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
|
|
||||||
);
|
);
|
||||||
name = "[CP] Embed Pods Frameworks";
|
name = "[CP] Embed Pods Frameworks";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
|
|
||||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -3,4 +3,3 @@
|
|||||||
Integration test to test building an iOS app with
|
Integration test to test building an iOS app with
|
||||||
non-Flutter features:
|
non-Flutter features:
|
||||||
- watchOS app and extension
|
- watchOS app and extension
|
||||||
- Swift Package
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
archiveVersion = 1;
|
archiveVersion = 1;
|
||||||
classes = {
|
classes = {
|
||||||
};
|
};
|
||||||
objectVersion = 52;
|
objectVersion = 50;
|
||||||
objects = {
|
objects = {
|
||||||
|
|
||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
@ -22,7 +22,6 @@
|
|||||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
F735C5C42485E50A002BE868 /* PlayingCard in Frameworks */ = {isa = PBXBuildFile; productRef = F735C5C32485E50A002BE868 /* PlayingCard */; };
|
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -116,7 +115,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
F735C5C42485E50A002BE868 /* PlayingCard in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -264,9 +262,6 @@
|
|||||||
49C15B68243E340F0025F804 /* PBXTargetDependency */,
|
49C15B68243E340F0025F804 /* PBXTargetDependency */,
|
||||||
);
|
);
|
||||||
name = Runner;
|
name = Runner;
|
||||||
packageProductDependencies = (
|
|
||||||
F735C5C32485E50A002BE868 /* PlayingCard */,
|
|
||||||
);
|
|
||||||
productName = Runner;
|
productName = Runner;
|
||||||
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
@ -302,9 +297,6 @@
|
|||||||
Base,
|
Base,
|
||||||
);
|
);
|
||||||
mainGroup = 97C146E51CF9000F007C117D;
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
packageReferences = (
|
|
||||||
F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */,
|
|
||||||
);
|
|
||||||
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
@ -915,25 +907,6 @@
|
|||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
/* Begin XCRemoteSwiftPackageReference section */
|
|
||||||
F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */ = {
|
|
||||||
isa = XCRemoteSwiftPackageReference;
|
|
||||||
repositoryURL = "https://github.com/apple/example-package-playingcard.git";
|
|
||||||
requirement = {
|
|
||||||
kind = upToNextMajorVersion;
|
|
||||||
minimumVersion = 3.0.5;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
/* End XCRemoteSwiftPackageReference section */
|
|
||||||
|
|
||||||
/* Begin XCSwiftPackageProductDependency section */
|
|
||||||
F735C5C32485E50A002BE868 /* PlayingCard */ = {
|
|
||||||
isa = XCSwiftPackageProductDependency;
|
|
||||||
package = F735C5C22485E50A002BE868 /* XCRemoteSwiftPackageReference "example-package-playingcard" */;
|
|
||||||
productName = PlayingCard;
|
|
||||||
};
|
|
||||||
/* End XCSwiftPackageProductDependency section */
|
|
||||||
};
|
};
|
||||||
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"object": {
|
|
||||||
"pins": [
|
|
||||||
{
|
|
||||||
"package": "PlayingCard",
|
|
||||||
"repositoryURL": "https://github.com/apple/example-package-playingcard.git",
|
|
||||||
"state": {
|
|
||||||
"branch": null,
|
|
||||||
"revision": "39ddabb01e8102ab548a8c6bb3eb20b15f3b4fbc",
|
|
||||||
"version": "3.0.5"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"version": 1
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
{
|
|
||||||
"object": {
|
|
||||||
"pins": [
|
|
||||||
{
|
|
||||||
"package": "PlayingCard",
|
|
||||||
"repositoryURL": "https://github.com/apple/example-package-playingcard.git",
|
|
||||||
"state": {
|
|
||||||
"branch": null,
|
|
||||||
"revision": "39ddabb01e8102ab548a8c6bb3eb20b15f3b4fbc",
|
|
||||||
"version": "3.0.5"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"version": 1
|
|
||||||
}
|
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Pods/Pods.xcodeproj">
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Pods/Pods.xcodeproj">
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Pods/Pods.xcodeproj">
|
location = "group:Pods/Pods.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -26,7 +26,6 @@ import '../reporting/reporting.dart';
|
|||||||
import 'code_signing.dart';
|
import 'code_signing.dart';
|
||||||
import 'migrations/ios_migrator.dart';
|
import 'migrations/ios_migrator.dart';
|
||||||
import 'migrations/project_base_configuration_migration.dart';
|
import 'migrations/project_base_configuration_migration.dart';
|
||||||
import 'migrations/project_build_location_migration.dart';
|
|
||||||
import 'migrations/remove_framework_link_and_embedding_migration.dart';
|
import 'migrations/remove_framework_link_and_embedding_migration.dart';
|
||||||
import 'migrations/xcode_build_system_migration.dart';
|
import 'migrations/xcode_build_system_migration.dart';
|
||||||
import 'xcodeproj.dart';
|
import 'xcodeproj.dart';
|
||||||
@ -98,7 +97,6 @@ Future<XcodeBuildResult> buildXcodeProject({
|
|||||||
RemoveFrameworkLinkAndEmbeddingMigration(app.project, globals.logger, globals.xcode, globals.flutterUsage),
|
RemoveFrameworkLinkAndEmbeddingMigration(app.project, globals.logger, globals.xcode, globals.flutterUsage),
|
||||||
XcodeBuildSystemMigration(app.project, globals.logger),
|
XcodeBuildSystemMigration(app.project, globals.logger),
|
||||||
ProjectBaseConfigurationMigration(app.project, globals.logger),
|
ProjectBaseConfigurationMigration(app.project, globals.logger),
|
||||||
ProjectBuildLocationMigration(app.project, globals.logger),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
final IOSMigration migration = IOSMigration(migrators);
|
final IOSMigration migration = IOSMigration(migrators);
|
||||||
|
@ -84,7 +84,7 @@ class ProjectBaseConfigurationMigration extends IOSMigrator {
|
|||||||
newProjectContents = newProjectContents.replaceAll(releaseBaseConfigurationOriginal, releaseBaseConfigurationReplacement);
|
newProjectContents = newProjectContents.replaceAll(releaseBaseConfigurationOriginal, releaseBaseConfigurationReplacement);
|
||||||
if (originalProjectContents != newProjectContents) {
|
if (originalProjectContents != newProjectContents) {
|
||||||
logger.printStatus('Project base configurations detected, removing.');
|
logger.printStatus('Project base configurations detected, removing.');
|
||||||
_xcodeProjectInfoFile.writeAsStringSync(newProjectContents);
|
_xcodeProjectInfoFile.writeAsStringSync(newProjectContents.toString());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
import '../../base/file_system.dart';
|
|
||||||
import '../../base/logger.dart';
|
|
||||||
import '../../project.dart';
|
|
||||||
import 'ios_migrator.dart';
|
|
||||||
|
|
||||||
// Update the xcodeproj build location. Legacy build location does not work with Swift Packages.
|
|
||||||
class ProjectBuildLocationMigration extends IOSMigrator {
|
|
||||||
ProjectBuildLocationMigration(
|
|
||||||
IosProject project,
|
|
||||||
Logger logger,
|
|
||||||
) : _xcodeProjectWorkspaceData = project.xcodeProjectWorkspaceData,
|
|
||||||
super(logger);
|
|
||||||
|
|
||||||
final File _xcodeProjectWorkspaceData;
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool migrate() {
|
|
||||||
if (!_xcodeProjectWorkspaceData.existsSync()) {
|
|
||||||
logger.printTrace('Xcode project workspace data not found, skipping build location migration.');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
processFileLines(_xcodeProjectWorkspaceData);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
String migrateLine(String line) {
|
|
||||||
const String legacyBuildLocation = 'location = "group:';
|
|
||||||
const String defaultBuildLocation = 'location = "self:';
|
|
||||||
|
|
||||||
return line.replaceAll(legacyBuildLocation, defaultBuildLocation);
|
|
||||||
}
|
|
||||||
}
|
|
@ -398,11 +398,6 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
|
|||||||
@override
|
@override
|
||||||
File get xcodeProjectInfoFile => xcodeProject.childFile('project.pbxproj');
|
File get xcodeProjectInfoFile => xcodeProject.childFile('project.pbxproj');
|
||||||
|
|
||||||
File get xcodeProjectWorkspaceData =>
|
|
||||||
xcodeProject
|
|
||||||
.childDirectory('project.xcworkspace')
|
|
||||||
.childFile('contents.xcworkspacedata');
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Directory get xcodeWorkspace => hostAppRoot.childDirectory('$_hostAppProjectName.xcworkspace');
|
Directory get xcodeWorkspace => hostAppRoot.childDirectory('$_hostAppProjectName.xcworkspace');
|
||||||
|
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
<Workspace
|
<Workspace
|
||||||
version = "1.0">
|
version = "1.0">
|
||||||
<FileRef
|
<FileRef
|
||||||
location = "self:Runner.xcodeproj">
|
location = "group:Runner.xcodeproj">
|
||||||
</FileRef>
|
</FileRef>
|
||||||
</Workspace>
|
</Workspace>
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
import 'package:file/file.dart';
|
import 'package:file/file.dart';
|
||||||
import 'package:file/memory.dart';
|
import 'package:file/memory.dart';
|
||||||
import 'package:flutter_tools/src/base/logger.dart';
|
import 'package:flutter_tools/src/base/logger.dart';
|
||||||
|
import 'package:flutter_tools/src/base/platform.dart';
|
||||||
|
import 'package:flutter_tools/src/base/terminal.dart';
|
||||||
import 'package:flutter_tools/src/ios/migrations/ios_migrator.dart';
|
import 'package:flutter_tools/src/ios/migrations/ios_migrator.dart';
|
||||||
import 'package:flutter_tools/src/ios/migrations/project_base_configuration_migration.dart';
|
import 'package:flutter_tools/src/ios/migrations/project_base_configuration_migration.dart';
|
||||||
import 'package:flutter_tools/src/ios/migrations/project_build_location_migration.dart';
|
|
||||||
import 'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embedding_migration.dart';
|
import 'package:flutter_tools/src/ios/migrations/remove_framework_link_and_embedding_migration.dart';
|
||||||
import 'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart';
|
import 'package:flutter_tools/src/ios/migrations/xcode_build_system_migration.dart';
|
||||||
import 'package:flutter_tools/src/macos/xcode.dart';
|
import 'package:flutter_tools/src/macos/xcode.dart';
|
||||||
@ -48,7 +49,15 @@ void main () {
|
|||||||
memoryFileSystem = MemoryFileSystem();
|
memoryFileSystem = MemoryFileSystem();
|
||||||
mockXcode = MockXcode();
|
mockXcode = MockXcode();
|
||||||
xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj');
|
xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj');
|
||||||
testLogger = BufferLogger.test();
|
|
||||||
|
testLogger = BufferLogger(
|
||||||
|
terminal: AnsiTerminal(
|
||||||
|
stdio: null,
|
||||||
|
platform: const LocalPlatform(),
|
||||||
|
),
|
||||||
|
outputPreferences: OutputPreferences.test(),
|
||||||
|
);
|
||||||
|
|
||||||
mockIosProject = MockIosProject();
|
mockIosProject = MockIosProject();
|
||||||
when(mockIosProject.xcodeProjectInfoFile).thenReturn(xcodeProjectInfoFile);
|
when(mockIosProject.xcodeProjectInfoFile).thenReturn(xcodeProjectInfoFile);
|
||||||
});
|
});
|
||||||
@ -259,7 +268,15 @@ keep this 2
|
|||||||
setUp(() {
|
setUp(() {
|
||||||
memoryFileSystem = MemoryFileSystem();
|
memoryFileSystem = MemoryFileSystem();
|
||||||
xcodeWorkspaceSharedSettings = memoryFileSystem.file('WorkspaceSettings.xcsettings');
|
xcodeWorkspaceSharedSettings = memoryFileSystem.file('WorkspaceSettings.xcsettings');
|
||||||
testLogger = BufferLogger.test();
|
|
||||||
|
testLogger = BufferLogger(
|
||||||
|
terminal: AnsiTerminal(
|
||||||
|
stdio: null,
|
||||||
|
platform: const LocalPlatform(),
|
||||||
|
),
|
||||||
|
outputPreferences: OutputPreferences.test(),
|
||||||
|
);
|
||||||
|
|
||||||
mockIosProject = MockIosProject();
|
mockIosProject = MockIosProject();
|
||||||
when(mockIosProject.xcodeWorkspaceSharedSettings).thenReturn(xcodeWorkspaceSharedSettings);
|
when(mockIosProject.xcodeWorkspaceSharedSettings).thenReturn(xcodeWorkspaceSharedSettings);
|
||||||
});
|
});
|
||||||
@ -322,87 +339,6 @@ keep this 2
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
group('Xcode default build location', () {
|
|
||||||
MemoryFileSystem memoryFileSystem;
|
|
||||||
BufferLogger testLogger;
|
|
||||||
MockIosProject mockIosProject;
|
|
||||||
File xcodeProjectWorkspaceData;
|
|
||||||
|
|
||||||
setUp(() {
|
|
||||||
memoryFileSystem = MemoryFileSystem();
|
|
||||||
xcodeProjectWorkspaceData = memoryFileSystem.file('contents.xcworkspacedata');
|
|
||||||
testLogger = BufferLogger.test();
|
|
||||||
mockIosProject = MockIosProject();
|
|
||||||
when(mockIosProject.xcodeProjectWorkspaceData).thenReturn(xcodeProjectWorkspaceData);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWithoutContext('skipped if files are missing', () {
|
|
||||||
final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration(
|
|
||||||
mockIosProject,
|
|
||||||
testLogger,
|
|
||||||
);
|
|
||||||
expect(iosProjectMigration.migrate(), isTrue);
|
|
||||||
expect(xcodeProjectWorkspaceData.existsSync(), isFalse);
|
|
||||||
|
|
||||||
expect(testLogger.traceText, contains('Xcode project workspace data not found, skipping build location migration.'));
|
|
||||||
expect(testLogger.statusText, isEmpty);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWithoutContext('skipped if nothing to upgrade', () {
|
|
||||||
const String contents = '''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "self:">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>''';
|
|
||||||
xcodeProjectWorkspaceData.writeAsStringSync(contents);
|
|
||||||
|
|
||||||
final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration(
|
|
||||||
mockIosProject,
|
|
||||||
testLogger,
|
|
||||||
);
|
|
||||||
expect(iosProjectMigration.migrate(), isTrue);
|
|
||||||
expect(xcodeProjectWorkspaceData.existsSync(), isTrue);
|
|
||||||
expect(testLogger.statusText, isEmpty);
|
|
||||||
});
|
|
||||||
|
|
||||||
testWithoutContext('Xcode project is migrated', () {
|
|
||||||
const String contents = '''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "group:Runner.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
<FileRef
|
|
||||||
location = "group:Pods/Pods.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>''';
|
|
||||||
xcodeProjectWorkspaceData.writeAsStringSync(contents);
|
|
||||||
|
|
||||||
final ProjectBuildLocationMigration iosProjectMigration = ProjectBuildLocationMigration(
|
|
||||||
mockIosProject,
|
|
||||||
testLogger,
|
|
||||||
);
|
|
||||||
expect(iosProjectMigration.migrate(), isTrue);
|
|
||||||
expect(xcodeProjectWorkspaceData.readAsStringSync(), '''
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "self:Runner.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
<FileRef
|
|
||||||
location = "self:Pods/Pods.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
||||||
''');
|
|
||||||
expect(testLogger.statusText, contains('Upgrading contents.xcworkspacedata'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
group('remove Runner project base configuration', () {
|
group('remove Runner project base configuration', () {
|
||||||
MemoryFileSystem memoryFileSystem;
|
MemoryFileSystem memoryFileSystem;
|
||||||
BufferLogger testLogger;
|
BufferLogger testLogger;
|
||||||
@ -412,7 +348,15 @@ keep this 2
|
|||||||
setUp(() {
|
setUp(() {
|
||||||
memoryFileSystem = MemoryFileSystem();
|
memoryFileSystem = MemoryFileSystem();
|
||||||
xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj');
|
xcodeProjectInfoFile = memoryFileSystem.file('project.pbxproj');
|
||||||
testLogger = BufferLogger.test();
|
|
||||||
|
testLogger = BufferLogger(
|
||||||
|
terminal: AnsiTerminal(
|
||||||
|
stdio: null,
|
||||||
|
platform: const LocalPlatform(),
|
||||||
|
),
|
||||||
|
outputPreferences: OutputPreferences.test(),
|
||||||
|
);
|
||||||
|
|
||||||
mockIosProject = MockIosProject();
|
mockIosProject = MockIosProject();
|
||||||
when(mockIosProject.xcodeProjectInfoFile).thenReturn(xcodeProjectInfoFile);
|
when(mockIosProject.xcodeProjectInfoFile).thenReturn(xcodeProjectInfoFile);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user