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
c6d46252
Unverified
Commit
c6d46252
authored
Nov 17, 2021
by
Danny Tuppeny
Committed by
GitHub
Nov 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure the flutter_gen project is correctly created as part of "flutter create" (#92975)
parent
09d08510
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
create_base.dart
packages/flutter_tools/lib/src/commands/create_base.dart
+24
-0
gen_l10n.dart
packages/flutter_tools/lib/src/localizations/gen_l10n.dart
+3
-1
create_test.dart
...tter_tools/test/commands.shard/permeable/create_test.dart
+2
-0
No files found.
packages/flutter_tools/lib/src/commands/create_base.dart
View file @
c6d46252
...
...
@@ -13,8 +13,11 @@ import '../android/gradle_utils.dart' as gradle;
import
'../base/common.dart'
;
import
'../base/file_system.dart'
;
import
'../base/utils.dart'
;
import
'../build_info.dart'
;
import
'../build_system/build_system.dart'
;
import
'../cache.dart'
;
import
'../convert.dart'
;
import
'../dart/generate_synthetic_packages.dart'
;
import
'../dart/pub.dart'
;
import
'../features.dart'
;
import
'../flutter_project_metadata.dart'
;
...
...
@@ -480,6 +483,27 @@ abstract class CreateBase extends FlutterCommand {
}
if
(
boolArg
(
'pub'
))
{
final
Environment
environment
=
Environment
(
artifacts:
globals
.
artifacts
,
logger:
globals
.
logger
,
cacheDir:
globals
.
cache
.
getRoot
(),
engineVersion:
globals
.
flutterVersion
.
engineRevision
,
fileSystem:
globals
.
fs
,
flutterRootDir:
globals
.
fs
.
directory
(
Cache
.
flutterRoot
),
outputDir:
globals
.
fs
.
directory
(
getBuildDirectory
()),
processManager:
globals
.
processManager
,
platform:
globals
.
platform
,
projectDir:
project
.
directory
,
generateDartPluginRegistry:
true
,
);
// Generate the l10n synthetic package that will be injected into the
// package_config in the call to pub.get() below.
await
generateLocalizationsSyntheticPackage
(
environment:
environment
,
buildSystem:
globals
.
buildSystem
,
);
await
pub
.
get
(
context:
PubContext
.
create
,
directory:
directory
.
path
,
...
...
packages/flutter_tools/lib/src/localizations/gen_l10n.dart
View file @
c6d46252
...
...
@@ -1291,7 +1291,9 @@ class LocalizationsGenerator {
// A pubspec.yaml file is required when using a synthetic package. If it does not
// exist, create a blank one.
if
(
useSyntheticPackage
)
{
final
Directory
syntheticPackageDirectory
=
_fs
.
directory
(
_defaultSyntheticPackagePath
(
_fs
));
final
Directory
syntheticPackageDirectory
=
projectDirectory
!=
null
?
projectDirectory
!.
childDirectory
(
_defaultSyntheticPackagePath
(
_fs
))
:
_fs
.
directory
(
_defaultSyntheticPackagePath
(
_fs
));
syntheticPackageDirectory
.
createSync
(
recursive:
true
);
final
File
flutterGenPubspec
=
syntheticPackageDirectory
.
childFile
(
'pubspec.yaml'
);
if
(!
flutterGenPubspec
.
existsSync
())
{
...
...
packages/flutter_tools/test/commands.shard/permeable/create_test.dart
View file @
c6d46252
...
...
@@ -147,6 +147,8 @@ void main() {
projectDir
,
<
String
>[
'-t'
,
'skeleton'
,
'-i'
,
'objc'
,
'-a'
,
'java'
,
'--implementation-tests'
],
<
String
>[
'.dart_tool/flutter_gen/pubspec.yaml'
,
'.dart_tool/flutter_gen/gen_l10n/app_localizations.dart'
,
'analysis_options.yaml'
,
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
...
...
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