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
fb427a1e
Commit
fb427a1e
authored
Mar 22, 2016
by
Chinmay Garde
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2823 from chinmaygarde/master
Use the artifacts store for iOS assets
parents
79a098e9
68a3aa70
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
26 deletions
+17
-26
update_engine.sh
bin/cache/update_engine.sh
+1
-0
artifacts.dart
packages/flutter_tools/lib/src/artifacts.dart
+7
-0
setup_xcodeproj.dart
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
+9
-26
No files found.
bin/cache/update_engine.sh
View file @
fb427a1e
...
...
@@ -61,6 +61,7 @@ if [ ! -f "$ENGINE_STAMP_PATH" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP_P
Darwin
)
download_artifacts darwin-x64
chmod
a+x
"
$ENGINE_ARTIFACT_PATH
/darwin-x64/sky_snapshot"
download_artifacts ios
;;
Linux
)
download_artifacts linux-x64
...
...
packages/flutter_tools/lib/src/artifacts.dart
View file @
fb427a1e
...
...
@@ -42,6 +42,7 @@ enum ArtifactType {
androidIcuData
,
androidKeystore
,
androidLibSkyShell
,
iosXcodeProject
,
}
class
Artifact
{
...
...
@@ -125,6 +126,12 @@ class ArtifactStore {
type:
ArtifactType
.
androidLibSkyShell
,
targetPlatform:
TargetPlatform
.
android_arm
),
const
Artifact
.
_
(
name:
'iOS Runner (Xcode Project)'
,
fileName:
'FlutterXcode.zip'
,
type:
ArtifactType
.
iosXcodeProject
,
targetPlatform:
TargetPlatform
.
ios
),
];
static
Artifact
getArtifact
({
...
...
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
View file @
fb427a1e
...
...
@@ -8,35 +8,11 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'../artifacts.dart'
;
import
'../build_configuration.dart'
;
import
'../base/process.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command_runner.dart'
;
Uri
_xcodeProjectUri
(
String
revision
)
{
String
uriString
=
'https://storage.googleapis.com/flutter_infra/flutter/
$revision
/ios/FlutterXcode.zip'
;
return
Uri
.
parse
(
uriString
);
}
Future
<
List
<
int
>>
_fetchXcodeArchive
()
async
{
printStatus
(
'Fetching the Xcode project archive from the cloud...'
);
HttpClient
client
=
new
HttpClient
();
Uri
xcodeProjectUri
=
_xcodeProjectUri
(
ArtifactStore
.
engineRevision
);
printStatus
(
'Downloading
$xcodeProjectUri
...'
);
HttpClientRequest
request
=
await
client
.
getUrl
(
xcodeProjectUri
);
HttpClientResponse
response
=
await
request
.
close
();
if
(
response
.
statusCode
!=
200
)
throw
new
Exception
(
response
.
reasonPhrase
);
BytesBuilder
bytesBuilder
=
new
BytesBuilder
(
copy:
false
);
await
for
(
List
<
int
>
chunk
in
response
)
bytesBuilder
.
add
(
chunk
);
return
bytesBuilder
.
takeBytes
();
}
Future
<
bool
>
_inflateXcodeArchive
(
String
directory
,
List
<
int
>
archiveBytes
)
async
{
printStatus
(
'Unzipping Xcode project to local directory...'
);
...
...
@@ -117,7 +93,14 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath) async {
// Step 1: Fetch the archive from the cloud
String
iosFilesPath
=
path
.
join
(
flutterProjectPath
,
'ios'
);
String
xcodeprojPath
=
path
.
join
(
iosFilesPath
,
'.generated'
);
List
<
int
>
archiveBytes
=
await
_fetchXcodeArchive
();
Artifact
xcodeProject
=
ArtifactStore
.
getArtifact
(
type:
ArtifactType
.
iosXcodeProject
,
targetPlatform:
TargetPlatform
.
ios
);
String
xcodeProjectPath
=
await
ArtifactStore
.
getPath
(
xcodeProject
);
List
<
int
>
archiveBytes
=
await
new
File
(
xcodeProjectPath
).
readAsBytes
();
if
(
archiveBytes
.
isEmpty
)
{
printError
(
'Error: No archive bytes received.'
);
...
...
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