Unverified Commit 9c87b324 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Remove Runner target check, prefer schemes (#56620)

parent 0177d429
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
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 */; };
F723D2312464E1C10004F0E0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
F723D2322464E1C10004F0E0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
F723D2332464E1C10004F0E0 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
F723D2362464E1C10004F0E0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
F723D2372464E1C10004F0E0 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
F723D2382464E1C10004F0E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
F723D2392464E1C10004F0E0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -27,6 +34,16 @@ ...@@ -27,6 +34,16 @@
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
F723D23A2464E1C10004F0E0 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */ /* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -38,12 +55,14 @@ ...@@ -38,12 +55,14 @@
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146EE1CF9000F007C117D /* Free App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Free App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info-Free.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Free.plist"; sourceTree = "<group>"; };
F723D2412464E1C10004F0E0 /* Paid App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Paid App.app"; sourceTree = BUILT_PRODUCTS_DIR; };
F723D2682464E2860004F0E0 /* Info-Paid.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-Paid.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -54,6 +73,13 @@ ...@@ -54,6 +73,13 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
F723D2342464E1C10004F0E0 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */ /* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */ /* Begin PBXGroup section */
...@@ -80,7 +106,8 @@ ...@@ -80,7 +106,8 @@
97C146EF1CF9000F007C117D /* Products */ = { 97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
97C146EE1CF9000F007C117D /* Runner.app */, 97C146EE1CF9000F007C117D /* Free App.app */,
F723D2412464E1C10004F0E0 /* Paid App.app */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -93,7 +120,8 @@ ...@@ -93,7 +120,8 @@
97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */, 97C147021CF9000F007C117D /* Info-Free.plist */,
F723D2682464E2860004F0E0 /* Info-Paid.plist */,
97C146F11CF9000F007C117D /* Supporting Files */, 97C146F11CF9000F007C117D /* Supporting Files */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
...@@ -112,9 +140,9 @@ ...@@ -112,9 +140,9 @@
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
97C146ED1CF9000F007C117D /* Runner */ = { 97C146ED1CF9000F007C117D /* Free App */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Free App" */;
buildPhases = ( buildPhases = (
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
...@@ -127,9 +155,29 @@ ...@@ -127,9 +155,29 @@
); );
dependencies = ( dependencies = (
); );
name = Runner; name = "Free App";
productName = Runner; productName = Runner;
productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productReference = 97C146EE1CF9000F007C117D /* Free App.app */;
productType = "com.apple.product-type.application";
};
F723D22E2464E1C10004F0E0 /* Paid App */ = {
isa = PBXNativeTarget;
buildConfigurationList = F723D23C2464E1C10004F0E0 /* Build configuration list for PBXNativeTarget "Paid App" */;
buildPhases = (
F723D22F2464E1C10004F0E0 /* Run Script */,
F723D2302464E1C10004F0E0 /* Sources */,
F723D2342464E1C10004F0E0 /* Frameworks */,
F723D2352464E1C10004F0E0 /* Resources */,
F723D23A2464E1C10004F0E0 /* Embed Frameworks */,
F723D23B2464E1C10004F0E0 /* Thin Binary */,
);
buildRules = (
);
dependencies = (
);
name = "Paid App";
productName = Runner;
productReference = F723D2412464E1C10004F0E0 /* Paid App.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
/* End PBXNativeTarget section */ /* End PBXNativeTarget section */
...@@ -159,7 +207,8 @@ ...@@ -159,7 +207,8 @@
projectDirPath = ""; projectDirPath = "";
projectRoot = ""; projectRoot = "";
targets = ( targets = (
97C146ED1CF9000F007C117D /* Runner */, 97C146ED1CF9000F007C117D /* Free App */,
F723D22E2464E1C10004F0E0 /* Paid App */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
...@@ -176,6 +225,17 @@ ...@@ -176,6 +225,17 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
F723D2352464E1C10004F0E0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F723D2362464E1C10004F0E0 /* LaunchScreen.storyboard in Resources */,
F723D2372464E1C10004F0E0 /* AppFrameworkInfo.plist in Resources */,
F723D2382464E1C10004F0E0 /* Assets.xcassets in Resources */,
F723D2392464E1C10004F0E0 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
...@@ -191,7 +251,7 @@ ...@@ -191,7 +251,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
...@@ -207,6 +267,34 @@ ...@@ -207,6 +267,34 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
}; };
F723D22F2464E1C10004F0E0 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
F723D23B2464E1C10004F0E0 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
...@@ -220,6 +308,16 @@ ...@@ -220,6 +308,16 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
F723D2302464E1C10004F0E0 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F723D2312464E1C10004F0E0 /* AppDelegate.m in Sources */,
F723D2322464E1C10004F0E0 /* main.m in Sources */,
F723D2332464E1C10004F0E0 /* GeneratedPluginRegistrant.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
...@@ -300,13 +398,13 @@ ...@@ -300,13 +398,13 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = "Runner/Info-Free.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors; PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = "Debug Paid"; name = "Debug Paid";
...@@ -363,13 +461,13 @@ ...@@ -363,13 +461,13 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = "Runner/Info-Free.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors; PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = "Release Paid"; name = "Release Paid";
...@@ -474,13 +572,13 @@ ...@@ -474,13 +572,13 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = "Runner/Info-Free.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors; PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = "Debug Free"; name = "Debug Free";
...@@ -495,17 +593,101 @@ ...@@ -495,17 +593,101 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = "Runner/Info-Free.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.free;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Release Free";
};
F723D23D2464E1C10004F0E0 /* Debug Free */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = "Runner/Info-Paid.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.paid;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Debug Free";
};
F723D23E2464E1C10004F0E0 /* Debug Paid */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = "Runner/Info-Paid.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.paid;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Debug Paid";
};
F723D23F2464E1C10004F0E0 /* Release Free */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = "Runner/Info-Paid.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors; PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.paid;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; };
name = "Release Free"; name = "Release Free";
}; };
F723D2402464E1C10004F0E0 /* Release Paid */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
INFOPLIST_FILE = "Runner/Info-Paid.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.flavors.paid;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = "Release Paid";
};
/* End XCBuildConfiguration section */ /* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */ /* Begin XCConfigurationList section */
...@@ -520,7 +702,7 @@ ...@@ -520,7 +702,7 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = "Release Free"; defaultConfigurationName = "Release Free";
}; };
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Free App" */ = {
isa = XCConfigurationList; isa = XCConfigurationList;
buildConfigurations = ( buildConfigurations = (
97C147061CF9000F007C117D /* Debug Free */, 97C147061CF9000F007C117D /* Debug Free */,
...@@ -531,6 +713,17 @@ ...@@ -531,6 +713,17 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = "Release Free"; defaultConfigurationName = "Release Free";
}; };
F723D23C2464E1C10004F0E0 /* Build configuration list for PBXNativeTarget "Paid App" */ = {
isa = XCConfigurationList;
buildConfigurations = (
F723D23D2464E1C10004F0E0 /* Debug Free */,
F723D23E2464E1C10004F0E0 /* Debug Paid */,
F723D23F2464E1C10004F0E0 /* Release Free */,
F723D2402464E1C10004F0E0 /* Release Paid */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = "Release Free";
};
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 97C146E61CF9000F007C117D /* Project object */; rootObject = 97C146E61CF9000F007C117D /* Project object */;
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app" BuildableName = "Free App.app"
BlueprintName = "Runner" BlueprintName = "Free App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
...@@ -27,19 +27,17 @@ ...@@ -27,19 +27,17 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app" BuildableName = "Free App.app"
BlueprintName = "Runner" BlueprintName = "Free App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <Testables>
</AdditionalOptions> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug Free" buildConfiguration = "Debug Free"
...@@ -56,13 +54,11 @@ ...@@ -56,13 +54,11 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app" BuildableName = "Free App.app"
BlueprintName = "Runner" BlueprintName = "Free App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release Free" buildConfiguration = "Release Free"
...@@ -75,8 +71,8 @@ ...@@ -75,8 +71,8 @@
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app" BuildableName = "Free App.app"
BlueprintName = "Runner" BlueprintName = "Free App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
......
...@@ -14,9 +14,9 @@ ...@@ -14,9 +14,9 @@
buildForAnalyzing = "YES"> buildForAnalyzing = "YES">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "F723D22E2464E1C10004F0E0"
BuildableName = "Runner.app" BuildableName = "Paid App.app"
BlueprintName = "Runner" BlueprintName = "Paid App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildActionEntry> </BuildActionEntry>
...@@ -27,19 +27,17 @@ ...@@ -27,19 +27,17 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"> shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion> <MacroExpansion>
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app" BuildableName = "Free App.app"
BlueprintName = "Runner" BlueprintName = "Free App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</MacroExpansion> </MacroExpansion>
<AdditionalOptions> <Testables>
</AdditionalOptions> </Testables>
</TestAction> </TestAction>
<LaunchAction <LaunchAction
buildConfiguration = "Debug Paid" buildConfiguration = "Debug Paid"
...@@ -55,14 +53,12 @@ ...@@ -55,14 +53,12 @@
runnableDebuggingMode = "0"> runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "F723D22E2464E1C10004F0E0"
BuildableName = "Runner.app" BuildableName = "Paid App.app"
BlueprintName = "Runner" BlueprintName = "Paid App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Release Paid" buildConfiguration = "Release Paid"
...@@ -70,16 +66,15 @@ ...@@ -70,16 +66,15 @@
savedToolIdentifier = "" savedToolIdentifier = ""
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"> debugDocumentVersioning = "YES">
<BuildableProductRunnable <MacroExpansion>
runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D" BlueprintIdentifier = "F723D22E2464E1C10004F0E0"
BuildableName = "Runner.app" BuildableName = "Paid App.app"
BlueprintName = "Runner" BlueprintName = "Paid App"
ReferencedContainer = "container:Runner.xcodeproj"> ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </MacroExpansion>
</ProfileAction> </ProfileAction>
<AnalyzeAction <AnalyzeAction
buildConfiguration = "Debug Paid"> buildConfiguration = "Debug Paid">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>flavors</string> <string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>Flavor</key>
<string>${PRODUCT_FLAVOR}</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>
<string>Main</string> <string>Main</string>
<key>Flavor</key>
<string>${PRODUCT_FLAVOR}</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>
<array> <array>
<string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortrait</string>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>Flavor</key>
<string>${PRODUCT_FLAVOR}</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
...@@ -31,6 +31,7 @@ class ApplicationPackageFactory { ...@@ -31,6 +31,7 @@ class ApplicationPackageFactory {
Future<ApplicationPackage> getPackageForPlatform( Future<ApplicationPackage> getPackageForPlatform(
TargetPlatform platform, { TargetPlatform platform, {
BuildInfo buildInfo,
File applicationBinary, File applicationBinary,
}) async { }) async {
switch (platform) { switch (platform) {
...@@ -47,7 +48,7 @@ class ApplicationPackageFactory { ...@@ -47,7 +48,7 @@ class ApplicationPackageFactory {
: AndroidApk.fromApk(applicationBinary); : AndroidApk.fromApk(applicationBinary);
case TargetPlatform.ios: case TargetPlatform.ios:
return applicationBinary == null return applicationBinary == null
? await IOSApp.fromIosProject(FlutterProject.current().ios) ? await IOSApp.fromIosProject(FlutterProject.current().ios, buildInfo)
: IOSApp.fromPrebuiltApp(applicationBinary); : IOSApp.fromPrebuiltApp(applicationBinary);
case TargetPlatform.tester: case TargetPlatform.tester:
return FlutterTesterApp.fromCurrentDirectory(); return FlutterTesterApp.fromCurrentDirectory();
...@@ -327,7 +328,7 @@ abstract class IOSApp extends ApplicationPackage { ...@@ -327,7 +328,7 @@ abstract class IOSApp extends ApplicationPackage {
); );
} }
static Future<IOSApp> fromIosProject(IosProject project) { static Future<IOSApp> fromIosProject(IosProject project, BuildInfo buildInfo) {
if (getCurrentHostPlatform() != HostPlatform.darwin_x64) { if (getCurrentHostPlatform() != HostPlatform.darwin_x64) {
return null; return null;
} }
...@@ -344,7 +345,7 @@ abstract class IOSApp extends ApplicationPackage { ...@@ -344,7 +345,7 @@ abstract class IOSApp extends ApplicationPackage {
globals.printError('Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.'); globals.printError('Expected ios/Runner.xcodeproj/project.pbxproj but this file is missing.');
return null; return null;
} }
return BuildableIOSApp.fromProject(project); return BuildableIOSApp.fromProject(project, buildInfo);
} }
@override @override
...@@ -360,9 +361,9 @@ class BuildableIOSApp extends IOSApp { ...@@ -360,9 +361,9 @@ class BuildableIOSApp extends IOSApp {
: _hostAppBundleName = hostAppBundleName, : _hostAppBundleName = hostAppBundleName,
super(projectBundleId: projectBundleId); super(projectBundleId: projectBundleId);
static Future<BuildableIOSApp> fromProject(IosProject project) async { static Future<BuildableIOSApp> fromProject(IosProject project, BuildInfo buildInfo) async {
final String projectBundleId = await project.productBundleIdentifier; final String projectBundleId = await project.productBundleIdentifier(buildInfo);
final String hostAppBundleName = await project.hostAppBundleName; final String hostAppBundleName = await project.hostAppBundleName(buildInfo);
return BuildableIOSApp(project, projectBundleId, hostAppBundleName); return BuildableIOSApp(project, projectBundleId, hostAppBundleName);
} }
...@@ -416,7 +417,10 @@ class ApplicationPackageStore { ...@@ -416,7 +417,10 @@ class ApplicationPackageStore {
MacOSApp macOS; MacOSApp macOS;
WindowsApp windows; WindowsApp windows;
Future<ApplicationPackage> getPackageForPlatform(TargetPlatform platform) async { Future<ApplicationPackage> getPackageForPlatform(
TargetPlatform platform,
BuildInfo buildInfo,
) async {
switch (platform) { switch (platform) {
case TargetPlatform.android: case TargetPlatform.android:
case TargetPlatform.android_arm: case TargetPlatform.android_arm:
...@@ -426,7 +430,7 @@ class ApplicationPackageStore { ...@@ -426,7 +430,7 @@ class ApplicationPackageStore {
android ??= await AndroidApk.fromAndroidProject(FlutterProject.current().android); android ??= await AndroidApk.fromAndroidProject(FlutterProject.current().android);
return android; return android;
case TargetPlatform.ios: case TargetPlatform.ios:
iOS ??= await IOSApp.fromIosProject(FlutterProject.current().ios); iOS ??= await IOSApp.fromIosProject(FlutterProject.current().ios, buildInfo);
return iOS; return iOS;
case TargetPlatform.fuchsia_arm64: case TargetPlatform.fuchsia_arm64:
case TargetPlatform.fuchsia_x64: case TargetPlatform.fuchsia_x64:
......
...@@ -370,6 +370,7 @@ class _ResidentWebRunner extends ResidentWebRunner { ...@@ -370,6 +370,7 @@ class _ResidentWebRunner extends ResidentWebRunner {
firstBuildTime = DateTime.now(); firstBuildTime = DateTime.now();
final ApplicationPackage package = await ApplicationPackageFactory.instance.getPackageForPlatform( final ApplicationPackage package = await ApplicationPackageFactory.instance.getPackageForPlatform(
TargetPlatform.web_javascript, TargetPlatform.web_javascript,
buildInfo: debuggingOptions.buildInfo,
applicationBinary: null, applicationBinary: null,
); );
if (package == null) { if (package == null) {
......
...@@ -64,7 +64,11 @@ class BuildIOSCommand extends BuildSubCommand { ...@@ -64,7 +64,11 @@ class BuildIOSCommand extends BuildSubCommand {
throwToolExit('Building for iOS is only supported on the Mac.'); throwToolExit('Building for iOS is only supported on the Mac.');
} }
final BuildableIOSApp app = await applicationPackages.getPackageForPlatform(TargetPlatform.ios) as BuildableIOSApp; final BuildInfo buildInfo = getBuildInfo();
final BuildableIOSApp app = await applicationPackages.getPackageForPlatform(
TargetPlatform.ios,
buildInfo,
) as BuildableIOSApp;
if (app == null) { if (app == null) {
throwToolExit('Application not configured for iOS'); throwToolExit('Application not configured for iOS');
...@@ -76,7 +80,6 @@ class BuildIOSCommand extends BuildSubCommand { ...@@ -76,7 +80,6 @@ class BuildIOSCommand extends BuildSubCommand {
globals.printStatus('Warning: Building for device with codesigning disabled. You will ' globals.printStatus('Warning: Building for device with codesigning disabled. You will '
'have to manually codesign before deploying to device.'); 'have to manually codesign before deploying to device.');
} }
final BuildInfo buildInfo = getBuildInfo();
if (forSimulator && !buildInfo.supportsSimulator) { if (forSimulator && !buildInfo.supportsSimulator) {
throwToolExit('${toTitleCase(buildInfo.friendlyModeName)} mode is not supported for simulators.'); throwToolExit('${toTitleCase(buildInfo.friendlyModeName)} mode is not supported for simulators.');
} }
......
...@@ -181,8 +181,8 @@ class BuildIOSFrameworkCommand extends BuildSubCommand { ...@@ -181,8 +181,8 @@ class BuildIOSFrameworkCommand extends BuildSubCommand {
final Directory outputDirectory = globals.fs.directory(globals.fs.path.absolute(globals.fs.path.normalize(outputArgument))); final Directory outputDirectory = globals.fs.directory(globals.fs.path.absolute(globals.fs.path.normalize(outputArgument)));
final String productBundleIdentifier = await _project.ios.productBundleIdentifier;
for (final BuildInfo buildInfo in buildInfos) { for (final BuildInfo buildInfo in buildInfos) {
final String productBundleIdentifier = await _project.ios.productBundleIdentifier(buildInfo);
globals.printStatus('Building frameworks for $productBundleIdentifier in ${getNameForBuildMode(buildInfo.mode)} mode...'); globals.printStatus('Building frameworks for $productBundleIdentifier in ${getNameForBuildMode(buildInfo.mode)} mode...');
final String xcodeBuildConfiguration = toTitleCase(getNameForBuildMode(buildInfo.mode)); final String xcodeBuildConfiguration = toTitleCase(getNameForBuildMode(buildInfo.mode));
final Directory modeDirectory = outputDirectory.childDirectory(xcodeBuildConfiguration); final Directory modeDirectory = outputDirectory.childDirectory(xcodeBuildConfiguration);
......
...@@ -404,7 +404,7 @@ Future<LaunchResult> _startApp(DriveCommand command, Uri webUri) async { ...@@ -404,7 +404,7 @@ Future<LaunchResult> _startApp(DriveCommand command, Uri webUri) async {
await appStopper(command); await appStopper(command);
final ApplicationPackage package = await command.applicationPackages final ApplicationPackage package = await command.applicationPackages
.getPackageForPlatform(await command.device.targetPlatform); .getPackageForPlatform(await command.device.targetPlatform, command.getBuildInfo());
if (command.shouldBuild) { if (command.shouldBuild) {
globals.printTrace('Installing application package.'); globals.printTrace('Installing application package.');
...@@ -497,7 +497,10 @@ void restoreAppStopper() { ...@@ -497,7 +497,10 @@ void restoreAppStopper() {
Future<bool> _stopApp(DriveCommand command) async { Future<bool> _stopApp(DriveCommand command) async {
globals.printTrace('Stopping application.'); globals.printTrace('Stopping application.');
final ApplicationPackage package = await command.applicationPackages.getPackageForPlatform(await command.device.targetPlatform); final ApplicationPackage package = await command.applicationPackages.getPackageForPlatform(
await command.device.targetPlatform,
command.getBuildInfo(),
);
final bool stopped = await command.device.stopApp(package); final bool stopped = await command.device.stopApp(package);
await command._deviceLogSubscription?.cancel(); await command._deviceLogSubscription?.cancel();
return stopped; return stopped;
......
...@@ -43,7 +43,10 @@ class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts ...@@ -43,7 +43,10 @@ class InstallCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts
@override @override
Future<FlutterCommandResult> runCommand() async { Future<FlutterCommandResult> runCommand() async {
final ApplicationPackage package = await applicationPackages.getPackageForPlatform(await device.targetPlatform); final ApplicationPackage package = await applicationPackages.getPackageForPlatform(
await device.targetPlatform,
null, // Build info isn't relevant for install, will use whatever bundle was built last.
);
Cache.releaseLockEarly(); Cache.releaseLockEarly();
......
...@@ -13,6 +13,7 @@ import '../base/common.dart'; ...@@ -13,6 +13,7 @@ import '../base/common.dart';
import '../base/io.dart'; import '../base/io.dart';
import '../base/logger.dart'; import '../base/logger.dart';
import '../base/process.dart'; import '../base/process.dart';
import '../build_info.dart';
import '../convert.dart' show utf8; import '../convert.dart' show utf8;
import '../globals.dart' as globals; import '../globals.dart' as globals;
...@@ -101,8 +102,9 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({ ...@@ -101,8 +102,9 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
@required BuildableIOSApp iosApp, @required BuildableIOSApp iosApp,
@required ProcessManager processManager, @required ProcessManager processManager,
@required Logger logger, @required Logger logger,
@required BuildInfo buildInfo,
}) async { }) async {
final Map<String, String> buildSettings = await iosApp.project.buildSettings; final Map<String, String> buildSettings = await iosApp.project.buildSettingsForBuildInfo(buildInfo);
if (buildSettings == null) { if (buildSettings == null) {
return null; return null;
} }
......
...@@ -111,12 +111,6 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -111,12 +111,6 @@ Future<XcodeBuildResult> buildXcodeProject({
await removeFinderExtendedAttributes(app.project.hostAppRoot, processUtils, globals.logger); await removeFinderExtendedAttributes(app.project.hostAppRoot, processUtils, globals.logger);
final XcodeProjectInfo projectInfo = await globals.xcodeProjectInterpreter.getInfo(app.project.hostAppRoot.path); final XcodeProjectInfo projectInfo = await globals.xcodeProjectInterpreter.getInfo(app.project.hostAppRoot.path);
if (!projectInfo.targets.contains('Runner')) {
globals.printError('The Xcode project does not define target "Runner" which is needed by Flutter tooling.');
globals.printError('Open Xcode to fix the problem:');
globals.printError(' open ios/Runner.xcworkspace');
return XcodeBuildResult(success: false);
}
final String scheme = projectInfo.schemeFor(buildInfo); final String scheme = projectInfo.schemeFor(buildInfo);
if (scheme == null) { if (scheme == null) {
globals.printError(''); globals.printError('');
...@@ -180,7 +174,8 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -180,7 +174,8 @@ Future<XcodeBuildResult> buildXcodeProject({
autoSigningConfigs = await getCodeSigningIdentityDevelopmentTeam( autoSigningConfigs = await getCodeSigningIdentityDevelopmentTeam(
iosApp: app, iosApp: app,
processManager: globals.processManager, processManager: globals.processManager,
logger: globals.logger logger: globals.logger,
buildInfo: buildInfo,
); );
} }
...@@ -229,7 +224,10 @@ Future<XcodeBuildResult> buildXcodeProject({ ...@@ -229,7 +224,10 @@ Future<XcodeBuildResult> buildXcodeProject({
} }
// Check if the project contains a watchOS companion app. // Check if the project contains a watchOS companion app.
final bool hasWatchCompanion = await app.project.containsWatchCompanion(projectInfo.targets); final bool hasWatchCompanion = await app.project.containsWatchCompanion(
projectInfo.targets,
buildInfo,
);
if (hasWatchCompanion) { if (hasWatchCompanion) {
// The -sdk argument has to be omitted if a watchOS companion app exists. // The -sdk argument has to be omitted if a watchOS companion app exists.
// Otherwise the build will fail as WatchKit dependencies cannot be build using the iOS SDK. // Otherwise the build will fail as WatchKit dependencies cannot be build using the iOS SDK.
......
...@@ -309,9 +309,12 @@ class XcodeProjectInterpreter { ...@@ -309,9 +309,12 @@ class XcodeProjectInterpreter {
/// Asynchronously retrieve xcode build settings. This one is preferred for /// Asynchronously retrieve xcode build settings. This one is preferred for
/// new call-sites. /// new call-sites.
///
/// If [scheme] is null, xcodebuild will return build settings for the first discovered
/// target (by default this is Runner).
Future<Map<String, String>> getBuildSettings( Future<Map<String, String>> getBuildSettings(
String projectPath, String projectPath, {
String target, { String scheme,
Duration timeout = const Duration(minutes: 1), Duration timeout = const Duration(minutes: 1),
}) async { }) async {
final Status status = Status.withSpinner( final Status status = Status.withSpinner(
...@@ -324,8 +327,8 @@ class XcodeProjectInterpreter { ...@@ -324,8 +327,8 @@ class XcodeProjectInterpreter {
_executable, _executable,
'-project', '-project',
_fileSystem.path.absolute(projectPath), _fileSystem.path.absolute(projectPath),
'-target', if (scheme != null)
target, ...<String>['-scheme', scheme],
'-showBuildSettings', '-showBuildSettings',
...environmentVariablesAsXcodeBuildSettings(_platform) ...environmentVariablesAsXcodeBuildSettings(_platform)
]; ];
...@@ -465,7 +468,6 @@ class XcodeProjectInfo { ...@@ -465,7 +468,6 @@ class XcodeProjectInfo {
final List<String> buildConfigurations; final List<String> buildConfigurations;
final List<String> schemes; final List<String> schemes;
bool get definesCustomTargets => !(targets.contains('Runner') && targets.length == 1);
bool get definesCustomSchemes => !(schemes.contains('Runner') && schemes.length == 1); bool get definesCustomSchemes => !(schemes.contains('Runner') && schemes.length == 1);
bool get definesCustomBuildConfigurations { bool get definesCustomBuildConfigurations {
return !(buildConfigurations.contains('Debug') && return !(buildConfigurations.contains('Debug') &&
...@@ -475,7 +477,7 @@ class XcodeProjectInfo { ...@@ -475,7 +477,7 @@ class XcodeProjectInfo {
/// The expected scheme for [buildInfo]. /// The expected scheme for [buildInfo].
static String expectedSchemeFor(BuildInfo buildInfo) { static String expectedSchemeFor(BuildInfo buildInfo) {
return toTitleCase(buildInfo.flavor ?? 'runner'); return toTitleCase(buildInfo?.flavor ?? 'runner');
} }
/// The expected build configuration for [buildInfo] and [scheme]. /// The expected build configuration for [buildInfo] and [scheme].
......
...@@ -267,7 +267,6 @@ class CocoaPods { ...@@ -267,7 +267,6 @@ class CocoaPods {
} else { } else {
final bool isSwift = (await _xcodeProjectInterpreter.getBuildSettings( final bool isSwift = (await _xcodeProjectInterpreter.getBuildSettings(
runnerProject.path, runnerProject.path,
'Runner',
)).containsKey('SWIFT_VERSION'); )).containsKey('SWIFT_VERSION');
podfileTemplateName = isSwift ? 'Podfile-ios-swift' : 'Podfile-ios-objc'; podfileTemplateName = isSwift ? 'Podfile-ios-swift' : 'Podfile-ios-objc';
} }
......
...@@ -102,11 +102,14 @@ class FlutterProject { ...@@ -102,11 +102,14 @@ class FlutterProject {
/// Gradle group ID. /// Gradle group ID.
Future<Set<String>> get organizationNames async { Future<Set<String>> get organizationNames async {
final List<String> candidates = <String>[ final List<String> candidates = <String>[
await ios.productBundleIdentifier, // Don't require iOS build info, this method is only
// used during create as best-effort, use the
// default target bundle identifier.
await ios.productBundleIdentifier(null),
android.applicationId, android.applicationId,
android.group, android.group,
example.android.applicationId, example.android.applicationId,
await example.ios.productBundleIdentifier, await example.ios.productBundleIdentifier(null),
]; ];
return Set<String>.of(candidates return Set<String>.of(candidates
.map<String>(_organizationNameFromPackageName) .map<String>(_organizationNameFromPackageName)
...@@ -411,11 +414,11 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -411,11 +414,11 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The product bundle identifier of the host app, or null if not set or if /// The product bundle identifier of the host app, or null if not set or if
/// iOS tooling needed to read it is not installed. /// iOS tooling needed to read it is not installed.
Future<String> get productBundleIdentifier async => Future<String> productBundleIdentifier(BuildInfo buildInfo) async =>
_productBundleIdentifier ??= await _parseProductBundleIdentifier(); _productBundleIdentifier ??= await _parseProductBundleIdentifier(buildInfo);
String _productBundleIdentifier; String _productBundleIdentifier;
Future<String> _parseProductBundleIdentifier() async { Future<String> _parseProductBundleIdentifier(BuildInfo buildInfo) async {
String fromPlist; String fromPlist;
final File defaultInfoPlist = defaultHostInfoPlist; final File defaultInfoPlist = defaultHostInfoPlist;
// Users can change the location of the Info.plist. // Users can change the location of the Info.plist.
...@@ -434,7 +437,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -434,7 +437,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
return fromPlist; return fromPlist;
} }
} }
final Map<String, String> allBuildSettings = await buildSettings; final Map<String, String> allBuildSettings = await buildSettingsForBuildInfo(buildInfo);
if (allBuildSettings != null) { if (allBuildSettings != null) {
if (fromPlist != null) { if (fromPlist != null) {
// Perform variable substitution using build settings. // Perform variable substitution using build settings.
...@@ -458,18 +461,18 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -458,18 +461,18 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
} }
/// The bundle name of the host app, `My App.app`. /// The bundle name of the host app, `My App.app`.
Future<String> get hostAppBundleName async => Future<String> hostAppBundleName(BuildInfo buildInfo) async =>
_hostAppBundleName ??= await _parseHostAppBundleName(); _hostAppBundleName ??= await _parseHostAppBundleName(buildInfo);
String _hostAppBundleName; String _hostAppBundleName;
Future<String> _parseHostAppBundleName() async { Future<String> _parseHostAppBundleName(BuildInfo buildInfo) async {
// The product name and bundle name are derived from the display name, which the user // The product name and bundle name are derived from the display name, which the user
// is instructed to change in Xcode as part of deploying to the App Store. // is instructed to change in Xcode as part of deploying to the App Store.
// https://flutter.dev/docs/deployment/ios#review-xcode-project-settings // https://flutter.dev/docs/deployment/ios#review-xcode-project-settings
// The only source of truth for the name is Xcode's interpretation of the build settings. // The only source of truth for the name is Xcode's interpretation of the build settings.
String productName; String productName;
if (globals.xcodeProjectInterpreter.isInstalled) { if (globals.xcodeProjectInterpreter.isInstalled) {
final Map<String, String> xcodeBuildSettings = await buildSettings; final Map<String, String> xcodeBuildSettings = await buildSettingsForBuildInfo(buildInfo);
if (xcodeBuildSettings != null) { if (xcodeBuildSettings != null) {
productName = xcodeBuildSettings['FULL_PRODUCT_NAME']; productName = xcodeBuildSettings['FULL_PRODUCT_NAME'];
} }
...@@ -483,17 +486,20 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -483,17 +486,20 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
/// The build settings for the host app of this project, as a detached map. /// The build settings for the host app of this project, as a detached map.
/// ///
/// Returns null, if iOS tooling is unavailable. /// Returns null, if iOS tooling is unavailable.
Future<Map<String, String>> get buildSettings async => Future<Map<String, String>> buildSettingsForBuildInfo(BuildInfo buildInfo) async {
_buildSettings ??= await _xcodeProjectBuildSettings(); _buildSettingsByScheme ??= <String, Map<String, String>>{};
Map<String, String> _buildSettings; final String scheme = xcode.XcodeProjectInfo.expectedSchemeFor(buildInfo);
return _buildSettingsByScheme[scheme] ??= await _xcodeProjectBuildSettings(scheme);
}
Map<String, Map<String, String>> _buildSettingsByScheme;
Future<Map<String, String>> _xcodeProjectBuildSettings() async { Future<Map<String, String>> _xcodeProjectBuildSettings(String scheme) async {
if (!globals.xcodeProjectInterpreter.isInstalled) { if (!globals.xcodeProjectInterpreter.isInstalled) {
return null; return null;
} }
final Map<String, String> buildSettings = await globals.xcodeProjectInterpreter.getBuildSettings( final Map<String, String> buildSettings = await globals.xcodeProjectInterpreter.getBuildSettings(
xcodeProject.path, xcodeProject.path,
_hostAppProjectName, scheme: scheme,
); );
if (buildSettings != null && buildSettings.isNotEmpty) { if (buildSettings != null && buildSettings.isNotEmpty) {
// No timeouts, flakes, or errors. // No timeouts, flakes, or errors.
...@@ -511,8 +517,8 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject { ...@@ -511,8 +517,8 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
} }
/// Check if one the [targets] of the project is a watchOS companion app target. /// Check if one the [targets] of the project is a watchOS companion app target.
Future<bool> containsWatchCompanion(List<String> targets) async { Future<bool> containsWatchCompanion(List<String> targets, BuildInfo buildInfo) async {
final String bundleIdentifier = await productBundleIdentifier; final String bundleIdentifier = await productBundleIdentifier(buildInfo);
// A bundle identifier is required for a companion app. // A bundle identifier is required for a companion app.
if (bundleIdentifier == null) { if (bundleIdentifier == null) {
return false; return false;
......
...@@ -469,6 +469,7 @@ class FlutterDevice { ...@@ -469,6 +469,7 @@ class FlutterDevice {
final TargetPlatform targetPlatform = await device.targetPlatform; final TargetPlatform targetPlatform = await device.targetPlatform;
package = await ApplicationPackageFactory.instance.getPackageForPlatform( package = await ApplicationPackageFactory.instance.getPackageForPlatform(
targetPlatform, targetPlatform,
buildInfo: hotRunner.debuggingOptions.buildInfo,
applicationBinary: hotRunner.applicationBinary, applicationBinary: hotRunner.applicationBinary,
); );
...@@ -524,6 +525,7 @@ class FlutterDevice { ...@@ -524,6 +525,7 @@ class FlutterDevice {
final TargetPlatform targetPlatform = await device.targetPlatform; final TargetPlatform targetPlatform = await device.targetPlatform;
package = await ApplicationPackageFactory.instance.getPackageForPlatform( package = await ApplicationPackageFactory.instance.getPackageForPlatform(
targetPlatform, targetPlatform,
buildInfo: coldRunner.debuggingOptions.buildInfo,
applicationBinary: coldRunner.applicationBinary, applicationBinary: coldRunner.applicationBinary,
); );
......
...@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/file_system.dart'; ...@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
import 'package:flutter_tools/src/base/io.dart'; import 'package:flutter_tools/src/base/io.dart';
import 'package:flutter_tools/src/base/net.dart'; import 'package:flutter_tools/src/base/net.dart';
import 'package:flutter_tools/src/base/platform.dart'; import 'package:flutter_tools/src/base/platform.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart'; import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/create.dart'; import 'package:flutter_tools/src/commands/create.dart';
import 'package:flutter_tools/src/dart/pub.dart'; import 'package:flutter_tools/src/dart/pub.dart';
...@@ -996,8 +997,20 @@ void main() { ...@@ -996,8 +997,20 @@ void main() {
await runner.run(<String>['create', '--template=app', '--no-pub', '--org', 'com.example', tmpProjectDir]); await runner.run(<String>['create', '--template=app', '--no-pub', '--org', 'com.example', tmpProjectDir]);
FlutterProject project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir)); FlutterProject project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir));
expect( expect(
await project.ios.productBundleIdentifier, await project.ios.productBundleIdentifier(BuildInfo.debug),
'com.example.helloFlutter', 'com.example.helloFlutter',
);
expect(
await project.ios.productBundleIdentifier(BuildInfo.profile),
'com.example.helloFlutter',
);
expect(
await project.ios.productBundleIdentifier(BuildInfo.release),
'com.example.helloFlutter',
);
expect(
await project.ios.productBundleIdentifier(null),
'com.example.helloFlutter',
); );
expect( expect(
project.android.applicationId, project.android.applicationId,
...@@ -1008,7 +1021,7 @@ void main() { ...@@ -1008,7 +1021,7 @@ void main() {
await runner.run(<String>['create', '--template=app', '--no-pub', '--org', 'abc^*.1#@', tmpProjectDir]); await runner.run(<String>['create', '--template=app', '--no-pub', '--org', 'abc^*.1#@', tmpProjectDir]);
project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir)); project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir));
expect( expect(
await project.ios.productBundleIdentifier, await project.ios.productBundleIdentifier(BuildInfo.debug),
'abc.1.testAbc', 'abc.1.testAbc',
); );
expect( expect(
...@@ -1020,7 +1033,7 @@ void main() { ...@@ -1020,7 +1033,7 @@ void main() {
await runner.run(<String>['create', '--template=app', '--no-pub', '--org', '#+^%', tmpProjectDir]); await runner.run(<String>['create', '--template=app', '--no-pub', '--org', '#+^%', tmpProjectDir]);
project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir)); project = FlutterProject.fromDirectory(globals.fs.directory(tmpProjectDir));
expect( expect(
await project.ios.productBundleIdentifier, await project.ios.productBundleIdentifier(BuildInfo.debug),
'flutterProject.untitled', 'flutterProject.untitled',
); );
expect( expect(
...@@ -1154,7 +1167,7 @@ void main() { ...@@ -1154,7 +1167,7 @@ void main() {
await _createProject(projectDir, <String>[], <String>[]); await _createProject(projectDir, <String>[], <String>[]);
final FlutterProject project = FlutterProject.fromDirectory(projectDir); final FlutterProject project = FlutterProject.fromDirectory(projectDir);
expect( expect(
await project.ios.productBundleIdentifier, await project.ios.productBundleIdentifier(BuildInfo.debug),
'com.bar.foo.flutterProject', 'com.bar.foo.flutterProject',
); );
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -1203,7 +1216,7 @@ void main() { ...@@ -1203,7 +1216,7 @@ void main() {
await _createProject(projectDir, <String>['--no-pub'], <String>[]); await _createProject(projectDir, <String>['--no-pub'], <String>[]);
final FlutterProject project = FlutterProject.fromDirectory(projectDir); final FlutterProject project = FlutterProject.fromDirectory(projectDir);
expect( expect(
await project.ios.productBundleIdentifier, await project.ios.productBundleIdentifier(BuildInfo.debug),
'com.bar.foo.flutterProject', 'com.bar.foo.flutterProject',
); );
}); });
...@@ -1236,7 +1249,7 @@ void main() { ...@@ -1236,7 +1249,7 @@ void main() {
); );
final FlutterProject project = FlutterProject.fromDirectory(projectDir); final FlutterProject project = FlutterProject.fromDirectory(projectDir);
expect( expect(
await project.example.ios.productBundleIdentifier, await project.example.ios.productBundleIdentifier(BuildInfo.debug),
'com.bar.foo.flutterProjectExample', 'com.bar.foo.flutterProjectExample',
); );
}); });
......
...@@ -91,6 +91,7 @@ void main() { ...@@ -91,6 +91,7 @@ void main() {
final ApplicationPackage applicationPackage = await ApplicationPackageFactory.instance.getPackageForPlatform( final ApplicationPackage applicationPackage = await ApplicationPackageFactory.instance.getPackageForPlatform(
TargetPlatform.android_arm, TargetPlatform.android_arm,
buildInfo: null,
applicationBinary: apkFile, applicationBinary: apkFile,
); );
expect(applicationPackage.name, 'app.apk'); expect(applicationPackage.name, 'app.apk');
...@@ -117,6 +118,7 @@ void main() { ...@@ -117,6 +118,7 @@ void main() {
await ApplicationPackageFactory.instance.getPackageForPlatform( await ApplicationPackageFactory.instance.getPackageForPlatform(
TargetPlatform.android_arm, TargetPlatform.android_arm,
buildInfo: null,
applicationBinary: globals.fs.file('app.apk'), applicationBinary: globals.fs.file('app.apk'),
); );
verify( verify(
...@@ -134,6 +136,7 @@ void main() { ...@@ -134,6 +136,7 @@ void main() {
await ApplicationPackageFactory.instance.getPackageForPlatform( await ApplicationPackageFactory.instance.getPackageForPlatform(
TargetPlatform.android_arm, TargetPlatform.android_arm,
buildInfo: null,
); );
verifyNever( verifyNever(
mockProcessManager.run( mockProcessManager.run(
...@@ -328,7 +331,7 @@ void main() { ...@@ -328,7 +331,7 @@ void main() {
globals.fs.file('pubspec.yaml').createSync(); globals.fs.file('pubspec.yaml').createSync();
globals.fs.file('.packages').createSync(); globals.fs.file('.packages').createSync();
final BuildableIOSApp iosApp = await IOSApp.fromIosProject( final BuildableIOSApp iosApp = await IOSApp.fromIosProject(
FlutterProject.fromDirectory(globals.fs.currentDirectory).ios) as BuildableIOSApp; FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp;
expect(iosApp, null); expect(iosApp, null);
}, overrides: overrides); }, overrides: overrides);
...@@ -338,7 +341,7 @@ void main() { ...@@ -338,7 +341,7 @@ void main() {
globals.fs.file('.packages').createSync(); globals.fs.file('.packages').createSync();
globals.fs.file('ios/FooBar.xcodeproj').createSync(recursive: true); globals.fs.file('ios/FooBar.xcodeproj').createSync(recursive: true);
final BuildableIOSApp iosApp = await IOSApp.fromIosProject( final BuildableIOSApp iosApp = await IOSApp.fromIosProject(
FlutterProject.fromDirectory(globals.fs.currentDirectory).ios) as BuildableIOSApp; FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp;
expect(iosApp, null); expect(iosApp, null);
}, overrides: overrides); }, overrides: overrides);
...@@ -348,7 +351,7 @@ void main() { ...@@ -348,7 +351,7 @@ void main() {
globals.fs.file('.packages').createSync(); globals.fs.file('.packages').createSync();
globals.fs.file('ios/Runner.xcodeproj').createSync(recursive: true); globals.fs.file('ios/Runner.xcodeproj').createSync(recursive: true);
final BuildableIOSApp iosApp = await IOSApp.fromIosProject( final BuildableIOSApp iosApp = await IOSApp.fromIosProject(
FlutterProject.fromDirectory(globals.fs.currentDirectory).ios) as BuildableIOSApp; FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp;
expect(iosApp, null); expect(iosApp, null);
}, overrides: overrides); }, overrides: overrides);
......
...@@ -6,6 +6,7 @@ import 'dart:async'; ...@@ -6,6 +6,7 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:flutter_tools/src/base/logger.dart'; import 'package:flutter_tools/src/base/logger.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/project.dart';
import 'package:mockito/mockito.dart'; import 'package:mockito/mockito.dart';
import 'package:flutter_tools/src/application_package.dart'; import 'package:flutter_tools/src/application_package.dart';
...@@ -36,28 +37,32 @@ void main() { ...@@ -36,28 +37,32 @@ void main() {
when(mockProcessManager.canRun(any)).thenReturn(true); when(mockProcessManager.canRun(any)).thenReturn(true);
mockConfig = MockConfig(); mockConfig = MockConfig();
mockIosProject = MockIosProject(); mockIosProject = MockIosProject();
when(mockIosProject.buildSettings).thenAnswer((_) { when(mockIosProject.buildSettingsForBuildInfo(any)).thenAnswer((_) {
return Future<Map<String, String>>.value(<String, String>{ return Future<Map<String, String>>.value(<String, String>{
'For our purposes': 'a non-empty build settings map is valid', 'For our purposes': 'a non-empty build settings map is valid',
}); });
}); });
testTerminal = TestTerminal(); testTerminal = TestTerminal();
testTerminal.usesTerminalUi = true; testTerminal.usesTerminalUi = true;
app = await BuildableIOSApp.fromProject(mockIosProject); app = await BuildableIOSApp.fromProject(mockIosProject, null);
}); });
testWithoutContext('No auto-sign if Xcode project settings are not available', () async { testWithoutContext('No auto-sign if Xcode project settings are not available', () async {
when(mockIosProject.buildSettings).thenReturn(null); const BuildInfo buildInfo = BuildInfo.debug;
when(mockIosProject.buildSettingsForBuildInfo(any)).thenReturn(null);
final Map<String, String> signingConfigs = await getCodeSigningIdentityDevelopmentTeam( final Map<String, String> signingConfigs = await getCodeSigningIdentityDevelopmentTeam(
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: buildInfo,
); );
expect(signingConfigs, isNull); expect(signingConfigs, isNull);
verify(mockIosProject.buildSettingsForBuildInfo(buildInfo));
}); });
testWithoutContext('No discovery if development team specified in Xcode project', () async { testWithoutContext('No discovery if development team specified in Xcode project', () async {
when(mockIosProject.buildSettings).thenAnswer((_) { const BuildInfo buildInfo = BuildInfo.debug;
when(mockIosProject.buildSettingsForBuildInfo(any)).thenAnswer((_) {
return Future<Map<String, String>>.value(<String, String>{ return Future<Map<String, String>>.value(<String, String>{
'DEVELOPMENT_TEAM': 'abc', 'DEVELOPMENT_TEAM': 'abc',
}); });
...@@ -66,11 +71,13 @@ void main() { ...@@ -66,11 +71,13 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: buildInfo,
); );
expect(signingConfigs, isNull); expect(signingConfigs, isNull);
expect(logger.statusText, equals( expect(logger.statusText, equals(
'Automatically signing iOS for device deployment using specified development team in Xcode project: abc\n' 'Automatically signing iOS for device deployment using specified development team in Xcode project: abc\n'
)); ));
verify(mockIosProject.buildSettingsForBuildInfo(buildInfo));
}); });
testWithoutContext('No auto-sign if security or openssl not available', () async { testWithoutContext('No auto-sign if security or openssl not available', () async {
...@@ -80,12 +87,14 @@ void main() { ...@@ -80,12 +87,14 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect(signingConfigs, isNull); expect(signingConfigs, isNull);
}); });
testUsingContext('No valid code signing certificates shows instructions', () async { testUsingContext('No valid code signing certificates shows instructions', () async {
when(mockIosProject.buildSettings).thenAnswer((_) { const BuildInfo buildInfo = BuildInfo.debug;
when(mockIosProject.buildSettingsForBuildInfo(any)).thenAnswer((_) {
return Future<Map<String, String>>.value(<String, String>{}); return Future<Map<String, String>>.value(<String, String>{});
}); });
when(mockProcessManager.run( when(mockProcessManager.run(
...@@ -108,7 +117,9 @@ void main() { ...@@ -108,7 +117,9 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: buildInfo,
), throwsToolExit(message: 'No development certificates available to code sign app for device deployment')); ), throwsToolExit(message: 'No development certificates available to code sign app for device deployment'));
verify(mockIosProject.buildSettingsForBuildInfo(buildInfo));
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
OutputPreferences: () => OutputPreferences(wrapText: false), OutputPreferences: () => OutputPreferences(wrapText: false),
...@@ -172,6 +183,7 @@ void main() { ...@@ -172,6 +183,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect(logger.statusText, contains('iPhone Developer: Profile 1 (1111AAAA11)')); expect(logger.statusText, contains('iPhone Developer: Profile 1 (1111AAAA11)'));
...@@ -240,6 +252,7 @@ void main() { ...@@ -240,6 +252,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
} on Exception catch (e) { } on Exception catch (e) {
// This should not throw // This should not throw
...@@ -314,6 +327,7 @@ void main() { ...@@ -314,6 +327,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect( expect(
...@@ -399,6 +413,7 @@ void main() { ...@@ -399,6 +413,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect( expect(
...@@ -476,6 +491,7 @@ void main() { ...@@ -476,6 +491,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect( expect(
...@@ -559,6 +575,7 @@ void main() { ...@@ -559,6 +575,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect( expect(
...@@ -600,6 +617,7 @@ void main() { ...@@ -600,6 +617,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect(signingConfigs, isNull); expect(signingConfigs, isNull);
}); });
...@@ -643,6 +661,7 @@ void main() { ...@@ -643,6 +661,7 @@ void main() {
iosApp: app, iosApp: app,
processManager: mockProcessManager, processManager: mockProcessManager,
logger: logger, logger: logger,
buildInfo: null,
); );
expect(signingConfigs, isNull); expect(signingConfigs, isNull);
}, },
......
...@@ -395,7 +395,7 @@ Exited (sigterm)''', ...@@ -395,7 +395,7 @@ Exited (sigterm)''',
final MockFile pbxprojFile = MockFile(); final MockFile pbxprojFile = MockFile();
when(project.xcodeProjectInfoFile).thenReturn(pbxprojFile); when(project.xcodeProjectInfoFile).thenReturn(pbxprojFile);
when(project.hostAppBundleName).thenAnswer((_) => Future<String>.value('UnitTestRunner.app')); when(project.hostAppBundleName(any)).thenAnswer((_) => Future<String>.value('UnitTestRunner.app'));
when(pbxprojFile.readAsLinesSync()) when(pbxprojFile.readAsLinesSync())
.thenAnswer((_) => flutterAssetPbxProjLines); .thenAnswer((_) => flutterAssetPbxProjLines);
when(pbxprojFile.existsSync()) when(pbxprojFile.existsSync())
......
...@@ -553,7 +553,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -553,7 +553,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode: mockXcode, xcode: mockXcode,
); );
final DeviceLogReader logReader = device.getLogReader( final DeviceLogReader logReader = device.getLogReader(
app: await BuildableIOSApp.fromProject(mockIosProject), app: await BuildableIOSApp.fromProject(mockIosProject, null),
); );
final List<String> lines = await logReader.logLines.toList(); final List<String> lines = await logReader.logLines.toList();
...@@ -587,7 +587,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -587,7 +587,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode: mockXcode, xcode: mockXcode,
); );
final DeviceLogReader logReader = device.getLogReader( final DeviceLogReader logReader = device.getLogReader(
app: await BuildableIOSApp.fromProject(mockIosProject), app: await BuildableIOSApp.fromProject(mockIosProject, null),
); );
final List<String> lines = await logReader.logLines.toList(); final List<String> lines = await logReader.logLines.toList();
...@@ -634,7 +634,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -634,7 +634,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode: mockXcode, xcode: mockXcode,
); );
final DeviceLogReader logReader = device.getLogReader( final DeviceLogReader logReader = device.getLogReader(
app: await BuildableIOSApp.fromProject(mockIosProject), app: await BuildableIOSApp.fromProject(mockIosProject, null),
); );
final List<String> lines = await logReader.logLines.toList(); final List<String> lines = await logReader.logLines.toList();
...@@ -699,7 +699,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -699,7 +699,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
xcode: mockXcode, xcode: mockXcode,
); );
final DeviceLogReader logReader = device.getLogReader( final DeviceLogReader logReader = device.getLogReader(
app: await BuildableIOSApp.fromProject(mockIosProject), app: await BuildableIOSApp.fromProject(mockIosProject, null),
); );
final List<String> lines = await logReader.logLines.toList(); final List<String> lines = await logReader.logLines.toList();
......
...@@ -68,7 +68,7 @@ void main() { ...@@ -68,7 +68,7 @@ void main() {
platform.environment = const <String, String>{}; platform.environment = const <String, String>{};
expect(await xcodeProjectInterpreter.getBuildSettings( expect(await xcodeProjectInterpreter.getBuildSettings(
'', '', timeout: delay), '', scheme: 'Runner', timeout: delay),
const <String, String>{}); const <String, String>{});
// build settings times out and is killed once, then succeeds. // build settings times out and is killed once, then succeeds.
verify(processManager.killPid(any)).called(1); verify(processManager.killPid(any)).called(1);
...@@ -246,14 +246,31 @@ void main() { ...@@ -246,14 +246,31 @@ void main() {
'/usr/bin/xcodebuild', '/usr/bin/xcodebuild',
'-project', '-project',
'/', '/',
'-target', '-scheme',
'Runner', 'Free',
'-showBuildSettings' '-showBuildSettings'
], ],
exitCode: 1, exitCode: 1,
)); ));
expect(await xcodeProjectInterpreter.getBuildSettings('', 'Runner'), const <String, String>{}); expect(await xcodeProjectInterpreter.getBuildSettings('', scheme: 'Free'), const <String, String>{});
expect(fakeProcessManager.hasRemainingExpectations, isFalse);
});
testWithoutContext('build settings accepts an empty scheme', () async {
platform.environment = const <String, String>{};
fakeProcessManager.addCommand(const FakeCommand(
command: <String>[
'/usr/bin/xcodebuild',
'-project',
'/',
'-showBuildSettings'
],
exitCode: 1,
));
expect(await xcodeProjectInterpreter.getBuildSettings(''), const <String, String>{});
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager.hasRemainingExpectations, isFalse);
}); });
...@@ -267,14 +284,14 @@ void main() { ...@@ -267,14 +284,14 @@ void main() {
xcodebuild, xcodebuild,
'-project', '-project',
fileSystem.path.separator, fileSystem.path.separator,
'-target', '-scheme',
'Runner', 'Free',
'-showBuildSettings', '-showBuildSettings',
'CODE_SIGN_STYLE=Manual', 'CODE_SIGN_STYLE=Manual',
'ARCHS=arm64' 'ARCHS=arm64'
], ],
)); ));
expect(await xcodeProjectInterpreter.getBuildSettings('', 'Runner'), const <String, String>{}); expect(await xcodeProjectInterpreter.getBuildSettings('', scheme: 'Free'), const <String, String>{});
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager.hasRemainingExpectations, isFalse);
}); });
...@@ -290,7 +307,7 @@ void main() { ...@@ -290,7 +307,7 @@ void main() {
'-workspace', '-workspace',
'workspace_path', 'workspace_path',
'-scheme', '-scheme',
'Runner', 'Free',
'-quiet', '-quiet',
'clean', 'clean',
'CODE_SIGN_STYLE=Manual', 'CODE_SIGN_STYLE=Manual',
...@@ -298,7 +315,7 @@ void main() { ...@@ -298,7 +315,7 @@ void main() {
], ],
)); ));
await xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Runner'); await xcodeProjectInterpreter.cleanWorkspace('workspace_path', 'Free');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager.hasRemainingExpectations, isFalse);
}); });
......
...@@ -208,7 +208,7 @@ void main() { ...@@ -208,7 +208,7 @@ void main() {
}); });
testWithoutContext('creates objective-c Podfile when not present', () async { testWithoutContext('creates objective-c Podfile when not present', () async {
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)) when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: null, timeout: anyNamed('timeout')))
.thenAnswer((_) async => <String, String>{}); .thenAnswer((_) async => <String, String>{});
await cocoaPodsUnderTest.setupPodfile(projectUnderTest.ios); await cocoaPodsUnderTest.setupPodfile(projectUnderTest.ios);
...@@ -216,7 +216,7 @@ void main() { ...@@ -216,7 +216,7 @@ void main() {
}); });
testUsingContext('creates swift Podfile if swift', () async { testUsingContext('creates swift Podfile if swift', () async {
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)) when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: null, timeout: anyNamed('timeout')))
.thenAnswer((_) async => <String, String>{ .thenAnswer((_) async => <String, String>{
'SWIFT_VERSION': '5.0', 'SWIFT_VERSION': '5.0',
}); });
......
...@@ -386,19 +386,19 @@ apply plugin: 'kotlin-android' ...@@ -386,19 +386,19 @@ apply plugin: 'kotlin-android'
testWithMocks('null, if no build settings or plist entries', () async { testWithMocks('null, if no build settings or plist entries', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
expect(await project.ios.productBundleIdentifier, isNull); expect(await project.ios.productBundleIdentifier(null), isNull);
}); });
testWithMocks('from build settings, if no plist', () async { testWithMocks('from build settings, if no plist', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenAnswer( when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: anyNamed('scheme'))).thenAnswer(
(_) { (_) {
return Future<Map<String,String>>.value(<String, String>{ return Future<Map<String,String>>.value(<String, String>{
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject', 'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
}); });
} }
); );
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
testWithMocks('from project file, if no plist or build settings', () async { testWithMocks('from project file, if no plist or build settings', () async {
...@@ -406,19 +406,19 @@ apply plugin: 'kotlin-android' ...@@ -406,19 +406,19 @@ apply plugin: 'kotlin-android'
addIosProjectFile(project.directory, projectFileContent: () { addIosProjectFile(project.directory, projectFileContent: () {
return projectFileWithBundleId('io.flutter.someProject'); return projectFileWithBundleId('io.flutter.someProject');
}); });
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
testWithMocks('from plist, if no variables', () async { testWithMocks('from plist, if no variables', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
project.ios.defaultHostInfoPlist.createSync(recursive: true); project.ios.defaultHostInfoPlist.createSync(recursive: true);
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn('io.flutter.someProject'); when(mockPlistUtils.getValueFromFile(any, any)).thenReturn('io.flutter.someProject');
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
testWithMocks('from build settings and plist, if default variable', () async { testWithMocks('from build settings and plist, if default variable', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenAnswer( when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: anyNamed('scheme'))).thenAnswer(
(_) { (_) {
return Future<Map<String,String>>.value(<String, String>{ return Future<Map<String,String>>.value(<String, String>{
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject', 'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
...@@ -426,13 +426,13 @@ apply plugin: 'kotlin-android' ...@@ -426,13 +426,13 @@ apply plugin: 'kotlin-android'
} }
); );
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER)'); when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER)');
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
testWithMocks('from build settings and plist, by substitution', () async { testWithMocks('from build settings and plist, by substitution', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
project.ios.defaultHostInfoPlist.createSync(recursive: true); project.ios.defaultHostInfoPlist.createSync(recursive: true);
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenAnswer( when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: anyNamed('scheme'))).thenAnswer(
(_) { (_) {
return Future<Map<String,String>>.value(<String, String>{ return Future<Map<String,String>>.value(<String, String>{
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject', 'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
...@@ -441,28 +441,28 @@ apply plugin: 'kotlin-android' ...@@ -441,28 +441,28 @@ apply plugin: 'kotlin-android'
} }
); );
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)'); when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)');
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject.suffix'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject.suffix');
}); });
testWithMocks('empty surrounded by quotes', () async { testWithMocks('empty surrounded by quotes', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
addIosProjectFile(project.directory, projectFileContent: () { addIosProjectFile(project.directory, projectFileContent: () {
return projectFileWithBundleId('', qualifier: '"'); return projectFileWithBundleId('', qualifier: '"');
}); });
expect(await project.ios.productBundleIdentifier, ''); expect(await project.ios.productBundleIdentifier(null), '');
}); });
testWithMocks('surrounded by double quotes', () async { testWithMocks('surrounded by double quotes', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
addIosProjectFile(project.directory, projectFileContent: () { addIosProjectFile(project.directory, projectFileContent: () {
return projectFileWithBundleId('io.flutter.someProject', qualifier: '"'); return projectFileWithBundleId('io.flutter.someProject', qualifier: '"');
}); });
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
testWithMocks('surrounded by single quotes', () async { testWithMocks('surrounded by single quotes', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
addIosProjectFile(project.directory, projectFileContent: () { addIosProjectFile(project.directory, projectFileContent: () {
return projectFileWithBundleId('io.flutter.someProject', qualifier: "'"); return projectFileWithBundleId('io.flutter.someProject', qualifier: "'");
}); });
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject'); expect(await project.ios.productBundleIdentifier(null), 'io.flutter.someProject');
}); });
}); });
...@@ -476,7 +476,7 @@ apply plugin: 'kotlin-android' ...@@ -476,7 +476,7 @@ apply plugin: 'kotlin-android'
testUsingContext('app product name defaults to Runner.app', () async { testUsingContext('app product name defaults to Runner.app', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
expect(await project.ios.hostAppBundleName, 'Runner.app'); expect(await project.ios.hostAppBundleName(null), 'Runner.app');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -485,13 +485,13 @@ apply plugin: 'kotlin-android' ...@@ -485,13 +485,13 @@ apply plugin: 'kotlin-android'
testUsingContext('app product name xcodebuild settings', () async { testUsingContext('app product name xcodebuild settings', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenAnswer((_) { when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: anyNamed('scheme'))).thenAnswer((_) {
return Future<Map<String,String>>.value(<String, String>{ return Future<Map<String,String>>.value(<String, String>{
'FULL_PRODUCT_NAME': 'My App.app' 'FULL_PRODUCT_NAME': 'My App.app'
}); });
}); });
expect(await project.ios.hostAppBundleName, 'My App.app'); expect(await project.ios.hostAppBundleName(null), 'My App.app');
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -630,7 +630,7 @@ name: foo_bar ...@@ -630,7 +630,7 @@ name: foo_bar
testUsingContext('cannot find bundle identifier', () async { testUsingContext('cannot find bundle identifier', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget']), isFalse); expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -641,7 +641,7 @@ name: foo_bar ...@@ -641,7 +641,7 @@ name: foo_bar
group('with bundle identifier', () { group('with bundle identifier', () {
setUp(() { setUp(() {
when(mockXcodeProjectInterpreter.getBuildSettings(any, any)).thenAnswer( when(mockXcodeProjectInterpreter.getBuildSettings(any, scheme: anyNamed('scheme'))).thenAnswer(
(_) { (_) {
return Future<Map<String,String>>.value(<String, String>{ return Future<Map<String,String>>.value(<String, String>{
'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject', 'PRODUCT_BUNDLE_IDENTIFIER': 'io.flutter.someProject',
...@@ -652,7 +652,7 @@ name: foo_bar ...@@ -652,7 +652,7 @@ name: foo_bar
testUsingContext('no Info.plist in target', () async { testUsingContext('no Info.plist in target', () async {
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget']), isFalse); expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -665,7 +665,7 @@ name: foo_bar ...@@ -665,7 +665,7 @@ name: foo_bar
final FlutterProject project = await someProject(); final FlutterProject project = await someProject();
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget']), isFalse); expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -679,7 +679,7 @@ name: foo_bar ...@@ -679,7 +679,7 @@ name: foo_bar
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
when(mockPlistUtils.getValueFromFile(any, 'WKCompanionAppBundleIdentifier')).thenReturn('io.flutter.someOTHERproject'); when(mockPlistUtils.getValueFromFile(any, 'WKCompanionAppBundleIdentifier')).thenReturn('io.flutter.someOTHERproject');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget']), isFalse); expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isFalse);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
...@@ -693,7 +693,7 @@ name: foo_bar ...@@ -693,7 +693,7 @@ name: foo_bar
project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true); project.ios.hostAppRoot.childDirectory('WatchTarget').childFile('Info.plist').createSync(recursive: true);
when(mockPlistUtils.getValueFromFile(any, 'WKCompanionAppBundleIdentifier')).thenReturn('io.flutter.someProject'); when(mockPlistUtils.getValueFromFile(any, 'WKCompanionAppBundleIdentifier')).thenReturn('io.flutter.someProject');
expect(await project.ios.containsWatchCompanion(<String>['WatchTarget']), isTrue); expect(await project.ios.containsWatchCompanion(<String>['WatchTarget'], null), isTrue);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fs, FileSystem: () => fs,
ProcessManager: () => FakeProcessManager.any(), ProcessManager: () => FakeProcessManager.any(),
......
...@@ -397,8 +397,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter { ...@@ -397,8 +397,8 @@ class FakeXcodeProjectInterpreter implements XcodeProjectInterpreter {
@override @override
Future<Map<String, String>> getBuildSettings( Future<Map<String, String>> getBuildSettings(
String projectPath, String projectPath, {
String target, { String scheme,
Duration timeout = const Duration(minutes: 1), Duration timeout = const Duration(minutes: 1),
}) async { }) async {
return <String, String>{}; return <String, String>{};
......
...@@ -54,9 +54,10 @@ class MockApplicationPackageFactory extends Mock implements ApplicationPackageFa ...@@ -54,9 +54,10 @@ class MockApplicationPackageFactory extends Mock implements ApplicationPackageFa
@override @override
Future<ApplicationPackage> getPackageForPlatform( Future<ApplicationPackage> getPackageForPlatform(
TargetPlatform platform, { TargetPlatform platform, {
BuildInfo buildInfo,
File applicationBinary, File applicationBinary,
}) async { }) async {
return _store.getPackageForPlatform(platform); return _store.getPackageForPlatform(platform, buildInfo);
} }
} }
...@@ -531,10 +532,10 @@ class MockIosProject extends Mock implements IosProject { ...@@ -531,10 +532,10 @@ class MockIosProject extends Mock implements IosProject {
static const String appBundleName = 'My Super Awesome App.app'; static const String appBundleName = 'My Super Awesome App.app';
@override @override
Future<String> get productBundleIdentifier async => bundleId; Future<String> productBundleIdentifier(BuildInfo buildInfo) async => bundleId;
@override @override
Future<String> get hostAppBundleName async => appBundleName; Future<String> hostAppBundleName(BuildInfo buildInfo) async => appBundleName;
} }
class MockAndroidDevice extends Mock implements AndroidDevice { class MockAndroidDevice extends Mock implements AndroidDevice {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment