Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
3c83c526
Unverified
Commit
3c83c526
authored
Aug 07, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Aug 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FlutterProject refactoring and test coverage (#20296)
parent
e60087a1
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
266 additions
and
143 deletions
+266
-143
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+8
-4
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+1
-21
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+3
-3
project.dart
packages/flutter_tools/lib/src/project.dart
+88
-87
project_test.dart
packages/flutter_tools/test/project_test.dart
+166
-28
No files found.
packages/flutter_tools/lib/src/android/gradle.dart
View file @
3c83c526
...
...
@@ -200,22 +200,26 @@ distributionUrl=https\\://services.gradle.org/distributions/gradle-$gradleVersio
}
}
/// Overwrite android/local.properties in the specified Flutter project, if needed.
/// Overwrite local.properties in the specified Flutter project's Android
/// sub-project, if needed.
///
/// Throws
, if `pubspec.yaml` or Android SDK cannot be locate
d.
/// Throws
tool exit, if `pubspec.yaml` is invali
d.
///
/// If [requireSdk] is `true` this will fail with a tool
-
exit if no Android Sdk
/// If [requireSdk] is `true` this will fail with a tool
exit if no Android Sdk
/// is found.
Future
<
void
>
updateLocalProperties
({
@required
FlutterProject
project
,
BuildInfo
buildInfo
,
bool
requireAndroidSdk
=
true
,
})
async
{
if
(
project
.
manifest
==
null
)
{
throwToolExit
(
'Invalid `pubspec.yaml`'
);
}
if
(
requireAndroidSdk
&&
androidSdk
==
null
)
{
throwToolExit
(
'Unable to locate Android SDK. Please run `flutter doctor` for more details.'
);
}
final
File
localProperties
=
project
.
android
L
ocalPropertiesFile
;
final
File
localProperties
=
project
.
android
.
l
ocalPropertiesFile
;
bool
changed
=
false
;
SettingsFile
settings
;
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
3c83c526
...
...
@@ -15,7 +15,6 @@ import '../base/process.dart';
import
'../base/process_manager.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../bundle.dart'
as
bundle
;
import
'../cache.dart'
;
import
'../flutter_manifest.dart'
;
import
'../globals.dart'
;
...
...
@@ -28,25 +27,6 @@ String flutterFrameworkDir(BuildMode mode) {
return
fs
.
path
.
normalize
(
fs
.
path
.
dirname
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
mode
)));
}
/// Writes default Xcode properties files in the Flutter project at [projectPath],
/// if project is an iOS project and such files are out of date or do not
/// already exist.
Future
<
void
>
generateXcodeProperties
({
FlutterProject
project
})
async
{
if
(
project
.
manifest
.
isModule
||
project
.
ios
.
directory
.
existsSync
())
{
if
(!
Cache
.
instance
.
fileOlderThanToolsStamp
(
project
.
generatedXcodePropertiesFile
))
{
return
;
}
await
updateGeneratedXcodeProperties
(
project:
project
,
buildInfo:
BuildInfo
.
debug
,
targetOverride:
bundle
.
defaultMainPath
,
previewDart2:
true
,
);
}
}
/// Writes or rewrites Xcode property files with the specified information.
///
/// targetOverride: Optional parameter, if null or unspecified the default value
...
...
@@ -119,7 +99,7 @@ Future<void> updateGeneratedXcodeProperties({
localsBuffer
.
writeln
(
'TRACK_WIDGET_CREATION=true'
);
}
final
File
generatedXcodePropertiesFile
=
project
.
generatedXcodePropertiesFile
;
final
File
generatedXcodePropertiesFile
=
project
.
ios
.
generatedXcodePropertiesFile
;
generatedXcodePropertiesFile
.
createSync
(
recursive:
true
);
generatedXcodePropertiesFile
.
writeAsStringSync
(
localsBuffer
.
toString
());
}
...
...
packages/flutter_tools/lib/src/plugins.dart
View file @
3c83c526
...
...
@@ -158,7 +158,7 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
};
final
String
javaSourcePath
=
fs
.
path
.
join
(
project
.
android
P
luginRegistrantHost
.
path
,
project
.
android
.
p
luginRegistrantHost
.
path
,
'src'
,
'main'
,
'java'
,
...
...
@@ -247,8 +247,8 @@ Future<void> _writeIOSPluginRegistrant(FlutterProject project, List<Plugin> plug
'plugins'
:
iosPlugins
,
};
final
String
registryDirectory
=
project
.
ios
P
luginRegistrantHost
.
path
;
if
(
project
.
manifest
.
isModule
)
{
final
String
registryDirectory
=
project
.
ios
.
p
luginRegistrantHost
.
path
;
if
(
project
.
isModule
)
{
final
String
registryClassesDirectory
=
fs
.
path
.
join
(
registryDirectory
,
'Classes'
);
_renderTemplateToFile
(
_iosPluginRegistrantPodspecTemplate
,
...
...
packages/flutter_tools/lib/src/project.dart
View file @
3c83c526
This diff is collapsed.
Click to expand it.
packages/flutter_tools/test/project_test.dart
View file @
3c83c526
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment