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
66e10061
Commit
66e10061
authored
Mar 25, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Xcodebuild takes an extra parameter for the build directory.
parent
3f9dcfe1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
build_ios.dart
packages/flutter_tools/lib/src/commands/build_ios.dart
+12
-3
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+17
-2
No files found.
packages/flutter_tools/lib/src/commands/build_ios.dart
View file @
66e10061
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:io'
;
import
'../application_package.dart'
;
import
'../build_configuration.dart'
;
...
...
@@ -10,6 +11,8 @@ import '../globals.dart';
import
'../ios/mac.dart'
;
import
'../runner/flutter_command.dart'
;
import
'package:path/path.dart'
as
path
;
class
BuildIOSCommand
extends
FlutterCommand
{
BuildIOSCommand
()
{
argParser
.
addFlag
(
'simulator'
,
help:
'Build for the iOS simulator instead of the device'
);
...
...
@@ -19,7 +22,7 @@ class BuildIOSCommand extends FlutterCommand {
final
String
name
=
'ios'
;
@override
final
String
description
=
'Build an iOS application bundle.'
;
final
String
description
=
'Build an iOS application bundle
(Mac OSX host only)
.'
;
@override
Future
<
int
>
runInProject
()
async
{
...
...
@@ -48,14 +51,20 @@ class BuildIOSCommand extends FlutterCommand {
printStatus
(
'Building the application for
$logTarget
.'
);
bool
result
=
await
buildIOSXcodeProject
(
app
,
buildForDevice:
!
forSimulator
);
Directory
buildDir
=
new
Directory
(
path
.
join
(
'build'
,
'ios_
$logTarget
'
));
if
(!
buildDir
.
existsSync
())
await
buildDir
.
create
();
bool
result
=
await
buildIOSXcodeProject
(
app
,
buildForDevice:
!
forSimulator
,
buildDirectory:
buildDir
);
if
(!
result
)
{
printError
(
'Encountered error while building for
$logTarget
.'
);
return
1
;
}
printStatus
(
'
Done
.'
);
printStatus
(
'
Built in
${buildDir.path}
.'
);
return
0
;
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
66e10061
...
...
@@ -89,7 +89,8 @@ bool _xcodeVersionCheckValid(int major, int minor) {
return
false
;
}
Future
<
bool
>
buildIOSXcodeProject
(
ApplicationPackage
app
,
{
bool
buildForDevice
})
async
{
Future
<
bool
>
buildIOSXcodeProject
(
ApplicationPackage
app
,
{
bool
buildForDevice
,
Directory
buildDirectory
})
async
{
String
flutterProjectPath
=
Directory
.
current
.
path
;
if
(
xcodeProjectRequiresUpdate
())
{
...
...
@@ -114,9 +115,23 @@ Future<bool> buildIOSXcodeProject(ApplicationPackage app, { bool buildForDevice
await
_addServicesToBundle
(
new
Directory
(
app
.
localPath
));
List
<
String
>
commands
=
<
String
>[
'/usr/bin/env'
,
'xcrun'
,
'xcodebuild'
,
'-target'
,
'Runner'
,
'-configuration'
,
'Release'
'/usr/bin/env'
,
'xcrun'
,
'xcodebuild'
,
'-target'
,
'Runner'
,
'-configuration'
,
'Release'
,
'ONLY_ACTIVE_ARCH=YES'
,
];
if
(
buildDirectory
!=
null
)
{
if
(!
buildDirectory
.
existsSync
())
{
printError
(
'The specified build directory
${buildDirectory.path}
does not exist'
);
return
false
;
}
commands
.
add
(
'TARGET_BUILD_DIR=
${buildDirectory.absolute.path}
'
);
}
if
(
buildForDevice
)
{
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphoneos'
,
'-arch'
,
'arm64'
]);
}
else
{
...
...
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