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
3463d89c
Commit
3463d89c
authored
Feb 22, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove iosSimulator field from ApplicationPackageStore
parent
896246ad
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
30 deletions
+24
-30
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+8
-17
devices.dart
packages/flutter_tools/lib/src/commands/devices.dart
+3
-3
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-0
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+1
-2
plist_utils.dart
packages/flutter_tools/lib/src/ios/plist_utils.dart
+6
-4
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+5
-4
No files found.
packages/flutter_tools/lib/src/application_package.dart
View file @
3463d89c
...
...
@@ -88,36 +88,32 @@ class IOSApp extends ApplicationPackage {
})
:
super
(
localPath:
iosProjectDir
,
id:
iosProjectBundleId
);
factory
IOSApp
.
fromBuildConfiguration
(
BuildConfiguration
config
)
{
if
(
getCurrentHostPlatform
()
!=
HostPlatform
.
mac
)
{
if
(
getCurrentHostPlatform
()
!=
HostPlatform
.
mac
)
return
null
;
}
String
plistPath
=
path
.
join
(
"ios"
,
"Info.plist"
);
String
id
=
plistValueForKey
(
plistPath
,
kCFBundleIdentifierKey
);
if
(
id
==
""
)
{
String
value
=
getValueFromFile
(
plistPath
,
kCFBundleIdentifierKey
);
if
(
value
==
null
)
return
null
;
}
String
projectDir
=
path
.
join
(
"ios"
,
".generated"
);
return
new
IOSApp
(
iosProjectDir:
projectDir
,
iosProjectBundleId:
id
);
return
new
IOSApp
(
iosProjectDir:
projectDir
,
iosProjectBundleId:
value
);
}
}
class
ApplicationPackageStore
{
final
AndroidApk
android
;
final
IOSApp
iOS
;
final
IOSApp
iOSSimulator
;
ApplicationPackageStore
({
this
.
android
,
this
.
iOS
,
this
.
iOSSimulator
});
ApplicationPackageStore
({
this
.
android
,
this
.
iOS
});
ApplicationPackage
getPackageForPlatform
(
TargetPlatform
platform
)
{
switch
(
platform
)
{
case
TargetPlatform
.
android
:
return
android
;
case
TargetPlatform
.
iOS
:
return
iOS
;
case
TargetPlatform
.
iOSSimulator
:
return
iOS
Simulator
;
return
iOS
;
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
linux
:
return
null
;
...
...
@@ -127,7 +123,6 @@ class ApplicationPackageStore {
static
Future
<
ApplicationPackageStore
>
forConfigs
(
List
<
BuildConfiguration
>
configs
)
async
{
AndroidApk
android
;
IOSApp
iOS
;
IOSApp
iOSSimulator
;
for
(
BuildConfiguration
config
in
configs
)
{
switch
(
config
.
targetPlatform
)
{
...
...
@@ -150,21 +145,17 @@ class ApplicationPackageStore {
break
;
case
TargetPlatform
.
iOS
:
case
TargetPlatform
.
iOSSimulator
:
assert
(
iOS
==
null
);
iOS
=
new
IOSApp
.
fromBuildConfiguration
(
config
);
break
;
case
TargetPlatform
.
iOSSimulator
:
assert
(
iOSSimulator
==
null
);
iOSSimulator
=
new
IOSApp
.
fromBuildConfiguration
(
config
);
break
;
case
TargetPlatform
.
mac
:
case
TargetPlatform
.
linux
:
break
;
}
}
return
new
ApplicationPackageStore
(
android:
android
,
iOS:
iOS
,
iOSSimulator:
iOSSimulator
);
return
new
ApplicationPackageStore
(
android:
android
,
iOS:
iOS
);
}
}
packages/flutter_tools/lib/src/commands/devices.dart
View file @
3463d89c
...
...
@@ -27,11 +27,11 @@ class DevicesCommand extends FlutterCommand {
if
(
devices
.
isEmpty
)
{
printStatus
(
'No connected devices.'
);
}
else
{
printStatus
(
'
${devices.length}
connected
${pluralize('device', devices.length)}
:'
);
printStatus
(
'
${devices.length}
connected
${pluralize('device', devices.length)}
:
\n
'
);
for
(
Device
device
in
devices
)
{
String
supportIndicator
=
device
.
isSupported
()
?
''
:
'- unsupported'
;
printStatus
(
'
${device.name}
(
${device.id}
)
$supportIndicator
'
);
String
supportIndicator
=
device
.
isSupported
()
?
''
:
'
- unsupported'
;
printStatus
(
'
${device.name}
(
${device.id}
)
$supportIndicator
'
);
}
}
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
3463d89c
...
...
@@ -170,6 +170,7 @@ Future<int> startApp(
if
(
install
)
{
printTrace
(
'Running install command.'
);
// TODO(devoncarew): This fails for ios devices - we haven't built yet.
await
installApp
(
devices
,
applicationPackages
);
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
3463d89c
...
...
@@ -59,9 +59,8 @@ class XCode {
bool
_xcodeVersionSatisfactory
;
bool
get
xcodeVersionSatisfactory
{
if
(
_xcodeVersionSatisfactory
!=
null
)
{
if
(
_xcodeVersionSatisfactory
!=
null
)
return
_xcodeVersionSatisfactory
;
}
try
{
String
output
=
runSync
(<
String
>[
'xcodebuild'
,
'-version'
]);
...
...
packages/flutter_tools/lib/src/ios/plist_utils.dart
View file @
3463d89c
...
...
@@ -8,7 +8,7 @@ import '../base/process.dart';
const
String
kCFBundleIdentifierKey
=
"CFBundleIdentifier"
;
String
plistValueForKey
(
String
plistFilePath
,
String
plistK
ey
)
{
String
getValueFromFile
(
String
plistFilePath
,
String
k
ey
)
{
// TODO(chinmaygarde): For now, we only need to read from plist files on a
// mac host. If this changes, we will need our own Dart plist reader.
...
...
@@ -18,12 +18,14 @@ String plistValueForKey(String plistFilePath, String plistKey) {
String
normalizedPlistPath
=
path
.
withoutExtension
(
path
.
absolute
(
plistFilePath
));
try
{
return
runCheckedSync
(
[
String
value
=
runCheckedSync
(<
String
>
[
'/usr/bin/defaults'
,
'read'
,
normalizedPlistPath
,
plistKey
]).
trim
();
key
]).
trim
();
return
value
.
isEmpty
?
null
:
value
;
}
catch
(
error
)
{
return
""
;
return
null
;
}
}
packages/flutter_tools/test/src/mocks.dart
View file @
3463d89c
...
...
@@ -15,10 +15,11 @@ import 'package:mockito/mockito.dart';
class
MockApplicationPackageStore
extends
ApplicationPackageStore
{
MockApplicationPackageStore
()
:
super
(
android:
new
AndroidApk
(
localPath:
'/mock/path/to/android/SkyShell.apk'
),
iOS:
new
IOSApp
(
iosProjectDir:
'/mock/path/to/iOS/SkyShell.app'
,
iosProjectBundleId:
'io.flutter.ios.mock'
),
iOSSimulator:
new
IOSApp
(
iosProjectDir:
'/mock/path/to/iOSSimulator/SkyShell.app'
,
iosProjectBundleId:
'io.flutter.ios.mock'
));
iOS:
new
IOSApp
(
iosProjectDir:
'/mock/path/to/iOS/SkyShell.app'
,
iosProjectBundleId:
'io.flutter.ios.mock'
)
);
}
class
MockCompiler
extends
Mock
implements
Compiler
{
...
...
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