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
44c284ba
Unverified
Commit
44c284ba
authored
Apr 22, 2021
by
Jonah Williams
Committed by
GitHub
Apr 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] output release artifacts to build/winuwp (#80137)
parent
24f0d285
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
110 additions
and
10 deletions
+110
-10
windows.dart
...s/flutter_tools/lib/src/build_system/targets/windows.dart
+54
-8
windows_test.dart
...test/general.shard/build_system/targets/windows_test.dart
+56
-2
No files found.
packages/flutter_tools/lib/src/build_system/targets/windows.dart
View file @
44c284ba
...
...
@@ -4,6 +4,8 @@
// @dart = 2.8
import
'package:meta/meta.dart'
;
import
'../../artifacts.dart'
;
import
'../../base/file_system.dart'
;
import
'../../build_info.dart'
;
...
...
@@ -253,13 +255,57 @@ abstract class BundleWindowsAssetsUwp extends BundleWindowsAssets {
/// A wrapper for AOT compilation that copies app.so into the output directory.
class
WindowsAotBundle
extends
Target
{
/// Create a [WindowsAotBundle] wrapper for [aotTarget].
const
WindowsAotBundle
(
this
.
aotTarget
);
const
WindowsAotBundle
(
this
.
aotTarget
,
{
@required
this
.
uwp
});
/// The [AotElfBase] subclass that produces the app.so.
final
AotElfBase
aotTarget
;
/// Whether this is the UWP target.
final
bool
uwp
;
@override
String
get
name
=>
uwp
?
'windows_uwp_aot_bundle'
:
'windows_aot_bundle'
;
@override
List
<
Source
>
get
inputs
=>
const
<
Source
>[
Source
.
pattern
(
'{BUILD_DIR}/app.so'
),
];
@override
List
<
Source
>
get
outputs
=>
uwp
?
const
<
Source
>[
Source
.
pattern
(
'{OUTPUT_DIR}/winuwp/app.so'
),
]
:
const
<
Source
>[
Source
.
pattern
(
'{OUTPUT_DIR}/windows/app.so'
),
];
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[
aotTarget
,
];
@override
Future
<
void
>
build
(
Environment
environment
)
async
{
final
File
outputFile
=
environment
.
buildDir
.
childFile
(
'app.so'
);
final
Directory
outputDirectory
=
environment
.
outputDir
.
childDirectory
(
uwp
?
'winuwp'
:
'windows'
);
if
(!
outputDirectory
.
existsSync
())
{
outputDirectory
.
createSync
(
recursive:
true
);
}
outputFile
.
copySync
(
outputDirectory
.
childFile
(
'app.so'
).
path
);
}
}
/// A wrapper for AOT compilation that copies app.so into the output directory.
class
WindowsUwpAotBundle
extends
Target
{
/// Create a [WindowsAotBundle] wrapper for [aotTarget].
const
WindowsUwpAotBundle
(
this
.
aotTarget
);
/// The [AotElfBase] subclass that produces the app.so.
final
AotElfBase
aotTarget
;
@override
String
get
name
=>
'windows_aot_bundle'
;
String
get
name
=>
'windows_
uwp_
aot_bundle'
;
@override
List
<
Source
>
get
inputs
=>
const
<
Source
>[
...
...
@@ -268,7 +314,7 @@ class WindowsAotBundle extends Target {
@override
List
<
Source
>
get
outputs
=>
const
<
Source
>[
Source
.
pattern
(
'{OUTPUT_DIR}/win
dows
/app.so'
),
Source
.
pattern
(
'{OUTPUT_DIR}/win
uwp
/app.so'
),
];
@override
...
...
@@ -279,7 +325,7 @@ class WindowsAotBundle extends Target {
@override
Future
<
void
>
build
(
Environment
environment
)
async
{
final
File
outputFile
=
environment
.
buildDir
.
childFile
(
'app.so'
);
final
Directory
outputDirectory
=
environment
.
outputDir
.
childDirectory
(
'win
dows
'
);
final
Directory
outputDirectory
=
environment
.
outputDir
.
childDirectory
(
'win
uwp
'
);
if
(!
outputDirectory
.
existsSync
())
{
outputDirectory
.
createSync
(
recursive:
true
);
}
...
...
@@ -299,7 +345,7 @@ class ReleaseBundleWindowsAssets extends BundleWindowsAssets {
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[
...
super
.
dependencies
,
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_x64
)),
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_x64
)
,
uwp:
false
),
];
}
...
...
@@ -315,7 +361,7 @@ class ProfileBundleWindowsAssets extends BundleWindowsAssets {
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[
...
super
.
dependencies
,
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_x64
)),
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_x64
)
,
uwp:
false
),
];
}
...
...
@@ -348,7 +394,7 @@ class ReleaseBundleWindowsAssetsUwp extends BundleWindowsAssetsUwp {
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[
...
super
.
dependencies
,
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_uwp_x64
)),
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_uwp_x64
)
,
uwp:
true
),
];
}
...
...
@@ -364,7 +410,7 @@ class ProfileBundleWindowsAssetsUwp extends BundleWindowsAssetsUwp {
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[
...
super
.
dependencies
,
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_uwp_x64
)),
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_uwp_x64
)
,
uwp:
true
),
];
}
...
...
packages/flutter_tools/test/general.shard/build_system/targets/windows_test.dart
View file @
44c284ba
...
...
@@ -289,7 +289,7 @@ void main() {
environment
.
buildDir
.
childFile
(
'app.so'
).
createSync
(
recursive:
true
);
await
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_x64
)).
build
(
environment
);
await
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_x64
)
,
uwp:
false
).
build
(
environment
);
await
const
ProfileBundleWindowsAssets
().
build
(
environment
);
// Depfile is created and so is copied.
...
...
@@ -302,6 +302,60 @@ void main() {
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'ReleaseBundleWindowsAssets creates correct bundle structure with UWP'
,
()
async
{
final
Environment
environment
=
Environment
.
test
(
fileSystem
.
currentDirectory
,
artifacts:
Artifacts
.
test
(),
processManager:
FakeProcessManager
.
any
(),
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
defines:
<
String
,
String
>{
kBuildMode:
'release'
,
}
);
environment
.
buildDir
.
childFile
(
'app.so'
).
createSync
(
recursive:
true
);
await
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_x64
),
uwp:
true
).
build
(
environment
);
await
const
ReleaseBundleWindowsAssets
().
build
(
environment
);
// Depfile is created and so is copied.
expect
(
environment
.
buildDir
.
childFile
(
'flutter_assets.d'
),
exists
);
expect
(
fileSystem
.
file
(
r'C:\winuwp\app.so'
),
exists
);
expect
(
fileSystem
.
file
(
r'C:\flutter_assets\kernel_blob.bin'
).
existsSync
(),
false
);
expect
(
fileSystem
.
file
(
r'C:\flutter_assets\AssetManifest.json'
),
exists
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'ProfileBundleWindowsAssets creates correct bundle structure with UWP'
,
()
async
{
final
Environment
environment
=
Environment
.
test
(
fileSystem
.
currentDirectory
,
artifacts:
Artifacts
.
test
(),
processManager:
FakeProcessManager
.
any
(),
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
defines:
<
String
,
String
>{
kBuildMode:
'profile'
,
}
);
environment
.
buildDir
.
childFile
(
'app.so'
).
createSync
(
recursive:
true
);
await
const
WindowsAotBundle
(
AotElfProfile
(
TargetPlatform
.
windows_x64
),
uwp:
true
).
build
(
environment
);
await
const
ProfileBundleWindowsAssets
().
build
(
environment
);
// Depfile is created and so is copied.
expect
(
environment
.
buildDir
.
childFile
(
'flutter_assets.d'
),
exists
);
expect
(
fileSystem
.
file
(
r'C:\winuwp\app.so'
),
exists
);
expect
(
fileSystem
.
file
(
r'C:\flutter_assets\kernel_blob.bin'
).
existsSync
(),
false
);
expect
(
fileSystem
.
file
(
r'C:\flutter_assets\AssetManifest.json'
),
exists
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'ReleaseBundleWindowsAssets creates correct bundle structure'
,
()
async
{
final
Environment
environment
=
Environment
.
test
(
fileSystem
.
currentDirectory
,
...
...
@@ -316,7 +370,7 @@ void main() {
environment
.
buildDir
.
childFile
(
'app.so'
).
createSync
(
recursive:
true
);
await
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_x64
)).
build
(
environment
);
await
const
WindowsAotBundle
(
AotElfRelease
(
TargetPlatform
.
windows_x64
)
,
uwp:
false
).
build
(
environment
);
await
const
ReleaseBundleWindowsAssets
().
build
(
environment
);
// Depfile is created and so is copied.
...
...
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