-
Notifications
You must be signed in to change notification settings - Fork 0
Test with xwalk AAR library
-
Install JDK that version need 6 or higher for Gradle. Then set JAVA_HOME environment to point to the install directory of the desired JDK.
JAVA_HOME = /path/to/jdk
-
Use Gradle Wrapper to build our project, Gradle will be automatically downloaded and used.Copy following construct files in your project directory from my sample(powerbuilder.sh.intel.com/public/junwei/AARTest/XWalkEmbed.tar.gz).
RootProject/ gradlew gradlew.bat gradle/wrapper/ gradle-wrapper.jar gradle-wrapper.properties
-
Install Maven (>version 3.1.1): maven.apache.org/download.cgi
-
Setting Wrapper to work behind Proxy
-
build it with proxy first time for download Gradle.
./gradlew –Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8118 clean build
-
For Connection to repo1.maven.org, make directory in /home/user/.gradle/ as gradle.properties, then add follow codes.
systemProp.http.proxyHost=127.0.0.1 systemProp.http.proxyPort=8118 systemProp.https.proxyHost=127.0.0.1 systemProp.https.proxyPort=8118
-
set maven proxy,in config/settings.xml config file
<settings> <proxies> <proxy> <protocol>http</protocol> <host>127.0.0.1</host> <port>8118</port> </proxy> </proxies> </settings>
-
-
Use AAR by local maven repository, Install it to projectRoot/libs directory. the Dversion is crosswalk version
mvn install:install-file -DgroupId=com.xwalk -DartifactId=xwalk_core_library -Dversion=7.35.135.0 -DgeneratePom=true -Dpackaging=aar -Dfile=xwalk_core_library.aar -DlocalRepositoryPath=/path/to/projectRoot/libs
-
Create Android Project, using the Crosswalk webview APIs.
-
The reference to maven repo in build.gradle will look like. if use local repo, the url is set to ‘libs’
Repositories { Maven { url ‘https://download.01.org/crosswalk/releases/crosswalk/android/maven2’ } }
-
The dependency (a reference) to the AAR library will look like(7.35.135.0 is crosswalk version):
Dependencies { Compile ‘com.xwalk:xwalk_core_library:7.35.135.0’ }
-
uncomment the line of “ext.multiarch=true” in libraries.gradle, which support multi architecture.
-
Build your project with Gradle, follow command will build the corresponding arch apk in build/apk directory
./gradlew assemblex86 ./gradlew assemblearmv7
also we can use “./gradlew build” to build all of version at once.
-
if report error about “failed to find build tools version 19.0.0”, please check it use “android” command.