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
6ccd9939
Unverified
Commit
6ccd9939
authored
Apr 12, 2022
by
Jenn Magder
Committed by
GitHub
Apr 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add `flutter build ipa --no-codesign` flag (#101766)
parent
d4bfb013
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
14 deletions
+57
-14
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+14
-14
build_ipa_test.dart
...er_tools/test/commands.shard/hermetic/build_ipa_test.dart
+43
-0
No files found.
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
6ccd9939
...
@@ -31,10 +31,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
...
@@ -31,10 +31,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
..
addFlag
(
'simulator'
,
..
addFlag
(
'simulator'
,
help:
'Build for the iOS simulator instead of the device. This changes '
help:
'Build for the iOS simulator instead of the device. This changes '
'the default build mode to debug if otherwise unspecified.'
,
'the default build mode to debug if otherwise unspecified.'
,
)
..
addFlag
(
'codesign'
,
defaultsTo:
true
,
help:
'Codesign the application bundle (only available on device builds).'
,
);
);
}
}
...
@@ -53,9 +49,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
...
@@ -53,9 +49,6 @@ class BuildIOSCommand extends _BuildIOSSubCommand {
@override
@override
bool
get
configOnly
=>
boolArg
(
'config-only'
);
bool
get
configOnly
=>
boolArg
(
'config-only'
);
@override
bool
get
shouldCodesign
=>
boolArg
(
'codesign'
);
@override
@override
Directory
_outputAppDirectory
(
String
xcodeResultOutput
)
=>
globals
.
fs
.
directory
(
xcodeResultOutput
).
parent
;
Directory
_outputAppDirectory
(
String
xcodeResultOutput
)
=>
globals
.
fs
.
directory
(
xcodeResultOutput
).
parent
;
}
}
...
@@ -105,9 +98,6 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
...
@@ -105,9 +98,6 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
@override
@override
final
bool
configOnly
=
false
;
final
bool
configOnly
=
false
;
@override
final
bool
shouldCodesign
=
true
;
String
?
get
exportOptionsPlist
=>
stringArg
(
'export-options-plist'
);
String
?
get
exportOptionsPlist
=>
stringArg
(
'export-options-plist'
);
@override
@override
...
@@ -141,13 +131,18 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
...
@@ -141,13 +131,18 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
final
FlutterCommandResult
xcarchiveResult
=
await
super
.
runCommand
();
final
BuildInfo
buildInfo
=
await
cachedBuildInfo
;
final
BuildInfo
buildInfo
=
await
getBuildInfo
();
displayNullSafetyMode
(
buildInfo
);
displayNullSafetyMode
(
buildInfo
);
final
FlutterCommandResult
xcarchiveResult
=
await
super
.
runCommand
();
// xcarchive failed or not at expected location.
// xcarchive failed or not at expected location.
if
(
xcarchiveResult
.
exitStatus
!=
ExitStatus
.
success
)
{
if
(
xcarchiveResult
.
exitStatus
!=
ExitStatus
.
success
)
{
globals
.
printStatus
(
'Skipping IPA'
);
globals
.
printStatus
(
'Skipping IPA.'
);
return
xcarchiveResult
;
}
if
(!
shouldCodesign
)
{
globals
.
printStatus
(
'Codesigning disabled with --no-codesign, skipping IPA.'
);
return
xcarchiveResult
;
return
xcarchiveResult
;
}
}
...
@@ -291,6 +286,10 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
...
@@ -291,6 +286,10 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
addBundleSkSLPathOption
(
hide:
!
verboseHelp
);
addBundleSkSLPathOption
(
hide:
!
verboseHelp
);
addNullSafetyModeOptions
(
hide:
!
verboseHelp
);
addNullSafetyModeOptions
(
hide:
!
verboseHelp
);
usesAnalyzeSizeFlag
();
usesAnalyzeSizeFlag
();
argParser
.
addFlag
(
'codesign'
,
defaultsTo:
true
,
help:
'Codesign the application bundle (only available on device builds).'
,
);
}
}
@override
@override
...
@@ -305,7 +304,8 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
...
@@ -305,7 +304,8 @@ abstract class _BuildIOSSubCommand extends BuildSubCommand {
XcodeBuildResult
?
xcodeBuildResult
;
XcodeBuildResult
?
xcodeBuildResult
;
EnvironmentType
get
environmentType
;
EnvironmentType
get
environmentType
;
bool
get
configOnly
;
bool
get
configOnly
;
bool
get
shouldCodesign
;
bool
get
shouldCodesign
=>
boolArg
(
'codesign'
);
late
final
Future
<
BuildInfo
>
cachedBuildInfo
=
getBuildInfo
();
late
final
Future
<
BuildInfo
>
cachedBuildInfo
=
getBuildInfo
();
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart
View file @
6ccd9939
...
@@ -501,6 +501,49 @@ void main() {
...
@@ -501,6 +501,49 @@ void main() {
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(),
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(),
});
});
testUsingContext
(
'ipa build --no-codesign skips codesigning and IPA creation'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
fakeProcessManager
.
addCommands
(<
FakeCommand
>[
xattrCommand
,
const
FakeCommand
(
command:
<
String
>[
'xcrun'
,
'xcodebuild'
,
'-configuration'
,
'Release'
,
'-quiet'
,
'-workspace'
,
'Runner.xcworkspace'
,
'-scheme'
,
'Runner'
,
'-sdk'
,
'iphoneos'
,
'-destination'
,
'generic/platform=iOS'
,
'CODE_SIGNING_ALLOWED=NO'
,
'CODE_SIGNING_REQUIRED=NO'
,
'CODE_SIGNING_IDENTITY=""'
,
'-resultBundlePath'
,
'/.tmp_rand0/flutter_ios_build_temp_dirrand0/temporary_xcresult_bundle'
,
'-resultBundleVersion'
,
'3'
,
'FLUTTER_SUPPRESS_ANALYTICS=true'
,
'COMPILER_INDEX_STORE_ENABLE=NO'
,
'-archivePath'
,
'/build/ios/archive/Runner'
,
'archive'
,
],
),
]);
_createMinimalMockProjectFiles
();
await
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'ipa'
,
'--no-pub'
,
'--no-codesign'
]
);
expect
(
fakeProcessManager
,
hasNoRemainingExpectations
);
expect
(
testLogger
.
statusText
,
contains
(
'Codesigning disabled with --no-codesign, skipping IPA'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
fakeProcessManager
,
Platform:
()
=>
macosPlatform
,
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(),
});
testUsingContext
(
'code size analysis fails when app not found'
,
()
async
{
testUsingContext
(
'code size analysis fails when app not found'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
final
BuildCommand
command
=
BuildCommand
();
_createMinimalMockProjectFiles
();
_createMinimalMockProjectFiles
();
...
...
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