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
d6857bc0
Unverified
Commit
d6857bc0
authored
Dec 17, 2020
by
Jenn Magder
Committed by
GitHub
Dec 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build/copy macOS frameworks to built products instead of ephemeral directory (#72378)
parent
becf09c5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
115 deletions
+28
-115
project.pbxproj
...ks/macrobenchmarks/macos/Runner.xcodeproj/project.pbxproj
+0
-12
project.pbxproj
...ts/flutter_gallery/macos/Runner.xcodeproj/project.pbxproj
+0
-12
project.pbxproj
...tegration_tests/ui/macos/Runner.xcodeproj/project.pbxproj
+0
-12
project.pbxproj
dev/manual_tests/macos/Runner.xcodeproj/project.pbxproj
+0
-12
macos_assemble.sh
packages/flutter_tools/bin/macos_assemble.sh
+3
-5
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+15
-35
project.pbxproj.tmpl
...ates/app/macos.tmpl/Runner.xcodeproj/project.pbxproj.tmpl
+0
-12
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+10
-15
No files found.
dev/benchmarks/macrobenchmarks/macos/Runner.xcodeproj/project.pbxproj
View file @
d6857bc0
...
...
@@ -416,10 +416,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -546,10 +542,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -570,10 +562,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/Release.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
dev/integration_tests/flutter_gallery/macos/Runner.xcodeproj/project.pbxproj
View file @
d6857bc0
...
...
@@ -421,10 +421,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -551,10 +547,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -575,10 +567,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/Release.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
dev/integration_tests/ui/macos/Runner.xcodeproj/project.pbxproj
View file @
d6857bc0
...
...
@@ -361,10 +361,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -491,10 +487,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -515,10 +507,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/Release.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
dev/manual_tests/macos/Runner.xcodeproj/project.pbxproj
View file @
d6857bc0
...
...
@@ -361,10 +361,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -491,10 +487,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/DebugProfile.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -515,10 +507,6 @@
CODE_SIGN_ENTITLEMENTS
=
Runner/Release.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
COMBINE_HIDPI_IMAGES
=
YES
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter/ephemeral"
,
);
INFOPLIST_FILE
=
Runner/Info.plist
;
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
packages/flutter_tools/bin/macos_assemble.sh
View file @
d6857bc0
...
...
@@ -98,26 +98,24 @@ BuildApp() {
--ExtraFrontEndOptions
=
"
${
EXTRA_FRONT_END_OPTIONS
}
"
\
--build-inputs
=
"
${
build_inputs_path
}
"
\
--build-outputs
=
"
${
build_outputs_path
}
"
\
--output
=
"
${
ephemeral_dir
}
"
\
--output
=
"
${
BUILT_PRODUCTS_DIR
}
"
\
"
${
build_mode
}
_macos_bundle_flutter_assets"
}
# Adds the App.framework as an embedded binary and the flutter_assets as
# resources.
EmbedFrameworks
()
{
local
ephemeral_dir
=
"
${
SOURCE_ROOT
}
/Flutter/ephemeral"
# Embed App.framework from Flutter into the app (after creating the Frameworks directory
# if it doesn't already exist).
local
xcode_frameworks_dir
=
"
${
TARGET_BUILD_DIR
}
/
${
FRAMEWORKS_FOLDER_PATH
}
"
RunCommand
mkdir
-p
--
"
${
xcode_frameworks_dir
}
"
RunCommand rsync
-av
--delete
--filter
"- .DS_Store/"
"
${
ephemeral_dir
}
/App.framework"
"
${
xcode_frameworks_dir
}
"
RunCommand rsync
-av
--delete
--filter
"- .DS_Store/"
"
${
BUILT_PRODUCTS_DIR
}
/App.framework"
"
${
xcode_frameworks_dir
}
"
# Embed the actual FlutterMacOS.framework that the Flutter app expects to run against,
# which could be a local build or an arch/type specific build.
# Copy Xcode behavior and don't copy over headers or modules.
RunCommand rsync
-av
--delete
--filter
"- .DS_Store/"
--filter
"- Headers/"
--filter
"- Modules/"
"
${
ephemeral_dir
}
/FlutterMacOS.framework"
"
${
xcode_frameworks_dir
}
/"
RunCommand rsync
-av
--delete
--filter
"- .DS_Store/"
--filter
"- Headers/"
--filter
"- Modules/"
"
${
BUILT_PRODUCTS_DIR
}
/FlutterMacOS.framework"
"
${
xcode_frameworks_dir
}
/"
# Sign the binaries we moved.
if
[[
-n
"
${
EXPANDED_CODE_SIGN_IDENTITY
:-}
"
]]
;
then
...
...
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
d6857bc0
...
...
@@ -16,15 +16,12 @@ import 'assets.dart';
import
'common.dart'
;
import
'icon_tree_shaker.dart'
;
/// Copy the macOS framework to the correct copy dir by invoking '
cp -R
'.
/// Copy the macOS framework to the correct copy dir by invoking '
rsync
'.
///
/// This class is abstract to share logic between the three concrete
/// implementations. The shelling out is done to avoid complications with
/// preserving special files (e.g., symbolic links) in the framework structure.
///
/// Removes any previous version of the framework that already exists in the
/// target directory.
///
/// The real implementations are:
/// * [DebugUnpackMacOS]
/// * [ProfileUnpackMacOS]
...
...
@@ -38,14 +35,13 @@ abstract class UnpackMacOS extends Target {
];
@override
List
<
Source
>
get
outputs
=>
const
<
Source
>[];
List
<
Source
>
get
outputs
=>
const
<
Source
>[
Source
.
pattern
(
'{OUTPUT_DIR}/FlutterMacOS.framework/FlutterMacOS'
),
];
@override
List
<
Target
>
get
dependencies
=>
<
Target
>[];
@override
List
<
String
>
get
depfiles
=>
const
<
String
>[
'unpack_macos.d'
];
@override
Future
<
void
>
build
(
Environment
environment
)
async
{
if
(
environment
.
defines
[
kBuildMode
]
==
null
)
{
...
...
@@ -53,38 +49,22 @@ abstract class UnpackMacOS extends Target {
}
final
BuildMode
buildMode
=
getBuildModeForName
(
environment
.
defines
[
kBuildMode
]);
final
String
basePath
=
environment
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterMacOSFramework
,
mode:
buildMode
);
final
Directory
targetDirectory
=
environment
.
outputDir
.
childDirectory
(
'FlutterMacOS.framework'
);
// Deleting this directory is required or else the FlutterMacOS module
// cannot be found.
if
(
targetDirectory
.
existsSync
())
{
targetDirectory
.
deleteSync
(
recursive:
true
);
}
final
List
<
File
>
inputs
=
environment
.
fileSystem
.
directory
(
basePath
)
.
listSync
(
recursive:
true
)
.
whereType
<
File
>()
.
toList
();
final
List
<
File
>
outputs
=
inputs
.
map
((
File
file
)
{
final
String
relativePath
=
environment
.
fileSystem
.
path
.
relative
(
file
.
path
,
from:
basePath
);
return
environment
.
fileSystem
.
file
(
environment
.
fileSystem
.
path
.
join
(
targetDirectory
.
path
,
relativePath
));
}).
toList
();
final
ProcessResult
result
=
await
environment
.
processManager
.
run
(<
String
>[
'cp'
,
'-R'
,
basePath
,
targetDirectory
.
path
]);
final
ProcessResult
result
=
environment
.
processManager
.
runSync
(<
String
>[
'rsync'
,
'-av'
,
'--delete'
,
'--filter'
,
'- .DS_Store/'
,
basePath
,
environment
.
outputDir
.
path
,
]);
if
(
result
.
exitCode
!=
0
)
{
throw
Exception
(
'Failed to copy framework (exit
${result.exitCode}
:
\n
'
'
${result.stdout}
\n
---
\n
${result.stderr}
'
,
);
}
final
DepfileService
depfileService
=
DepfileService
(
logger:
environment
.
logger
,
fileSystem:
environment
.
fileSystem
,
);
depfileService
.
writeToFile
(
Depfile
(
inputs
,
outputs
),
environment
.
buildDir
.
childFile
(
'unpack_macos.d'
),
);
}
}
...
...
packages/flutter_tools/templates/app/macos.tmpl/Runner.xcodeproj/project.pbxproj.tmpl
View file @
d6857bc0
...
...
@@ -361,10 +361,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -491,10 +487,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
@@ -515,10 +507,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
d6857bc0
...
...
@@ -44,13 +44,17 @@ void main() {
});
testUsingContext
(
'Copies files to correct cache directory'
,
()
async
{
final
Directory
outputDir
=
fileSystem
.
directory
(
'output'
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
FakeCommand
(
command:
<
String
>[
'cp'
,
'-R'
,
'rsync'
,
'-av'
,
'--delete'
,
'--filter'
,
'- .DS_Store/'
,
'Artifact.flutterMacOSFramework.debug'
,
'/FlutterMacOS.framework'
,
outputDir
.
path
,
],
),
]);
...
...
@@ -65,19 +69,10 @@ void main() {
processManager:
processManager
,
logger:
BufferLogger
.
test
(),
fileSystem:
fileSystem
,
engineVersion:
'2'
engineVersion:
'2'
,
outputDir:
outputDir
,
);
final
Directory
cacheDirectory
=
fileSystem
.
directory
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterMacOSFramework
,
mode:
BuildMode
.
debug
,
))
..
createSync
();
cacheDirectory
.
childFile
(
'dummy'
).
createSync
();
environment
.
buildDir
.
createSync
(
recursive:
true
);
environment
.
outputDir
.
createSync
(
recursive:
true
);
await
const
DebugUnpackMacOS
().
build
(
environment
);
expect
(
processManager
.
hasRemainingExpectations
,
false
);
...
...
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