Skip to content

Commit

Permalink
Revert "Move from minSDK 9 to min 14 (eclipse-paho#245)" (eclipse-pah…
Browse files Browse the repository at this point in the history
…o#246)

This reverts commit 2cfc0e6.
  • Loading branch information
jpwsutton authored Oct 4, 2017
1 parent 2cfc0e6 commit b5d5e5e
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 31 deletions.
13 changes: 7 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,18 @@ buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta5'
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

ext{

compileSdkVersion = 26
buildToolsVersion = '26.0.0'
supportLibVersion = '26.1.0'
compileSdkVersion = 24
buildToolsVersion = '23.0.3'


group = 'org.eclipse.paho'
Expand All @@ -32,6 +30,7 @@ ext{

mavenUrl = "https://repo.eclipse.org/content/repositories/paho-releases/"

supportLibVersion = '24.2.1'

}

Expand All @@ -52,14 +51,16 @@ def androidHomeIsDefined = androidHome?.trim()

def sdkDir = androidHomeIsDefined ? androidHome : getSdkDirFromLocalProperties()

println "SDK dir: $sdkDir"


allprojects {

repositories {
jcenter()
maven {
url "file://$sdkDir/extras/android/m2repository/"
}
google()
}

version = rootProject.ext.serviceVersion
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Oct 04 11:50:11 BST 2017
#Tue Jan 24 11:18:55 GMT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
27 changes: 22 additions & 5 deletions org.eclipse.paho.android.sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,22 @@ android {
defaultConfig {
applicationId rootProject.ext.sampleArchivesBaseName
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 24
versionCode 1
versionName "0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
dexOptions {
preDexLibraries = false
}
}

repositories {
Expand All @@ -23,15 +32,23 @@ repositories {


dependencies {
compile project(':org.eclipse.paho.android.service')
// compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
// compile "org.eclipse.paho:org.eclipse.paho.android.service:${rootProject.ext.clientVersion}"

//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 (project(':org.eclipse.paho.android.service')){
//exclude module: "org.eclipse.paho.client.mqttv3"
transitive=true
}
}

task publishAPK(type: Copy) {
from file("${project.buildDir}/outputs/apk/" + rootProject.ext.sampleArchivesBaseName + "-debug.apk");
into '/shared/technology/paho/Android/' + rootProject.ext.sampleVersion + '/debug/';
}


configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
task debug << {
configurations.compile.each { println it}
}
17 changes: 17 additions & 0 deletions org.eclipse.paho.android.sample/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/james/Android/Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
9 changes: 9 additions & 0 deletions org.eclipse.paho.android.sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@


<!-- Permissions the Application Requires -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />


<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
Expand All @@ -27,6 +33,9 @@

</activity>

<!-- Mqtt Service -->
<service android:name="org.eclipse.paho.android.service.MqttService">
</service>
</application>

</manifest>
36 changes: 35 additions & 1 deletion org.eclipse.paho.android.service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@ android {
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 14
minSdkVersion 9
targetSdkVersion 24

testApplicationId "org.eclipse.paho.android.service.test"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dexOptions {
preDexLibraries = false
}

lintOptions {
abortOnError false
Expand All @@ -21,9 +31,14 @@ repositories {
maven { url rootProject.ext.mavenUrl }
}

configurations {
//androidTestCompile.exclude module: 'org.eclipse.paho.client.mqttv3'
}

dependencies {
compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
compile fileTree(include: ['*.jar'], dir: 'libs')
}

android.libraryVariants.all { variant ->
Expand All @@ -47,6 +62,14 @@ task("generateSourcesJar", type: Jar) {
classifier = 'sources'
}

// 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*'
}

// Renames the Release AAR file to a maven convention
task("renameReleaseAAR", type: Copy) {
from("$buildDir/outputs/aar")
Expand Down Expand Up @@ -95,6 +118,17 @@ publishing {
}


task debug << {
configurations.compile.each { println it}
}
// Required to bundle Java library Jar in AAR
clean.doLast{
copyLibs.execute()
}
assemble.doLast {
renameReleaseAAR.execute()
}

clean.doFirst {
delete 'libs'
}
17 changes: 17 additions & 0 deletions org.eclipse.paho.android.service/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/james/Android/Sdk/tools/proguard/proguard-org.eclipse.paho.android.service.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
15 changes: 4 additions & 11 deletions org.eclipse.paho.android.service/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.eclipse.paho.android.service">
<manifest
package="org.eclipse.paho.android.service">

<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />

<application>

<!-- Mqtt Service -->
<service android:name="org.eclipse.paho.android.service.MqttService" />

</application>
<application>
</application>

</manifest>
26 changes: 21 additions & 5 deletions paho.mqtt.android.example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@ android {
defaultConfig {
applicationId "paho.mqtt.java.example"
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
lintOptions {
abortOnError false
}
Expand All @@ -22,12 +31,19 @@ repositories {


dependencies {
compile project(':org.eclipse.paho.android.service')
// compile "org.eclipse.paho:org.eclipse.paho.client.mqttv3:${rootProject.ext.clientVersion}"
// compile "org.eclipse.paho:org.eclipse.paho.android.service:${rootProject.ext.clientVersion}"
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 (project(':org.eclipse.paho.android.service')){
//exclude module: "org.eclipse.paho.client.mqttv3"
transitive=true
}
}

testCompile 'junit:junit:4.12'
configurations.compile.exclude module: 'org.eclipse.paho.client.mqttv3'
task debug << {
configurations.compile.each { println it}
}
17 changes: 17 additions & 0 deletions paho.mqtt.android.example/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/james/Android/Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
9 changes: 8 additions & 1 deletion paho.mqtt.android.example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@


<!-- Permissions the Application Requires -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
Expand All @@ -25,7 +30,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- Mqtt Service -->
<service android:name="org.eclipse.paho.android.service.MqttService">
</service>
</application>

</manifest>

0 comments on commit b5d5e5e

Please sign in to comment.