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
63c65e5c
Unverified
Commit
63c65e5c
authored
Jan 15, 2020
by
Jonah Williams
Committed by
GitHub
Jan 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Clean up build_aot code post assemble migration (#48771)
parent
8092f6a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
101 deletions
+9
-101
aot.dart
packages/flutter_tools/lib/src/aot.dart
+8
-5
dart.dart
...ages/flutter_tools/lib/src/build_system/targets/dart.dart
+0
-26
assemble.dart
packages/flutter_tools/lib/src/commands/assemble.dart
+1
-3
build_aot_test.dart
...er_tools/test/commands.shard/hermetic/build_aot_test.dart
+0
-59
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+0
-8
No files found.
packages/flutter_tools/lib/src/aot.dart
View file @
63c65e5c
...
...
@@ -38,9 +38,13 @@ class AotBuilder {
if
(
platform
==
null
)
{
throwToolExit
(
'No AOT build platform specified'
);
}
// This code is currently dead, but will be updated as we move iOS to assemble.
// See also: https://github.com/flutter/flutter/issues/32925
if
(
_canUseAssemble
(
platform
)
&&
extraGenSnapshotOptions
?.
isEmpty
!=
false
&&
extraFrontEndOptions
?.
isEmpty
!=
false
)
{
assert
(
false
);
await
_buildWithAssemble
(
targetFile:
mainDartFile
,
outputDir:
outputPath
,
...
...
@@ -175,7 +179,6 @@ class AotBuilder {
case
TargetPlatform
.
android_arm64
:
case
TargetPlatform
.
android_x86
:
case
TargetPlatform
.
darwin_x64
:
return
true
;
case
TargetPlatform
.
android_x64
:
case
TargetPlatform
.
ios
:
case
TargetPlatform
.
linux_x64
:
...
...
@@ -196,6 +199,9 @@ class AotBuilder {
String
outputDir
,
bool
quiet
})
async
{
// This code is currently dead, but will be updated as we move iOS to assemble.
// See also: https://github.com/flutter/flutter/issues/32925
assert
(
false
);
Status
status
;
if
(!
quiet
)
{
final
String
typeName
=
globals
.
artifacts
.
getEngineType
(
targetPlatform
,
buildMode
);
...
...
@@ -205,10 +211,7 @@ class AotBuilder {
);
}
final
FlutterProject
flutterProject
=
FlutterProject
.
current
();
// Currently this only supports android, per the check above.
final
Target
target
=
buildMode
==
BuildMode
.
profile
?
const
ProfileCopyFlutterAotBundle
()
:
const
ReleaseCopyFlutterAotBundle
();
const
Target
target
=
null
;
final
BuildResult
result
=
await
buildSystem
.
build
(
target
,
Environment
.
test
(
flutterProject
.
directory
,
...
...
packages/flutter_tools/lib/src/build_system/targets/dart.dart
View file @
63c65e5c
...
...
@@ -359,32 +359,6 @@ abstract class CopyFlutterAotBundle extends Target {
}
}
// This is a one-off rule for implementing build aot in terms of assemble.
class
ProfileCopyFlutterAotBundle
extends
CopyFlutterAotBundle
{
const
ProfileCopyFlutterAotBundle
();
@override
String
get
name
=>
'profile_android_flutter_bundle'
;
@override
List
<
Target
>
get
dependencies
=>
const
<
Target
>[
AotElfProfile
(),
];
}
// This is a one-off rule for implementing build aot in terms of assemble.
class
ReleaseCopyFlutterAotBundle
extends
CopyFlutterAotBundle
{
const
ReleaseCopyFlutterAotBundle
();
@override
String
get
name
=>
'release_android_flutter_bundle'
;
@override
List
<
Target
>
get
dependencies
=>
const
<
Target
>[
AotElfRelease
(),
];
}
/// Dart defines are encoded inside [Environment] as a JSON array.
List
<
String
>
parseDartDefines
(
Environment
environment
)
{
if
(!
environment
.
defines
.
containsKey
(
kDartDefines
))
{
...
...
packages/flutter_tools/lib/src/commands/assemble.dart
View file @
63c65e5c
...
...
@@ -41,9 +41,7 @@ const List<Target> _kDefaultTargets = <Target>[
FastStartAndroidApplication
(),
ProfileAndroidApplication
(),
ReleaseAndroidApplication
(),
// These are one-off rules for bundle and aot compat
ReleaseCopyFlutterAotBundle
(),
ProfileCopyFlutterAotBundle
(),
// This is a one-off rule for bundle and aot compat.
CopyFlutterBundle
(),
// Android ABI specific AOT rules.
androidArmProfileBundle
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_aot_test.dart
deleted
100644 → 0
View file @
8092f6a2
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:flutter_tools/src/build_system/build_system.dart'
;
import
'package:flutter_tools/src/build_system/targets/dart.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:flutter_tools/src/commands/build.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'../../src/common.dart'
;
import
'../../src/mocks.dart'
;
import
'../../src/testbed.dart'
;
void
main
(
)
{
Testbed
testbed
;
setUpAll
(()
{
Cache
.
disableLocking
();
});
tearDownAll
(()
{
Cache
.
enableLocking
();
});
setUp
(()
{
testbed
=
Testbed
(
overrides:
<
Type
,
Generator
>{
BuildSystem:
()
=>
MockBuildSystem
(),
});
});
test
(
'invokes assemble for android aot build.'
,
()
=>
testbed
.
run
(()
async
{
globals
.
fs
.
file
(
'pubspec.yaml'
).
createSync
();
globals
.
fs
.
file
(
'.packages'
).
createSync
();
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
)).
createSync
(
recursive:
true
);
when
(
buildSystem
.
build
(
any
,
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
BuildResult
(
success:
true
);
});
final
BuildCommand
command
=
BuildCommand
();
applyMocksToCommand
(
command
);
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'build'
,
'aot'
,
'--target-platform=android-arm'
,
'--no-pub'
,
]);
final
Environment
environment
=
verify
(
buildSystem
.
build
(
any
,
captureAny
)).
captured
.
single
as
Environment
;
expect
(
environment
.
defines
,
<
String
,
String
>{
kTargetFile:
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
path
.
join
(
'lib'
,
'main.dart'
)),
kBuildMode:
'release'
,
kTargetPlatform:
'android-arm'
,
});
}));
}
class
MockBuildSystem
extends
Mock
implements
BuildSystem
{}
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
63c65e5c
...
...
@@ -404,14 +404,6 @@ flutter_tools:lib/''');
ProcessManager:
()
=>
mockProcessManager
,
}));
test
(
'Profile/ReleaseCopyFlutterAotBundle copies .so to correct output directory'
,
()
=>
testbed
.
run
(()
async
{
androidEnvironment
.
buildDir
.
createSync
(
recursive:
true
);
androidEnvironment
.
buildDir
.
childFile
(
'app.so'
).
createSync
();
await
const
ProfileCopyFlutterAotBundle
().
build
(
androidEnvironment
);
expect
(
androidEnvironment
.
outputDir
.
childFile
(
'app.so'
).
existsSync
(),
true
);
}));
test
(
'kExtraGenSnapshotOptions passes values to gen_snapshot'
,
()
=>
testbed
.
run
(()
async
{
androidEnvironment
.
defines
[
kExtraGenSnapshotOptions
]
=
'foo,bar,baz=2'
;
...
...
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