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
658f9e6c
Unverified
Commit
658f9e6c
authored
Mar 12, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make plugins work in Swift projects (#15437)
parent
c0118ea4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
7 deletions
+37
-7
plugin_test.dart
dev/devicelab/bin/tasks/plugin_test.dart
+4
-1
plugin_test_ios.dart
dev/devicelab/bin/tasks/plugin_test_ios.dart
+4
-1
plugin_test_win.dart
dev/devicelab/bin/tasks/plugin_test_win.dart
+4
-1
plugin_tests.dart
dev/devicelab/lib/tasks/plugin_tests.dart
+21
-4
Podfile-swift
packages/flutter_tools/templates/cocoapods/Podfile-swift
+4
-0
No files found.
dev/devicelab/bin/tasks/plugin_test.dart
View file @
658f9e6c
...
...
@@ -8,5 +8,8 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
await
task
(
new
PluginTest
(
'apk'
));
await
task
(
combine
(<
TaskFunction
>[
new
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'java'
]),
new
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'kotlin'
]),
]));
}
dev/devicelab/bin/tasks/plugin_test_ios.dart
View file @
658f9e6c
...
...
@@ -8,5 +8,8 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
await
task
(
new
PluginTest
(
'ios'
));
await
task
(
combine
(<
TaskFunction
>[
new
PluginTest
(
'ios'
,
<
String
>[
'-i'
,
'objc'
]),
new
PluginTest
(
'ios'
,
<
String
>[
'-i'
,
'swift'
]),
]));
}
dev/devicelab/bin/tasks/plugin_test_win.dart
View file @
658f9e6c
...
...
@@ -8,5 +8,8 @@ import 'package:flutter_devicelab/tasks/plugin_tests.dart';
import
'package:flutter_devicelab/framework/framework.dart'
;
Future
<
Null
>
main
()
async
{
await
task
(
new
PluginTest
(
'apk'
));
await
task
(
combine
(<
TaskFunction
>[
new
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'java'
]),
new
PluginTest
(
'apk'
,
<
String
>[
'-a'
,
'kotlin'
]),
]));
}
dev/devicelab/lib/tasks/plugin_tests.dart
View file @
658f9e6c
...
...
@@ -10,17 +10,31 @@ import 'package:flutter_devicelab/framework/framework.dart';
import
'package:flutter_devicelab/framework/ios.dart'
;
import
'package:flutter_devicelab/framework/utils.dart'
;
/// Combines several TaskFunctions with trivial success value into one.
TaskFunction
combine
(
List
<
TaskFunction
>
tasks
)
{
return
()
async
{
for
(
TaskFunction
task
in
tasks
)
{
final
TaskResult
result
=
await
task
();
if
(
result
.
failed
)
{
return
result
;
}
}
return
new
TaskResult
.
success
(
null
);
};
}
/// Defines task that creates new Flutter project, adds a plugin, and then
/// builds the specified [buildTarget].
class
PluginTest
{
final
String
buildTarget
;
final
List
<
String
>
options
;
PluginTest
(
this
.
buildTarget
);
PluginTest
(
this
.
buildTarget
,
this
.
options
);
Future
<
TaskResult
>
call
()
async
{
section
(
'Create Flutter project'
);
final
Directory
tmp
=
await
Directory
.
systemTemp
.
createTemp
(
'plugin'
);
final
FlutterProject
project
=
await
FlutterProject
.
create
(
tmp
);
final
FlutterProject
project
=
await
FlutterProject
.
create
(
tmp
,
options
);
if
(
buildTarget
==
'ios'
)
{
await
prepareProvisioningCertificates
(
project
.
rootPath
);
}
...
...
@@ -46,9 +60,12 @@ class FlutterProject {
final
Directory
parent
;
final
String
name
;
static
Future
<
FlutterProject
>
create
(
Directory
directory
)
async
{
static
Future
<
FlutterProject
>
create
(
Directory
directory
,
List
<
String
>
options
)
async
{
await
inDirectory
(
directory
,
()
async
{
await
flutter
(
'create'
,
options:
<
String
>[
'--org'
,
'io.flutter.devicelab'
,
'plugintest'
]);
await
flutter
(
'create'
,
options:
<
String
>[
'--org'
,
'io.flutter.devicelab'
]..
addAll
(
options
)..
add
(
'plugintest'
)
);
});
return
new
FlutterProject
(
directory
,
'plugintest'
);
}
...
...
packages/flutter_tools/templates/cocoapods/Podfile-swift
View file @
658f9e6c
...
...
@@ -67,5 +67,9 @@ post_install do |installer|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
# workaround for https://github.com/CocoaPods/CocoaPods/issues/7463
target.headers_build_phase.files.each do |file|
file.settings = { 'ATTRIBUTES' => ['Public'] }
end
end
end
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