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
50474b29
Unverified
Commit
50474b29
authored
Jul 26, 2022
by
Jenn Magder
Committed by
GitHub
Jul 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only run `pod install` on the first iOS build (#108205)
parent
70aaff12
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
16 deletions
+50
-16
fingerprint.dart
packages/flutter_tools/lib/src/base/fingerprint.dart
+3
-1
cocoapod_utils.dart
packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
+0
-1
fingerprint_test.dart
...utter_tools/test/general.shard/base/fingerprint_test.dart
+8
-3
build_ios_config_only_test.dart
...ls/test/integration.shard/build_ios_config_only_test.dart
+39
-11
No files found.
packages/flutter_tools/lib/src/base/fingerprint.dart
View file @
50474b29
...
...
@@ -62,7 +62,9 @@ class Fingerprinter {
void
writeFingerprint
()
{
try
{
final
Fingerprint
fingerprint
=
buildFingerprint
();
_fileSystem
.
file
(
fingerprintPath
).
writeAsStringSync
(
fingerprint
.
toJson
());
final
File
fingerprintFile
=
_fileSystem
.
file
(
fingerprintPath
);
fingerprintFile
.
createSync
(
recursive:
true
);
fingerprintFile
.
writeAsStringSync
(
fingerprint
.
toJson
());
}
on
Exception
catch
(
e
)
{
// Log exception and continue, fingerprinting is only a performance improvement.
_logger
.
printTrace
(
'Fingerprint write error:
$e
'
);
...
...
packages/flutter_tools/lib/src/macos/cocoapod_utils.dart
View file @
50474b29
...
...
@@ -28,7 +28,6 @@ Future<void> processPodsIfNeeded(
paths:
<
String
>[
xcodeProject
.
xcodeProjectInfoFile
.
path
,
xcodeProject
.
podfile
.
path
,
xcodeProject
.
generatedXcodePropertiesFile
.
path
,
globals
.
fs
.
path
.
join
(
Cache
.
flutterRoot
!,
'packages'
,
...
...
packages/flutter_tools/test/general.shard/base/fingerprint_test.dart
View file @
50474b29
...
...
@@ -5,6 +5,7 @@
import
'dart:convert'
show
json
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/fingerprint.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/utils.dart'
;
...
...
@@ -57,29 +58,33 @@ void main() {
);
expect
(
fingerprinter
.
doesFingerprintMatch
(),
isFalse
);
});
testWithoutContext
(
'fingerprint does match if identical'
,
()
{
fileSystem
.
file
(
'a.dart'
).
createSync
();
fileSystem
.
file
(
'b.dart'
).
createSync
();
const
String
fingerprintPath
=
'path/to/out.fingerprint'
;
final
Fingerprinter
fingerprinter
=
Fingerprinter
(
fingerprintPath:
'out.fingerprint'
,
fingerprintPath:
fingerprintPath
,
paths:
<
String
>[
'a.dart'
,
'b.dart'
],
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
);
fingerprinter
.
writeFingerprint
();
expect
(
fingerprinter
.
doesFingerprintMatch
(),
isTrue
);
expect
(
fileSystem
.
file
(
fingerprintPath
),
exists
);
});
testWithoutContext
(
'fails to write fingerprint if inputs are missing'
,
()
{
const
String
fingerprintPath
=
'path/to/out.fingerprint'
;
final
Fingerprinter
fingerprinter
=
Fingerprinter
(
fingerprintPath:
'out.fingerprint'
,
fingerprintPath:
fingerprintPath
,
paths:
<
String
>[
'a.dart'
],
fileSystem:
fileSystem
,
logger:
BufferLogger
.
test
(),
);
fingerprinter
.
writeFingerprint
();
expect
(
fileSystem
.
file
(
'out.fingerprint'
).
existsSync
(),
isFalse
);
expect
(
fileSystem
.
file
(
fingerprintPath
),
isNot
(
exists
)
);
});
group
(
'Fingerprint'
,
()
{
...
...
packages/flutter_tools/test/integration.shard/build_ios_config_only_test.dart
View file @
50474b29
...
...
@@ -11,15 +11,20 @@ import 'test_utils.dart';
void
main
(
)
{
test
(
'flutter build ios --config only updates generated xcconfig file without performing build'
,
()
async
{
final
String
workingDirectory
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'examples'
,
'hello_world'
);
final
String
workingDirectory
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'dev'
,
'integration_tests'
,
'flutter_gallery'
,
);
final
String
flutterBin
=
fileSystem
.
path
.
join
(
getFlutterRoot
(),
'bin'
,
'flutter'
);
await
processManager
.
run
(<
String
>[
flutterBin
,
...
getLocalEngineArguments
(),
...
getLocalEngineArguments
(),
'clean'
,
],
workingDirectory:
workingDirectory
);
final
ProcessResult
result
=
await
processManager
.
run
(
<
String
>[
final
List
<
String
>
buildCommand
=
<
String
>[
flutterBin
,
...
getLocalEngineArguments
(),
'build'
,
...
...
@@ -29,25 +34,48 @@ void main() {
'--obfuscate'
,
'--split-debug-info=info'
,
'--no-codesign'
,
],
workingDirectory:
workingDirectory
);
];
final
ProcessResult
firstRunResult
=
await
processManager
.
run
(
buildCommand
,
workingDirectory:
workingDirectory
);
printOnFailure
(
'Output of flutter build ios:'
);
printOnFailure
(
result
.
stdout
.
toString
());
printOnFailure
(
result
.
stderr
.
toString
());
final
String
firstRunStdout
=
firstRunResult
.
stdout
.
toString
();
printOnFailure
(
'First run stdout:
$firstRunStdout
'
);
printOnFailure
(
'First run stderr:
${firstRunResult.stderr.toString()}
'
);
expect
(
result
.
exitCode
,
0
);
expect
(
firstRunResult
.
exitCode
,
0
);
expect
(
firstRunStdout
,
contains
(
'Running pod install'
));
final
File
generatedConfig
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
workingDirectory
,
'ios'
,
'Flutter'
,
'Generated.xcconfig'
));
final
File
generatedConfig
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
workingDirectory
,
'ios'
,
'Flutter'
,
'Generated.xcconfig'
,
));
// Config is updated if command succeeded.
expect
(
generatedConfig
,
exists
);
expect
(
generatedConfig
.
readAsStringSync
(),
contains
(
'DART_OBFUSCATION=true'
));
// file that only exists if app was fully built.
final
File
frameworkPlist
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
workingDirectory
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
'AppFrameworkInfo.plist'
));
final
File
frameworkPlist
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
workingDirectory
,
'build'
,
'ios'
,
'iphoneos'
,
'Runner.app'
,
'AppFrameworkInfo.plist'
,
));
expect
(
frameworkPlist
,
isNot
(
exists
));
// Run again with no changes.
final
ProcessResult
secondRunResult
=
await
processManager
.
run
(
buildCommand
,
workingDirectory:
workingDirectory
);
final
String
secondRunStdout
=
secondRunResult
.
stdout
.
toString
();
printOnFailure
(
'Second run stdout:
$secondRunStdout
'
);
printOnFailure
(
'Second run stderr:
${secondRunResult.stderr.toString()}
'
);
expect
(
secondRunResult
.
exitCode
,
0
);
// Do not run "pod install" when nothing changes.
expect
(
secondRunStdout
,
isNot
(
contains
(
'pod install'
)));
},
skip:
!
platform
.
isMacOS
);
// [intended] iOS builds only work on macos.
}
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