Separating the service out in the project (#76)

* Making sure that the service is build as a full project

Signed-off-by: James Sutton <james.sutton@uk.ibm.com>

* Changing build to ensure that service is built first

Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
This commit is contained in:
James Sutton 2016-04-21 13:16:10 +01:00
parent a7fe8fd2a6
commit 07f1b41bb7
5 changed files with 33 additions and 7 deletions

View File

@ -14,4 +14,7 @@ before_script:
- android-wait-for-emulator
- adb shell input keyevent 82 &
script: ./gradlew clean assemble connectedCheck
script:
- ./gradlew clean
- ./gradlew org.eclipse.paho.android.service:assemble org.eclipse.paho.android.service:connectedCheck
- ./gradlew org.eclipse.paho.android.sample:assemble paho.mqtt.android.example:assemble

View File

@ -21,6 +21,9 @@ android {
lintOptions {
abortOnError false
}
dexOptions {
preDexLibraries = false
}
}
repositories {
@ -30,11 +33,13 @@ repositories {
dependencies {
//compile fileTree(dir: '../org.eclipse.paho.android/service/libs', excludes: ["org.eclipse.paho.client.mqttv3-${rootProject.ext.clientVersion}.jar"], include: '')
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
//compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
compile (project(':org.eclipse.paho.android.service')){
exclude group: "org.eclipse.paho"
//exclude module: "org.eclipse.paho.client.mqttv3"
transitive=true
}
}
@ -44,3 +49,7 @@ task publishAPK(type: Copy) {
}
configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
task debug << {
configurations.compile.each { println it}
}

View File

@ -64,6 +64,7 @@ task("generateSourcesJar", type: Jar) {
// Copy the Paho Java client into the libs directory to bundle it with the AAR
task("copyLibs", type: Copy) {
println "Copying MQTT Jar into libs directory"
from configurations.compile
into 'libs'
include 'org.eclipse.paho*'
@ -117,7 +118,9 @@ publishing {
}
task debug << {
configurations.compile.each { println it}
}
// Required to bundle Java library Jar in AAR
preBuild.doLast{
copyLibs.execute()

View File

@ -17,6 +17,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
}
repositories {
@ -25,12 +28,19 @@ repositories {
dependencies {
compile fileTree(dir: 'libs', excludes: ["org.eclipse.paho.client.mqttv3-${rootProject.ext.clientVersion}.jar"], include: '*.jar')
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
//compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
compile (project(':org.eclipse.paho.android.service')){
exclude group: "org.eclipse.paho"
//exclude module: "org.eclipse.paho.client.mqttv3"
transitive=true
}
}
configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
task debug << {
configurations.compile.each { println it}
}

View File

@ -1,3 +1,4 @@
include ':org.eclipse.paho.android.sample', ':org.eclipse.paho.android.service',':paho.mqtt.android.example'
include ':org.eclipse.paho.android.service',':org.eclipse.paho.android.sample',':paho.mqtt.android.example'
project(':org.eclipse.paho.android.service').projectDir = new File('org.eclipse.paho.android.service')
project(':paho.mqtt.android.example').projectDir = new File('paho.mqtt.android.example')
project(':org.eclipse.paho.android.sample').projectDir = new File('org.eclipse.paho.android.sample')