This repository has been archived by the owner on Mar 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.gradle
101 lines (82 loc) · 2.43 KB
/
build.gradle
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
apply plugin: 'com.android.library'
apply plugin: 'maven'
def version = 0.4
def PUBLISH_ARTIFACT_ID = 'notification-hubs-android-sdk'
def groupId = 'com.microsoft.azure'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
task clearJar(type: Delete) {
delete 'build/release/' + PUBLISH_ARTIFACT_ID + '-' + version + '.jar'
}
// step 1
task makeJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('build/release/')
include('classes.jar')
rename ('classes.jar', PUBLISH_ARTIFACT_ID + '-' + version + '.jar')
}
makeJar.dependsOn(clearJar, build)
// step 2
uploadArchives {
repositories.mavenDeployer {
pom.groupId = groupId
pom.artifactId = PUBLISH_ARTIFACT_ID
pom.version = version
pom.project {
packaging 'aar'
name 'Notification Hub'
description 'NotificationHub Android SDK'
url 'https://github.com/Azure/azure-notificationhubs'
}
repository (
url: 'https://api.bintray.com/maven/microsoftazuremobile/SDK/Notification-Hubs-Android-SDK'
) {
authentication(
userName: 'bintray username',
password: 'bintray api key'
)
}
}
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives androidSourcesJar
//archives androidJavadocsJar
archives file : file('build/release/' + PUBLISH_ARTIFACT_ID + '-' + version + '.jar')
}