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
d5b30f68
Commit
d5b30f68
authored
Mar 23, 2016
by
Jason Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose the engine-src-path flag in the Gradle plugin
parent
9cce0833
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
FlutterPlugin.groovy
...llo_android/buildSrc/src/main/groovy/FlutterPlugin.groovy
+15
-0
No files found.
examples/hello_android/buildSrc/src/main/groovy/FlutterPlugin.groovy
View file @
d5b30f68
...
...
@@ -18,6 +18,7 @@ import org.gradle.api.tasks.TaskAction
class
FlutterPlugin
implements
Plugin
<
Project
>
{
private
File
sdkDir
private
File
engineSrcDir
@Override
void
apply
(
Project
project
)
{
...
...
@@ -42,6 +43,14 @@ class FlutterPlugin implements Plugin<Project> {
throw
new
GradleException
(
"flutter.sdk must point to the Flutter SDK directory"
)
}
String
engineSrcPath
=
properties
.
getProperty
(
"flutter.engineSrcPath"
)
if
(
engineSrcPath
!=
null
)
{
engineSrcDir
=
project
.
file
(
engineSrcPath
)
if
(!
engineSrcDir
.
isDirectory
())
{
throw
new
GradleException
(
"flutter.engineSrcPath must be a Flutter engine source directory"
)
}
}
project
.
extensions
.
create
(
"flutter"
,
FlutterExtension
)
project
.
dependencies
.
add
(
"compile"
,
flutterEngine
)
project
.
afterEvaluate
this
.&
addFlutterTask
...
...
@@ -56,6 +65,7 @@ class FlutterPlugin implements Plugin<Project> {
sdkDir
this
.
sdkDir
sourceDir
project
.
file
(
project
.
flutter
.
source
)
intermediateDir
project
.
file
(
"${project.buildDir}/${AndroidProject.FD_INTERMEDIATES}/flutter"
)
engineSrcDir
this
.
engineSrcDir
}
project
.
android
.
applicationVariants
.
all
{
variant
->
...
...
@@ -83,6 +93,8 @@ class FlutterTask extends DefaultTask {
@OutputDirectory
File
intermediateDir
File
engineSrcDir
String
getFlxPath
()
{
return
"${intermediateDir}/app.flx"
}
...
...
@@ -97,6 +109,9 @@ class FlutterTask extends DefaultTask {
project
.
exec
{
executable
"${sdkDir}/bin/flutter"
workingDir
sourceDir
if
(
engineSrcDir
!=
null
)
{
args
"--engine-src-path"
,
engineSrcDir
}
args
"build"
,
"flx"
args
"-o"
,
flxPath
args
"--snapshot"
,
"${intermediateDir}/snapshot_blob.bin"
...
...
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