Skip to content

Commit 35f187a

Browse files
committed
Let getProperty() return a list
1 parent 5ed8ffc commit 35f187a

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

lib/tizen_build_target.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ USER_LIB_DIRS = lib
264264
.forEach(inputs.add);
265265
}
266266

267-
for (final String libName in plugin.getProperty('USER_LIBS').split(' ')) {
267+
for (final String libName in plugin.getProperty('USER_LIBS')) {
268268
final File libFile = plugin.directory
269269
.childDirectory('lib')
270270
.childDirectory(getTizenBuildArch(buildInfo.targetArch))

lib/tizen_plugins.dart

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class TizenPlugin extends PluginPlatform implements NativeOrDartPlugin {
4040
this.fileName,
4141
}) : assert(pluginClass != null || dartPluginClass != null);
4242

43-
factory TizenPlugin.fromYaml(String name, Directory directory, YamlMap yaml) {
43+
static TizenPlugin fromYaml(String name, Directory directory, YamlMap yaml) {
4444
assert(validate(yaml));
4545
return TizenPlugin(
4646
name: name,
@@ -83,14 +83,14 @@ class TizenPlugin extends PluginPlatform implements NativeOrDartPlugin {
8383

8484
final RegExp _propertyFormat = RegExp(r'(\S+)\s*\+?=(.*)');
8585

86-
Map<String, String> _properties;
86+
Map<String, List<String>> _properties;
8787

88-
String getProperty(String key) {
88+
List<String> getProperty(String key) {
8989
if (_properties == null) {
9090
if (!projectFile.existsSync()) {
91-
return null;
91+
return <String>[];
9292
}
93-
_properties = <String, String>{};
93+
_properties = <String, List<String>>{};
9494

9595
for (final String line in projectFile.readAsLinesSync()) {
9696
final Match match = _propertyFormat.firstMatch(line);
@@ -99,20 +99,15 @@ class TizenPlugin extends PluginPlatform implements NativeOrDartPlugin {
9999
}
100100
final String key = match.group(1);
101101
final String value = match.group(2).trim();
102-
_properties[key] = value;
102+
_properties[key] = value.split(' ');
103103
}
104104
}
105-
return _properties.containsKey(key) ? _properties[key] : null;
105+
return _properties.containsKey(key) ? _properties[key] : <String>[];
106106
}
107107

108108
List<String> getPropertyAsAbsolutePaths(String key) {
109-
final String property = getProperty(key);
110-
if (property == null) {
111-
return <String>[];
112-
}
113-
114109
final List<String> paths = <String>[];
115-
for (final String element in property.split(' ')) {
110+
for (final String element in getProperty(key)) {
116111
if (globals.fs.path.isAbsolute(element)) {
117112
paths.add(element);
118113
} else {

0 commit comments

Comments
 (0)