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
839334a5
Commit
839334a5
authored
Mar 22, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2820 from devoncarew/setup_xcodeproj
change how we calculate the temp dir
parents
30c4c4f7
1d20a90c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+1
-1
setup_xcodeproj.dart
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
+14
-9
No files found.
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
839334a5
...
@@ -239,7 +239,7 @@ Future<_ApkComponents> _findApkComponents(
...
@@ -239,7 +239,7 @@ Future<_ApkComponents> _findApkComponents(
await
parseServiceConfigs
(
components
.
services
,
jars:
components
.
jars
);
await
parseServiceConfigs
(
components
.
services
,
jars:
components
.
jars
);
for
(
File
file
in
[
for
(
File
file
in
<
File
>
[
components
.
manifest
,
components
.
icuData
,
components
.
libSkyShell
,
components
.
debugKeystore
components
.
manifest
,
components
.
icuData
,
components
.
libSkyShell
,
components
.
debugKeystore
]..
addAll
(
components
.
jars
))
{
]..
addAll
(
components
.
jars
))
{
if
(!
file
.
existsSync
())
{
if
(!
file
.
existsSync
())
{
...
...
packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
View file @
839334a5
...
@@ -13,7 +13,7 @@ import '../base/process.dart';
...
@@ -13,7 +13,7 @@ import '../base/process.dart';
import
'../globals.dart'
;
import
'../globals.dart'
;
import
'../runner/flutter_command_runner.dart'
;
import
'../runner/flutter_command_runner.dart'
;
Future
<
bool
>
_inflateXcodeArchive
(
String
directory
,
List
<
int
>
archiveBytes
)
async
{
bool
_inflateXcodeArchive
(
String
directory
,
List
<
int
>
archiveBytes
)
{
printStatus
(
'Unzipping Xcode project to local directory...'
);
printStatus
(
'Unzipping Xcode project to local directory...'
);
// We cannot use ArchiveFile because this archive contains files that are exectuable
// We cannot use ArchiveFile because this archive contains files that are exectuable
...
@@ -21,28 +21,33 @@ Future<bool> _inflateXcodeArchive(String directory, List<int> archiveBytes) asyn
...
@@ -21,28 +21,33 @@ Future<bool> _inflateXcodeArchive(String directory, List<int> archiveBytes) asyn
// or after creation. See https://github.com/dart-lang/sdk/issues/15078.
// or after creation. See https://github.com/dart-lang/sdk/issues/15078.
// So we depend on the platform to unzip the archive for us.
// So we depend on the platform to unzip the archive for us.
Directory
tempDir
=
await
Directory
.
systemTemp
.
create
(
);
Directory
tempDir
=
Directory
.
systemTemp
.
createTempSync
(
'flutter_xcode'
);
File
tempFile
=
new
File
(
path
.
join
(
tempDir
.
path
,
'FlutterXcode.zip'
))..
createSync
();
File
tempFile
=
new
File
(
path
.
join
(
tempDir
.
path
,
'FlutterXcode.zip'
))..
createSync
();
tempFile
.
writeAsBytesSync
(
archiveBytes
);
tempFile
.
writeAsBytesSync
(
archiveBytes
);
try
{
try
{
Directory
dir
=
new
Directory
(
directory
);
// Remove the old generated project if one is present
// Remove the old generated project if one is present
runCheckedSync
([
'/bin/rm'
,
'-rf'
,
directory
]);
if
(
dir
.
existsSync
())
dir
.
deleteSync
(
recursive:
true
);
// Create the directory so unzip can write to it
// Create the directory so unzip can write to it
runCheckedSync
([
'/bin/mkdir'
,
'-p'
,
directory
]);
dir
.
createSync
(
recursive:
true
);
// Unzip the Xcode project into the new empty directory
// Unzip the Xcode project into the new empty directory
runCheckedSync
([
'/usr/bin/unzip'
,
tempFile
.
path
,
'-d'
,
dir
ectory
]);
runCheckedSync
([
'/usr/bin/unzip'
,
tempFile
.
path
,
'-d'
,
dir
.
path
]);
}
catch
(
error
)
{
}
catch
(
error
)
{
printTrace
(
'
$error
'
);
return
false
;
return
false
;
}
}
// Cleanup the temp directory after unzipping
// Cleanup the temp directory after unzipping
runSync
([
'/bin/rm'
,
'-rf'
,
tempDir
.
path
]
);
tempDir
.
deleteSync
(
recursive:
true
);
// Verify that we have an Xcode project
// Verify that we have an Xcode project
Directory
flutterProj
=
new
Directory
(
path
.
join
(
directory
,
'FlutterApplication.xcodeproj'
));
Directory
flutterProj
=
new
Directory
(
path
.
join
(
directory
,
'FlutterApplication.xcodeproj'
));
bool
flutterProjExists
=
await
flutterProj
.
exists
();
if
(!
flutterProj
.
existsSync
())
{
if
(!
flutterProjExists
)
{
printError
(
"
${flutterProj.path}
does not exist"
);
printError
(
"
${flutterProj.path}
does not exist"
);
return
false
;
return
false
;
}
}
...
@@ -108,7 +113,7 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath) async {
...
@@ -108,7 +113,7 @@ Future<int> setupXcodeProjectHarness(String flutterProjectPath) async {
}
}
// Step 2: Inflate the archive into the user project directory
// Step 2: Inflate the archive into the user project directory
bool
result
=
await
_inflateXcodeArchive
(
xcodeprojPath
,
archiveBytes
);
bool
result
=
_inflateXcodeArchive
(
xcodeprojPath
,
archiveBytes
);
if
(!
result
)
{
if
(!
result
)
{
printError
(
'Could not inflate the Xcode project archive.'
);
printError
(
'Could not inflate the Xcode project archive.'
);
return
1
;
return
1
;
...
...
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