With a fix of a path being printed relative instead of absolute.
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/build_info.dart';
|
||||
import 'package:flutter_tools/src/flutter_manifest.dart';
|
||||
import 'package:flutter_tools/src/ios/xcodeproj.dart';
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:process/process.dart';
|
||||
@@ -31,7 +32,7 @@ void main() {
|
||||
// This test is written to fail if our bots get Android SDKs in the future: shouldBeToolExit
|
||||
// will be null and our expectation would fail. That would remind us to make these tests
|
||||
// hermetic before adding Android SDKs to the bots.
|
||||
await updateLocalProperties();
|
||||
await updateLocalProperties(project: new FlutterProject(fs.currentDirectory));
|
||||
} on Exception catch (e) {
|
||||
shouldBeToolExit = e;
|
||||
}
|
||||
@@ -69,7 +70,10 @@ someProperty: someValue
|
||||
buildDir: /Users/some/apps/hello/build/app
|
||||
someOtherProperty: someOtherValue
|
||||
''');
|
||||
expect(project.apkDirectory, fs.path.normalize('/Users/some/apps/hello/build/app/outputs/apk'));
|
||||
expect(
|
||||
fs.path.normalize(project.apkDirectory.path),
|
||||
fs.path.normalize('/Users/some/apps/hello/build/app/outputs/apk'),
|
||||
);
|
||||
});
|
||||
test('should extract default build variants from app properties', () {
|
||||
final GradleProject project = projectFrom('''
|
||||
@@ -110,27 +114,27 @@ someOtherProperty: someOtherValue
|
||||
expect(project.productFlavors, <String>['free', 'paid']);
|
||||
});
|
||||
test('should provide apk file name for default build types', () {
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>[], '/some/dir');
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>[], fs.directory('/some/dir'));
|
||||
expect(project.apkFileFor(BuildInfo.debug), 'app-debug.apk');
|
||||
expect(project.apkFileFor(BuildInfo.profile), 'app-profile.apk');
|
||||
expect(project.apkFileFor(BuildInfo.release), 'app-release.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
});
|
||||
test('should provide apk file name for flavored build types', () {
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], '/some/dir');
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], fs.directory('/some/dir'));
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.debug, 'free')), 'app-free-debug.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'paid')), 'app-paid-release.apk');
|
||||
expect(project.apkFileFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
});
|
||||
test('should provide assemble task name for default build types', () {
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>[], '/some/dir');
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>[], fs.directory('/some/dir'));
|
||||
expect(project.assembleTaskFor(BuildInfo.debug), 'assembleDebug');
|
||||
expect(project.assembleTaskFor(BuildInfo.profile), 'assembleProfile');
|
||||
expect(project.assembleTaskFor(BuildInfo.release), 'assembleRelease');
|
||||
expect(project.assembleTaskFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
});
|
||||
test('should provide assemble task name for flavored build types', () {
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], '/some/dir');
|
||||
final GradleProject project = new GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], fs.directory('/some/dir'));
|
||||
expect(project.assembleTaskFor(const BuildInfo(BuildMode.debug, 'free')), 'assembleFreeDebug');
|
||||
expect(project.assembleTaskFor(const BuildInfo(BuildMode.release, 'paid')), 'assemblePaidRelease');
|
||||
expect(project.assembleTaskFor(const BuildInfo(BuildMode.release, 'unknown')), isNull);
|
||||
@@ -185,7 +189,10 @@ someOtherProperty: someOtherValue
|
||||
writeSchemaFile(fs, schemaData);
|
||||
|
||||
try {
|
||||
await updateLocalProperties(projectPath: 'path/to/project', buildInfo: buildInfo);
|
||||
await updateLocalProperties(
|
||||
project: new FlutterProject.fromPath('path/to/project'),
|
||||
buildInfo: buildInfo,
|
||||
);
|
||||
|
||||
final File localPropertiesFile = fs.file('path/to/project/android/local.properties');
|
||||
expect(propertyFor('flutter.versionName', localPropertiesFile), expectedBuildName);
|
||||
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
};
|
||||
testUsingContext('Error on non-existing file', () {
|
||||
final PrebuiltIOSApp iosApp =
|
||||
new IOSApp.fromPrebuiltApp('not_existing.ipa');
|
||||
new IOSApp.fromPrebuiltApp(fs.file('not_existing.ipa'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(
|
||||
@@ -68,7 +68,7 @@ void main() {
|
||||
testUsingContext('Error on non-app-bundle folder', () {
|
||||
fs.directory('regular_folder').createSync();
|
||||
final PrebuiltIOSApp iosApp =
|
||||
new IOSApp.fromPrebuiltApp('regular_folder');
|
||||
new IOSApp.fromPrebuiltApp(fs.file('regular_folder'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(
|
||||
@@ -76,7 +76,7 @@ void main() {
|
||||
}, overrides: overrides);
|
||||
testUsingContext('Error on no info.plist', () {
|
||||
fs.directory('bundle.app').createSync();
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('bundle.app');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('bundle.app'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(
|
||||
@@ -87,7 +87,7 @@ void main() {
|
||||
testUsingContext('Error on bad info.plist', () {
|
||||
fs.directory('bundle.app').createSync();
|
||||
fs.file('bundle.app/Info.plist').writeAsStringSync(badPlistData);
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('bundle.app');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('bundle.app'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(
|
||||
@@ -99,7 +99,7 @@ void main() {
|
||||
testUsingContext('Success with app bundle', () {
|
||||
fs.directory('bundle.app').createSync();
|
||||
fs.file('bundle.app/Info.plist').writeAsStringSync(plistData);
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('bundle.app');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('bundle.app'));
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(logger.errorText, isEmpty);
|
||||
expect(iosApp.bundleDir.path, 'bundle.app');
|
||||
@@ -109,7 +109,7 @@ void main() {
|
||||
testUsingContext('Bad ipa zip-file, no payload dir', () {
|
||||
fs.file('app.ipa').createSync();
|
||||
when(os.unzip(fs.file('app.ipa'), any)).thenAnswer((Invocation _) {});
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('app.ipa');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('app.ipa'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(
|
||||
@@ -132,7 +132,7 @@ void main() {
|
||||
fs.directory(bundlePath1).createSync(recursive: true);
|
||||
fs.directory(bundlePath2).createSync(recursive: true);
|
||||
});
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('app.ipa');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('app.ipa'));
|
||||
expect(iosApp, isNull);
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(logger.errorText,
|
||||
@@ -153,7 +153,7 @@ void main() {
|
||||
.file(fs.path.join(bundleAppDir.path, 'Info.plist'))
|
||||
.writeAsStringSync(plistData);
|
||||
});
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp('app.ipa');
|
||||
final PrebuiltIOSApp iosApp = new IOSApp.fromPrebuiltApp(fs.file('app.ipa'));
|
||||
final BufferLogger logger = context[Logger];
|
||||
expect(logger.errorText, isEmpty);
|
||||
expect(iosApp.bundleDir.path, endsWith('bundle.app'));
|
||||
|
||||
@@ -9,7 +9,6 @@ import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/flutter_manifest.dart';
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
import 'package:flutter_tools/src/ios/cocoapods.dart';
|
||||
import 'package:flutter_tools/src/ios/xcodeproj.dart';
|
||||
@@ -25,7 +24,7 @@ void main() {
|
||||
FileSystem fs;
|
||||
ProcessManager mockProcessManager;
|
||||
MockXcodeProjectInterpreter mockXcodeProjectInterpreter;
|
||||
Directory projectUnderTest;
|
||||
FlutterProject projectUnderTest;
|
||||
CocoaPods cocoaPodsUnderTest;
|
||||
InvokeProcess resultOfPodVersion;
|
||||
|
||||
@@ -46,7 +45,8 @@ void main() {
|
||||
fs = new MemoryFileSystem();
|
||||
mockProcessManager = new MockProcessManager();
|
||||
mockXcodeProjectInterpreter = new MockXcodeProjectInterpreter();
|
||||
projectUnderTest = fs.directory(fs.path.join('project', 'ios'))..createSync(recursive: true);
|
||||
projectUnderTest = new FlutterProject(fs.directory('project'));
|
||||
projectUnderTest.ios.directory.createSync(recursive: true);
|
||||
cocoaPodsUnderTest = new CocoaPods();
|
||||
pretendPodVersionIs('1.5.0');
|
||||
fs.file(fs.path.join(
|
||||
@@ -124,22 +124,10 @@ void main() {
|
||||
});
|
||||
|
||||
group('Setup Podfile', () {
|
||||
File podFile;
|
||||
File debugConfigFile;
|
||||
File releaseConfigFile;
|
||||
|
||||
setUp(() {
|
||||
debugConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Debug.xcconfig'));
|
||||
releaseConfigFile = fs.file(fs.path.join('project', 'ios', 'Flutter', 'Release.xcconfig'));
|
||||
podFile = fs.file(fs.path.join('project', 'ios', 'Podfile'));
|
||||
});
|
||||
|
||||
testUsingContext('creates objective-c Podfile when not present', () async {
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('project').manifest;
|
||||
cocoaPodsUnderTest.setupPodfile('project', manifest);
|
||||
cocoaPodsUnderTest.setupPodfile(projectUnderTest.ios);
|
||||
|
||||
expect(podFile.readAsStringSync(), 'Objective-C podfile template');
|
||||
expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Objective-C podfile template');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
});
|
||||
@@ -150,24 +138,22 @@ void main() {
|
||||
'SWIFT_VERSION': '4.0',
|
||||
});
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('project').manifest;
|
||||
cocoaPodsUnderTest.setupPodfile('project', manifest);
|
||||
final FlutterProject project = new FlutterProject.fromPath('project');
|
||||
cocoaPodsUnderTest.setupPodfile(project.ios);
|
||||
|
||||
expect(podFile.readAsStringSync(), 'Swift podfile template');
|
||||
expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Swift podfile template');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
||||
});
|
||||
|
||||
testUsingContext('does not recreate Podfile when already present', () async {
|
||||
podFile..createSync()..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile');
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('project').manifest;
|
||||
cocoaPodsUnderTest.setupPodfile('project', manifest);
|
||||
final FlutterProject project = new FlutterProject.fromPath('project');
|
||||
cocoaPodsUnderTest.setupPodfile(project.ios);
|
||||
|
||||
expect(podFile.readAsStringSync(), 'Existing Podfile');
|
||||
expect(projectUnderTest.ios.podfile.readAsStringSync(), 'Existing Podfile');
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
});
|
||||
@@ -175,30 +161,32 @@ void main() {
|
||||
testUsingContext('does not create Podfile when we cannot interpret Xcode projects', () async {
|
||||
when(mockXcodeProjectInterpreter.isInstalled).thenReturn(false);
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('project').manifest;
|
||||
cocoaPodsUnderTest.setupPodfile('project', manifest);
|
||||
final FlutterProject project = new FlutterProject.fromPath('project');
|
||||
cocoaPodsUnderTest.setupPodfile(project.ios);
|
||||
|
||||
expect(podFile.existsSync(), false);
|
||||
expect(projectUnderTest.ios.podfile.existsSync(), false);
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
|
||||
});
|
||||
|
||||
testUsingContext('includes Pod config in xcconfig files, if not present', () async {
|
||||
podFile..createSync()..writeAsStringSync('Existing Podfile');
|
||||
debugConfigFile..createSync(recursive: true)..writeAsStringSync('Existing debug config');
|
||||
releaseConfigFile..createSync(recursive: true)..writeAsStringSync('Existing release config');
|
||||
projectUnderTest.ios.podfile..createSync()..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.ios.xcodeConfigFor('Debug')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing debug config');
|
||||
projectUnderTest.ios.xcodeConfigFor('Release')
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing release config');
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('project').manifest;
|
||||
cocoaPodsUnderTest.setupPodfile('project', manifest);
|
||||
final FlutterProject project = new FlutterProject.fromPath('project');
|
||||
cocoaPodsUnderTest.setupPodfile(project.ios);
|
||||
|
||||
final String debugContents = debugConfigFile.readAsStringSync();
|
||||
final String debugContents = projectUnderTest.ios.xcodeConfigFor('Debug').readAsStringSync();
|
||||
expect(debugContents, contains(
|
||||
'#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"\n'));
|
||||
expect(debugContents, contains('Existing debug config'));
|
||||
final String releaseContents = releaseConfigFile.readAsStringSync();
|
||||
final String releaseContents = projectUnderTest.ios.xcodeConfigFor('Release').readAsStringSync();
|
||||
expect(releaseContents, contains(
|
||||
'#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"\n'));
|
||||
expect(releaseContents, contains('Existing release config'));
|
||||
@@ -210,9 +198,9 @@ void main() {
|
||||
group('Process pods', () {
|
||||
testUsingContext('prints error, if CocoaPods is not installed', () async {
|
||||
pretendPodIsNotInstalled();
|
||||
projectUnderTest.childFile('Podfile').createSync();
|
||||
projectUnderTest.ios.podfile.createSync();
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
);
|
||||
verifyNever(mockProcessManager.run(
|
||||
@@ -231,7 +219,7 @@ void main() {
|
||||
testUsingContext('throws, if Podfile is missing.', () async {
|
||||
try {
|
||||
await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
);
|
||||
fail('ToolExit expected');
|
||||
@@ -278,7 +266,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
));
|
||||
try {
|
||||
await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
);
|
||||
fail('ToolExit expected');
|
||||
@@ -295,14 +283,14 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('run pod install, if Podfile.lock is missing', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: false,
|
||||
);
|
||||
@@ -318,14 +306,14 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('runs pod install, if Manifest.lock is missing', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: false,
|
||||
);
|
||||
@@ -344,17 +332,17 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('runs pod install, if Manifest.lock different from Podspec.lock', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Different lock file.');
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: false,
|
||||
);
|
||||
@@ -373,17 +361,17 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('runs pod install, if flutter framework changed', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: true,
|
||||
);
|
||||
@@ -402,20 +390,20 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('runs pod install, if Podfile.lock is older than Podfile', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
await new Future<void>.delayed(const Duration(milliseconds: 10));
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..writeAsStringSync('Updated Podfile');
|
||||
await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: false,
|
||||
);
|
||||
@@ -433,17 +421,17 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('skips pod install, if nothing changed', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
final bool didInstall = await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: false,
|
||||
);
|
||||
@@ -459,13 +447,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
});
|
||||
|
||||
testUsingContext('a failed pod install deletes Pods/Manifest.lock', () async {
|
||||
projectUnderTest.childFile('Podfile')
|
||||
projectUnderTest.ios.podfile
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing Podfile');
|
||||
projectUnderTest.childFile('Podfile.lock')
|
||||
projectUnderTest.ios.podfileLock
|
||||
..createSync()
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
projectUnderTest.childFile('Pods/Manifest.lock')
|
||||
projectUnderTest.ios.podManifestLock
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('Existing lock file.');
|
||||
|
||||
@@ -482,13 +470,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
|
||||
|
||||
try {
|
||||
await cocoaPodsUnderTest.processPods(
|
||||
appIosDirectory: projectUnderTest,
|
||||
iosProject: projectUnderTest.ios,
|
||||
iosEngineDir: 'engine/path',
|
||||
dependenciesChanged: true,
|
||||
);
|
||||
fail('Tool throw expected when pod install fails');
|
||||
} on ToolExit {
|
||||
expect(projectUnderTest.childFile('Pods/Manifest.lock').existsSync(), isFalse);
|
||||
expect(projectUnderTest.ios.podManifestLock.existsSync(), isFalse);
|
||||
}
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
|
||||
@@ -289,11 +289,9 @@ Information about project "Runner":
|
||||
previewDart2: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('path/to/project').manifest;
|
||||
updateGeneratedXcodeProperties(
|
||||
projectPath: 'path/to/project',
|
||||
manifest: manifest,
|
||||
final FlutterProject project = new FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
buildInfo: buildInfo,
|
||||
previewDart2: true,
|
||||
);
|
||||
@@ -313,11 +311,9 @@ Information about project "Runner":
|
||||
trackWidgetCreation: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('path/to/project').manifest;
|
||||
updateGeneratedXcodeProperties(
|
||||
projectPath: 'path/to/project',
|
||||
manifest: manifest,
|
||||
final FlutterProject project = new FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
buildInfo: buildInfo,
|
||||
previewDart2: true,
|
||||
);
|
||||
@@ -336,11 +332,9 @@ Information about project "Runner":
|
||||
previewDart2: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('path/to/project').manifest;
|
||||
updateGeneratedXcodeProperties(
|
||||
projectPath: 'path/to/project',
|
||||
manifest: manifest,
|
||||
final FlutterProject project = new FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
buildInfo: buildInfo,
|
||||
previewDart2: true,
|
||||
);
|
||||
@@ -360,11 +354,9 @@ Information about project "Runner":
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('path/to/project').manifest;
|
||||
updateGeneratedXcodeProperties(
|
||||
projectPath: 'path/to/project',
|
||||
manifest: manifest,
|
||||
final FlutterProject project = new FlutterProject.fromPath('path/to/project');
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: project,
|
||||
buildInfo: buildInfo,
|
||||
previewDart2: true,
|
||||
);
|
||||
@@ -412,11 +404,8 @@ Information about project "Runner":
|
||||
const String schemaData = '{}';
|
||||
writeSchemaFile(fs, schemaData);
|
||||
|
||||
final FlutterManifest manifest =
|
||||
await new FlutterProject.fromPath('path/to/project').manifest;
|
||||
updateGeneratedXcodeProperties(
|
||||
projectPath: 'path/to/project',
|
||||
manifest: manifest,
|
||||
await updateGeneratedXcodeProperties(
|
||||
project: new FlutterProject.fromPath('path/to/project'),
|
||||
buildInfo: buildInfo,
|
||||
previewDart2: false,
|
||||
);
|
||||
|
||||
@@ -129,13 +129,6 @@ void testInMemory(String description, Future<Null> testMethod()) {
|
||||
);
|
||||
}
|
||||
|
||||
void addPubPackages(Directory directory) {
|
||||
directory.childFile('pubspec.yaml')
|
||||
..createSync(recursive: true);
|
||||
directory.childFile('.packages')
|
||||
..createSync(recursive: true);
|
||||
}
|
||||
|
||||
void addIosWithBundleId(Directory directory, String id) {
|
||||
directory
|
||||
.childDirectory('ios')
|
||||
|
||||
@@ -25,7 +25,7 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
|
||||
MockApplicationPackageStore() : super(
|
||||
android: new AndroidApk(
|
||||
id: 'io.flutter.android.mock',
|
||||
apkPath: '/mock/path/to/android/SkyShell.apk',
|
||||
file: fs.file('/mock/path/to/android/SkyShell.apk'),
|
||||
launchActivity: 'io.flutter.android.mock.MockActivity'
|
||||
),
|
||||
iOS: new BuildableIOSApp(
|
||||
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
|
||||
final FlutterTesterApp app = new FlutterTesterApp.fromCurrentDirectory();
|
||||
expect(app.name, 'my_project');
|
||||
expect(app.packagePath, fs.path.join(projectPath, '.packages'));
|
||||
expect(app.packagesFile.path, fs.path.join(projectPath, '.packages'));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user