mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
flutter create: don't use relative paths in IDEA config files (#9414)
When invoked from the command line, relative paths aren't typically used, but they are when invoked from within IDEA and prevents IDEA from reading the files. Also, remove flutterPackagesDirectory since it's not used
This commit is contained in:
parent
a0369806f2
commit
cc3b91479c
@ -192,7 +192,6 @@ Host platform code is in the android/ and ios/ directories under $relativePlugin
|
|||||||
String projectDescription, String dirPath, String flutterRoot,
|
String projectDescription, String dirPath, String flutterRoot,
|
||||||
{ bool renderDriverTest: false, bool withPluginHook: false }) {
|
{ bool renderDriverTest: false, bool withPluginHook: false }) {
|
||||||
flutterRoot = fs.path.normalize(flutterRoot);
|
flutterRoot = fs.path.normalize(flutterRoot);
|
||||||
flutterRoot = _relativePath(from: dirPath, to: flutterRoot);
|
|
||||||
|
|
||||||
final String pluginDartClass = _createPluginClassName(projectName);
|
final String pluginDartClass = _createPluginClassName(projectName);
|
||||||
final String pluginClass = pluginDartClass.endsWith('Plugin')
|
final String pluginClass = pluginDartClass.endsWith('Plugin')
|
||||||
@ -205,7 +204,6 @@ Host platform code is in the android/ and ios/ directories under $relativePlugin
|
|||||||
'iosIdentifier': _createUTIIdentifier(projectName),
|
'iosIdentifier': _createUTIIdentifier(projectName),
|
||||||
'description': projectDescription,
|
'description': projectDescription,
|
||||||
'dartSdk': '$flutterRoot/bin/cache/dart-sdk',
|
'dartSdk': '$flutterRoot/bin/cache/dart-sdk',
|
||||||
'flutterPackagesDirectory': fs.path.join(flutterRoot, 'packages'),
|
|
||||||
'androidMinApiLevel': android.minApiLevel,
|
'androidMinApiLevel': android.minApiLevel,
|
||||||
'androidSdkVersion': android_sdk.minimumAndroidSdkVersion,
|
'androidSdkVersion': android_sdk.minimumAndroidSdkVersion,
|
||||||
'androidFlutterJar': "$flutterRoot/bin/cache/artifacts/engine/android-arm/flutter.jar",
|
'androidFlutterJar': "$flutterRoot/bin/cache/artifacts/engine/android-arm/flutter.jar",
|
||||||
@ -300,11 +298,3 @@ String _validateProjectDir(String dirPath, { String flutterRoot }) {
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String _relativePath({ String from, String to }) {
|
|
||||||
final String result = fs.path.relative(to, from: from);
|
|
||||||
// `fs.path.relative()` doesn't always return a correct result: dart-lang/path#12.
|
|
||||||
if (fs.isDirectorySync(fs.path.join(from, result)))
|
|
||||||
return result;
|
|
||||||
return to;
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user