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
576bf7df
Commit
576bf7df
authored
Feb 12, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the REVISION file when building ios apps
parent
196c881c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
14 deletions
+40
-14
device_ios.dart
packages/flutter_tools/lib/src/ios/device_ios.dart
+40
-14
No files found.
packages/flutter_tools/lib/src/ios/device_ios.dart
View file @
576bf7df
...
...
@@ -8,6 +8,7 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'../application_package.dart'
;
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/globals.dart'
;
import
'../base/process.dart'
;
...
...
@@ -173,7 +174,7 @@ class IOSDevice extends Device {
printTrace
(
'Building
${app.name}
for
$id
'
);
// Step 1: Install the precompiled application if necessary
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
true
);
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
buildForDevice:
true
);
if
(!
buildResult
)
{
printError
(
'Could not build the precompiled application for the device'
);
return
false
;
...
...
@@ -314,7 +315,7 @@ class IOSSimulator extends Device {
this
.
clearLogs
();
// Step 1: Build the Xcode project
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
false
);
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
buildForDevice:
false
);
if
(!
buildResult
)
{
printError
(
'Could not build the application for the simulator'
);
return
false
;
...
...
@@ -335,19 +336,16 @@ class IOSSimulator extends Device {
SimControl
.
install
(
id
,
path
.
absolute
(
bundle
.
path
));
// Step 4: Prepare launch arguments
List
<
String
>
args
=
[];
List
<
String
>
args
=
<
String
>
[];
if
(
checked
)
{
if
(
checked
)
args
.
add
(
"--enable-checked-mode"
);
}
if
(
startPaused
)
{
if
(
startPaused
)
args
.
add
(
"--start-paused"
);
}
if
(
debugPort
!=
observatoryDefaultPort
)
{
if
(
debugPort
!=
observatoryDefaultPort
)
args
.
add
(
"--observatory-port=
$debugPort
"
);
}
// Step 5: Launch the updated application in the simulator
SimControl
.
launch
(
id
,
app
.
id
,
args
);
...
...
@@ -519,12 +517,38 @@ bool _checkXcodeVersion() {
return
true
;
}
Future
<
bool
>
_buildIOSXcodeProject
(
ApplicationPackage
app
,
bool
isDevice
)
async
{
bool
_validateEngineRevision
(
ApplicationPackage
app
)
{
String
skyRevision
=
ArtifactStore
.
engineRevision
;
String
iosRevision
=
_getIOSEngineRevision
(
app
);
if
(
iosRevision
!=
skyRevision
)
{
printError
(
"Error: incompatible sky_engine revision; please run 'flutter ios --init' to update."
);
printStatus
(
'sky_engine revision:
$skyRevision
, iOS engine revision:
$iosRevision
'
);
return
false
;
}
else
{
printTrace
(
'sky_engine revision:
$skyRevision
, iOS engine revision:
$iosRevision
'
);
return
true
;
}
}
String
_getIOSEngineRevision
(
ApplicationPackage
app
)
{
File
revisionFile
=
new
File
(
path
.
join
(
app
.
localPath
,
'REVISION'
));
if
(
revisionFile
.
existsSync
())
{
return
revisionFile
.
readAsStringSync
().
trim
();
}
else
{
return
null
;
}
}
Future
<
bool
>
_buildIOSXcodeProject
(
ApplicationPackage
app
,
{
bool
buildForDevice
})
async
{
if
(!
FileSystemEntity
.
isDirectorySync
(
app
.
localPath
))
{
printError
(
'Path "
${path.absolute(app.localPath)}
" does not exist.
\n
Did you run `flutter ios --init`?'
);
return
false
;
}
if
(!
_validateEngineRevision
(
app
))
return
false
;
if
(!
_checkXcodeVersion
())
return
false
;
...
...
@@ -532,7 +556,7 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
'/usr/bin/env'
,
'xcrun'
,
'xcodebuild'
,
'-target'
,
'Runner'
,
'-configuration'
,
'Release'
];
if
(
is
Device
)
{
if
(
buildFor
Device
)
{
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphoneos'
,
'-arch'
,
'arm64'
]);
}
else
{
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphonesimulator'
,
'-arch'
,
'x86_64'
]);
...
...
@@ -546,9 +570,10 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
}
}
bool
enabled
=
false
;
bool
_servicesEnabled
=
false
;
Future
_addServicesToBundle
(
Directory
bundle
)
async
{
if
(
e
nabled
)
{
if
(
_servicesE
nabled
)
{
List
<
Map
<
String
,
String
>>
services
=
[];
await
parseServiceConfigs
(
services
);
await
_fetchFrameworks
(
services
);
...
...
@@ -562,7 +587,8 @@ Future _fetchFrameworks(List<Map<String, String>> services) async {
for
(
Map
<
String
,
String
>
service
in
services
)
{
String
frameworkUrl
=
service
[
'framework'
];
service
[
'framework-path'
]
=
await
getServiceFromUrl
(
frameworkUrl
,
service
[
'root'
],
service
[
'name'
],
unzip:
true
);
frameworkUrl
,
service
[
'root'
],
service
[
'name'
],
unzip:
true
);
}
}
...
...
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