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
3525aa1b
Commit
3525aa1b
authored
Apr 12, 2016
by
Jason Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the flutter.jar in the artifact cache by default (#3278)
See
https://github.com/flutter/flutter/issues/3233
parent
ec4a6a96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
README.md
examples/hello_android/README.md
+0
-1
FlutterPlugin.groovy
...llo_android/buildSrc/src/main/groovy/FlutterPlugin.groovy
+23
-10
No files found.
examples/hello_android/README.md
View file @
3525aa1b
...
@@ -8,7 +8,6 @@ To build this project:
...
@@ -8,7 +8,6 @@ To build this project:
*
Create a
`local.properties`
file with these entries:
*
Create a
`local.properties`
file with these entries:
*
`sdk.dir=[path to the Android SDK]`
*
`sdk.dir=[path to the Android SDK]`
*
`flutter.sdk=[path to the Flutter SDK]`
*
`flutter.sdk=[path to the Flutter SDK]`
*
`flutter.jar=[path to the flutter.jar file in your build of the Flutter engine]`
Then run:
Then run:
...
...
examples/hello_android/buildSrc/src/main/groovy/FlutterPlugin.groovy
View file @
3525aa1b
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
package
org.domokit.sky.gradle
package
org.domokit.sky.gradle
import
com.android.builder.model.AndroidProject
import
com.android.builder.model.AndroidProject
import
com.google.common.base.Joiner
import
org.gradle.api.DefaultTask
import
org.gradle.api.DefaultTask
import
org.gradle.api.GradleException
import
org.gradle.api.GradleException
import
org.gradle.api.Project
import
org.gradle.api.Project
...
@@ -25,15 +26,6 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -25,15 +26,6 @@ class FlutterPlugin implements Plugin<Project> {
Properties
properties
=
new
Properties
()
Properties
properties
=
new
Properties
()
properties
.
load
(
project
.
rootProject
.
file
(
"local.properties"
).
newDataInputStream
())
properties
.
load
(
project
.
rootProject
.
file
(
"local.properties"
).
newDataInputStream
())
String
enginePath
=
properties
.
getProperty
(
"flutter.jar"
)
if
(
enginePath
==
null
)
{
throw
new
GradleException
(
"flutter.jar must be defined in local.properties"
)
}
FileCollection
flutterEngine
=
project
.
files
(
enginePath
)
if
(!
flutterEngine
.
singleFile
.
isFile
())
{
throw
new
GradleException
(
"flutter.jar must point to a Flutter engine JAR"
)
}
String
sdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
String
sdkPath
=
properties
.
getProperty
(
"flutter.sdk"
)
if
(
sdkPath
==
null
)
{
if
(
sdkPath
==
null
)
{
throw
new
GradleException
(
"flutter.sdk must be defined in local.properties"
)
throw
new
GradleException
(
"flutter.sdk must be defined in local.properties"
)
...
@@ -43,6 +35,27 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -43,6 +35,27 @@ class FlutterPlugin implements Plugin<Project> {
throw
new
GradleException
(
"flutter.sdk must point to the Flutter SDK directory"
)
throw
new
GradleException
(
"flutter.sdk must point to the Flutter SDK directory"
)
}
}
File
flutterJar
String
flutterJarPath
=
properties
.
getProperty
(
"flutter.jar"
)
if
(
flutterJarPath
!=
null
)
{
flutterJar
=
project
.
file
(
flutterJarPath
)
if
(!
flutterJar
.
isFile
())
{
throw
new
GradleException
(
"flutter.jar must point to a Flutter engine JAR"
)
}
}
else
{
flutterJar
=
new
File
(
sdkDir
,
Joiner
.
on
(
File
.
separatorChar
).
join
(
"bin"
,
"cache"
,
"artifacts"
,
"engine"
,
"android-arm"
,
"flutter.jar"
))
if
(!
flutterJar
.
isFile
())
{
project
.
exec
{
executable
"${sdkDir}/bin/flutter"
args
"precache"
}
if
(!
flutterJar
.
isFile
())
{
throw
new
GradleException
(
"Unable to find flutter.jar in SDK: ${flutterJar}"
)
}
}
}
String
engineSrcPath
=
properties
.
getProperty
(
"flutter.engineSrcPath"
)
String
engineSrcPath
=
properties
.
getProperty
(
"flutter.engineSrcPath"
)
if
(
engineSrcPath
!=
null
)
{
if
(
engineSrcPath
!=
null
)
{
engineSrcDir
=
project
.
file
(
engineSrcPath
)
engineSrcDir
=
project
.
file
(
engineSrcPath
)
...
@@ -52,7 +65,7 @@ class FlutterPlugin implements Plugin<Project> {
...
@@ -52,7 +65,7 @@ class FlutterPlugin implements Plugin<Project> {
}
}
project
.
extensions
.
create
(
"flutter"
,
FlutterExtension
)
project
.
extensions
.
create
(
"flutter"
,
FlutterExtension
)
project
.
dependencies
.
add
(
"compile"
,
flutterEngine
)
project
.
dependencies
.
add
(
"compile"
,
project
.
files
(
flutterJar
)
)
project
.
afterEvaluate
this
.&
addFlutterTask
project
.
afterEvaluate
this
.&
addFlutterTask
}
}
...
...
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