mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #21404 - paulrouget:localaar, r=MortimerGoro
Make it possible to use a custom AAR to build servoapp Fix https://github.com/servo/servo/issues/21402 To use a local AAR, create `support/android/apk/user.properties`: ``` servoViewLocal=/tmp/servo-latest.aar ``` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21404) <!-- Reviewable:end -->
This commit is contained in:
commit
be9e5df913
3 changed files with 40 additions and 2 deletions
|
@ -123,5 +123,9 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
|
||||
implementation project(':servoview')
|
||||
if (findProject(':servoview-local')) {
|
||||
implementation project(':servoview-local')
|
||||
} else {
|
||||
implementation project(':servoview')
|
||||
}
|
||||
}
|
||||
|
|
12
support/android/apk/servoview-local/build.gradle
Normal file
12
support/android/apk/servoview-local/build.gradle
Normal file
|
@ -0,0 +1,12 @@
|
|||
configurations.maybeCreate("default")
|
||||
|
||||
if (gradle.hasProperty('servoViewLocal')) {
|
||||
def aar = new File(gradle.servoViewLocal)
|
||||
if (aar.exists()) {
|
||||
artifacts.add('default', aar)
|
||||
} else {
|
||||
throw new GradleException('Failed to find ServoView AAR at: ' + gradle.servoViewLocal)
|
||||
}
|
||||
} else {
|
||||
throw new GradleException('Local ServoView AAR path not defined')
|
||||
}
|
|
@ -1 +1,23 @@
|
|||
include ':servoapp', ':servoview'
|
||||
include ':servoapp'
|
||||
|
||||
def userPropertiesFile = new File('user.properties')
|
||||
if (userPropertiesFile.exists()) {
|
||||
println("Loading user.properties")
|
||||
def props = new Properties()
|
||||
userPropertiesFile.withInputStream {
|
||||
props.load(it)
|
||||
}
|
||||
props.each { prop ->
|
||||
println(prop.key + " = " + prop.value)
|
||||
gradle.ext.set(prop.key, prop.value)
|
||||
}
|
||||
if (gradle.hasProperty('servoViewLocal')) {
|
||||
println("Using local build of servoview")
|
||||
include ':servoview-local'
|
||||
project(':servoview-local').projectDir = new File('servoview-local')
|
||||
} else {
|
||||
include ':servoview'
|
||||
}
|
||||
} else {
|
||||
include ':servoview'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue