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
1cbd61d3
Commit
1cbd61d3
authored
Feb 12, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1824 from devoncarew/use_revision_ios
use the REVISION file when building ios apps
parents
b00773a3
576bf7df
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 @
1cbd61d3
...
@@ -8,6 +8,7 @@ import 'dart:io';
...
@@ -8,6 +8,7 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'package:path/path.dart'
as
path
;
import
'../application_package.dart'
;
import
'../application_package.dart'
;
import
'../artifacts.dart'
;
import
'../base/common.dart'
;
import
'../base/common.dart'
;
import
'../base/globals.dart'
;
import
'../base/globals.dart'
;
import
'../base/process.dart'
;
import
'../base/process.dart'
;
...
@@ -173,7 +174,7 @@ class IOSDevice extends Device {
...
@@ -173,7 +174,7 @@ class IOSDevice extends Device {
printTrace
(
'Building
${app.name}
for
$id
'
);
printTrace
(
'Building
${app.name}
for
$id
'
);
// Step 1: Install the precompiled application if necessary
// Step 1: Install the precompiled application if necessary
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
true
);
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
buildForDevice:
true
);
if
(!
buildResult
)
{
if
(!
buildResult
)
{
printError
(
'Could not build the precompiled application for the device'
);
printError
(
'Could not build the precompiled application for the device'
);
return
false
;
return
false
;
...
@@ -314,7 +315,7 @@ class IOSSimulator extends Device {
...
@@ -314,7 +315,7 @@ class IOSSimulator extends Device {
this
.
clearLogs
();
this
.
clearLogs
();
// Step 1: Build the Xcode project
// Step 1: Build the Xcode project
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
false
);
bool
buildResult
=
await
_buildIOSXcodeProject
(
app
,
buildForDevice:
false
);
if
(!
buildResult
)
{
if
(!
buildResult
)
{
printError
(
'Could not build the application for the simulator'
);
printError
(
'Could not build the application for the simulator'
);
return
false
;
return
false
;
...
@@ -335,19 +336,16 @@ class IOSSimulator extends Device {
...
@@ -335,19 +336,16 @@ class IOSSimulator extends Device {
SimControl
.
install
(
id
,
path
.
absolute
(
bundle
.
path
));
SimControl
.
install
(
id
,
path
.
absolute
(
bundle
.
path
));
// Step 4: Prepare launch arguments
// Step 4: Prepare launch arguments
List
<
String
>
args
=
[];
List
<
String
>
args
=
<
String
>
[];
if
(
checked
)
{
if
(
checked
)
args
.
add
(
"--enable-checked-mode"
);
args
.
add
(
"--enable-checked-mode"
);
}
if
(
startPaused
)
{
if
(
startPaused
)
args
.
add
(
"--start-paused"
);
args
.
add
(
"--start-paused"
);
}
if
(
debugPort
!=
observatoryDefaultPort
)
{
if
(
debugPort
!=
observatoryDefaultPort
)
args
.
add
(
"--observatory-port=
$debugPort
"
);
args
.
add
(
"--observatory-port=
$debugPort
"
);
}
// Step 5: Launch the updated application in the simulator
// Step 5: Launch the updated application in the simulator
SimControl
.
launch
(
id
,
app
.
id
,
args
);
SimControl
.
launch
(
id
,
app
.
id
,
args
);
...
@@ -519,12 +517,38 @@ bool _checkXcodeVersion() {
...
@@ -519,12 +517,38 @@ bool _checkXcodeVersion() {
return
true
;
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
))
{
if
(!
FileSystemEntity
.
isDirectorySync
(
app
.
localPath
))
{
printError
(
'Path "
${path.absolute(app.localPath)}
" does not exist.
\n
Did you run `flutter ios --init`?'
);
printError
(
'Path "
${path.absolute(app.localPath)}
" does not exist.
\n
Did you run `flutter ios --init`?'
);
return
false
;
return
false
;
}
}
if
(!
_validateEngineRevision
(
app
))
return
false
;
if
(!
_checkXcodeVersion
())
if
(!
_checkXcodeVersion
())
return
false
;
return
false
;
...
@@ -532,7 +556,7 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
...
@@ -532,7 +556,7 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
'/usr/bin/env'
,
'xcrun'
,
'xcodebuild'
,
'-target'
,
'Runner'
,
'-configuration'
,
'Release'
'/usr/bin/env'
,
'xcrun'
,
'xcodebuild'
,
'-target'
,
'Runner'
,
'-configuration'
,
'Release'
];
];
if
(
is
Device
)
{
if
(
buildFor
Device
)
{
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphoneos'
,
'-arch'
,
'arm64'
]);
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphoneos'
,
'-arch'
,
'arm64'
]);
}
else
{
}
else
{
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphonesimulator'
,
'-arch'
,
'x86_64'
]);
commands
.
addAll
(<
String
>[
'-sdk'
,
'iphonesimulator'
,
'-arch'
,
'x86_64'
]);
...
@@ -546,9 +570,10 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
...
@@ -546,9 +570,10 @@ Future<bool> _buildIOSXcodeProject(ApplicationPackage app, bool isDevice) async
}
}
}
}
bool
enabled
=
false
;
bool
_servicesEnabled
=
false
;
Future
_addServicesToBundle
(
Directory
bundle
)
async
{
Future
_addServicesToBundle
(
Directory
bundle
)
async
{
if
(
e
nabled
)
{
if
(
_servicesE
nabled
)
{
List
<
Map
<
String
,
String
>>
services
=
[];
List
<
Map
<
String
,
String
>>
services
=
[];
await
parseServiceConfigs
(
services
);
await
parseServiceConfigs
(
services
);
await
_fetchFrameworks
(
services
);
await
_fetchFrameworks
(
services
);
...
@@ -562,7 +587,8 @@ Future _fetchFrameworks(List<Map<String, String>> services) async {
...
@@ -562,7 +587,8 @@ Future _fetchFrameworks(List<Map<String, String>> services) async {
for
(
Map
<
String
,
String
>
service
in
services
)
{
for
(
Map
<
String
,
String
>
service
in
services
)
{
String
frameworkUrl
=
service
[
'framework'
];
String
frameworkUrl
=
service
[
'framework'
];
service
[
'framework-path'
]
=
await
getServiceFromUrl
(
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