forked from eclipse-paho/paho.mqtt.android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·106 lines (87 loc) · 2.88 KB
/
Copy pathbuild.gradle
File metadata and controls
executable file
·106 lines (87 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import org.w3c.dom.Node
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
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
}
}
repositories {
maven { url rootProject.ext.mavenUrl }
}
configurations.implementation.setCanBeResolved(true)
configurations.api.setCanBeResolved(true)
configurations {
//androidTestImplementation.exclude module: 'org.eclipse.paho.client.mqttv3'
}
dependencies {
implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
implementation "in.mohalla.paho:in.mohalla.paho.client.mqttv3:1.2.8.mqtt-suback-failure"
}
android.libraryVariants.all { variant ->
}
// Generate Sources Jar
task("generateSourcesJar", type: Jar) {
from android.sourceSets.main.java.srcDirs
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.implementation
into 'libs'
include 'org.eclipse.paho*'
}
// Renames the Release AAR file to a maven convention
task("renameReleaseAAR", type: Copy) {
from("$buildDir/outputs/aar")
into("$buildDir/outputs/aar/")
include('org.eclipse.paho.android.service-debug.aar')
rename('org.eclipse.paho.android.service-debug.aar', rootProject.ext.serviceArchivesBaseName + '-' + rootProject.ext.serviceVersion + '.aar')
}
// Generate Plain Jar Version of library (good for legacy users)
task("generateLibraryJar", type: Jar) {
from("$buildDir/intermediates/classes/release")
}
// Generate Javadoc
task("generateJavaDocJar", type: Jar){
from("$buildDir/docs/javadoc")
classifier = 'javadoc'
}
publishing {
publications {
paho(MavenPublication) {
groupId rootProject.ext.group
artifactId rootProject.ext.serviceArchivesBaseName
artifact "$buildDir/outputs/aar/" + rootProject.ext.serviceArchivesBaseName + "-" + rootProject.ext.serviceVersion + ".aar"
}
}
repositories {
maven {
name = "ShareChatPackages"
url = uri("https://maven.pkg.github.com/ShareChat/paho.mqtt.android")
credentials {
username = System.getenv("GITHUB_USERNAME") ?: "${guser}"
password = System.getenv("GITHUB_PACKAGE_KEY") ?: "${gtoken}"
}
}
}
}
clean.dependsOn('copyLibs')
assemble.dependsOn('renameReleaseAAR')