mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
Add smack-android and redesign SASL authentication
This commit marks an important milestone with the addition of the smack-android subproject. Smack is now able to run native on Android without requiring any modifications, which makes the aSmack build environment obsolete. It was necessary to redesign the code for SASL authentication to achieve this. Smack now comes with smack-sasl-provided for SASL implementations that do not rely on additional APIs like javax for platforms where those APIs are not available like Android.
This commit is contained in:
parent
5a2149718a
commit
89dc3a0e85
39 changed files with 1562 additions and 675 deletions
50
smack-android/build.gradle
Normal file
50
smack-android/build.gradle
Normal file
|
@ -0,0 +1,50 @@
|
|||
description = """\
|
||||
Smack for Android.
|
||||
All the required dependencies to run Smack on Android"""
|
||||
|
||||
ext {
|
||||
smackMinAndroidSdk = 8
|
||||
androidProjects = [':smack-tcp',':smack-core', ':smack-resolver-minidns', ':smack-sasl-provided', ':smack-extensions', ':smack-experimental'].collect{ project(it) }
|
||||
}
|
||||
|
||||
// Note that the test dependencies (junit, …) are inferred from the
|
||||
// sourceSet.test of the core subproject
|
||||
dependencies {
|
||||
androidProjects.each { project ->
|
||||
compile project
|
||||
}
|
||||
}
|
||||
|
||||
def getAndroidRuntimeJar() {
|
||||
def androidHome = new File("$System.env.ANDROID_HOME")
|
||||
if (!androidHome.isDirectory()) throw new Exception("ANDROID_HOME not found or set")
|
||||
new File("$androidHome/platforms/android-$smackMinAndroidSdk/android.jar")
|
||||
}
|
||||
|
||||
def getAndroidJavadocOffline() {
|
||||
def androidHome = new File("$System.env.ANDROID_HOME")
|
||||
if (!androidHome.isDirectory()) throw new Exception("ANDROID_HOME not found or set")
|
||||
return "$System.env.ANDROID_HOME" + "/docs/reference"
|
||||
}
|
||||
|
||||
compileJava {
|
||||
options.bootClasspath = getAndroidRuntimeJar()
|
||||
}
|
||||
|
||||
// See http://stackoverflow.com/a/2823592/194894
|
||||
// TODO this doesn't seem to work right now. But on the other hand it
|
||||
// is not really required, just to avoid a javadoc compiler warning
|
||||
javadoc {
|
||||
options.linksOffline "http://developer.android.com/reference", getAndroidJavadocOffline()
|
||||
}
|
||||
|
||||
configure (androidProjects) {
|
||||
task compileAndroid(type: JavaCompile) {
|
||||
source = compileJava.source
|
||||
classpath = compileJava.classpath
|
||||
destinationDir = new File(buildDir, 'android')
|
||||
options.bootClasspath = getAndroidRuntimeJar()
|
||||
}
|
||||
}
|
||||
|
||||
test { dependsOn androidProjects*.compileAndroid }
|
Loading…
Add table
Add a link
Reference in a new issue