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
475678fd
Unverified
Commit
475678fd
authored
Jun 20, 2018
by
Mikkel Nygaard Ravn
Committed by
GitHub
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Gradle script support Flutter-as-lib (#18633)
parent
0a3179fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
flutter.gradle
packages/flutter_tools/gradle/flutter.gradle
+11
-11
No files found.
packages/flutter_tools/gradle/flutter.gradle
View file @
475678fd
...
...
@@ -53,7 +53,7 @@ class FlutterPlugin implements Plugin<Project> {
private
String
resolveProperty
(
Project
project
,
String
name
,
String
defaultValue
)
{
if
(
localProperties
==
null
)
{
localProperties
=
readPropertiesIfExist
(
project
.
rootProject
.
file
(
"local.properties"
))
localProperties
=
readPropertiesIfExist
(
new
File
(
project
.
projectDir
.
parentFile
,
"local.properties"
))
}
String
result
if
(
project
.
hasProperty
(
name
))
{
...
...
@@ -107,8 +107,8 @@ class FlutterPlugin implements Plugin<Project> {
localEngineSrcPath
=
engineOut
.
parentFile
.
parent
project
.
dependencies
{
if
(
project
.
getConfigurations
().
findByName
(
"
implementation
"
))
{
implementation
project
.
files
(
flutterJar
)
if
(
project
.
getConfigurations
().
findByName
(
"
api
"
))
{
api
project
.
files
(
flutterJar
)
}
else
{
compile
project
.
files
(
flutterJar
)
}
...
...
@@ -146,16 +146,16 @@ class FlutterPlugin implements Plugin<Project> {
into
"lib/x86_64"
}
}
// Add flutter.jar dependencies to all <buildType>
Implementation
configurations, including custom ones
// Add flutter.jar dependencies to all <buildType>
Api
configurations, including custom ones
// added after applying the Flutter plugin.
project
.
android
.
buildTypes
.
each
{
addFlutterJar
Implementation
Dependency
(
project
,
it
)
}
project
.
android
.
buildTypes
.
whenObjectAdded
{
addFlutterJar
Implementation
Dependency
(
project
,
it
)
}
project
.
android
.
buildTypes
.
each
{
addFlutterJar
Api
Dependency
(
project
,
it
)
}
project
.
android
.
buildTypes
.
whenObjectAdded
{
addFlutterJar
Api
Dependency
(
project
,
it
)
}
}
project
.
extensions
.
create
(
"flutter"
,
FlutterExtension
)
project
.
afterEvaluate
this
.&
addFlutterTask
File
pluginsFile
=
new
File
(
project
.
rootProject
.
projectDir
.
parentFile
,
'.flutter-plugins'
)
File
pluginsFile
=
new
File
(
project
.
projectDir
.
parentFile
.
parentFile
,
'.flutter-plugins'
)
Properties
plugins
=
readPropertiesIfExist
(
pluginsFile
)
plugins
.
each
{
name
,
_
->
...
...
@@ -199,15 +199,15 @@ class FlutterPlugin implements Plugin<Project> {
}
/**
* Adds suitable flutter.jar
implementation
dependencies to the specified buildType.
* Adds suitable flutter.jar
api
dependencies to the specified buildType.
*
* Note: The BuildType DSL type is not public, and is therefore omitted from the signature.
*/
private
void
addFlutterJar
Implementation
Dependency
(
Project
project
,
buildType
)
{
private
void
addFlutterJar
Api
Dependency
(
Project
project
,
buildType
)
{
project
.
dependencies
{
String
configuration
;
if
(
project
.
getConfigurations
().
findByName
(
"
implementation
"
))
{
configuration
=
buildType
.
name
+
"
Implementation
"
;
if
(
project
.
getConfigurations
().
findByName
(
"
api
"
))
{
configuration
=
buildType
.
name
+
"
Api
"
;
}
else
{
configuration
=
buildType
.
name
+
"Compile"
;
}
...
...
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