-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
97 lines (84 loc) · 2.53 KB
/
build.gradle
File metadata and controls
97 lines (84 loc) · 2.53 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
apply plugin: 'com.android.library'
apply plugin: 'maven'
//-------------------------------
// 1. enter current lib version
def libVersion = "2.0.1"
// 2. ./gradlew buildAll
// 3. ./gradlew bintrayUpload
//-------------------------------
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
minSdkVersion 1
targetSdkVersion 25
versionCode 1
versionName libVersion
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
libraryVariants.all { variant ->
variant.outputs.each { output ->
def newName = "switchlog-${libVersion}.aar"
output.outputFile = new File(output.outputFile.parent, newName)
}
}
}
}
}
task generatePom {
doLast {
pom {
project {
groupId 'ru.maxost'
artifactId 'switchlog'
version libVersion
packaging 'aar'
}
}.writeTo("build/outputs/aar/switchlog-${libVersion}.pom")
}
}
task generateSources(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
archiveName "switchlog-${libVersion}-sources.jar"
destinationDir = file("build/outputs/aar/")
}
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty('bintray.user')
key = properties.getProperty('bintray.apikey')
filesSpec {
from ('switchlog/build/outputs/aar/') {
include "switchlog-${libVersion}.aar"
include "switchlog-${libVersion}.pom"
include "switchlog-${libVersion}-sources.jar"
}
into "ru/maxost/switchlog/${libVersion}/"
}
publish = true
pkg {
repo = 'maven'
name = 'switchlog'
userOrg = 'testorg14'
websiteUrl = 'https://github.com/maxost/switchlog'
vcsUrl = 'https://github.com/maxost/switchlog'
licenses = ['Apache-2.0']
publicDownloadNumbers = true
version {
name = libVersion
}
}
}
task buildAll {
dependsOn 'clean'
dependsOn 'build'
dependsOn 'generatePom'
dependsOn 'generateSources'
tasks.findByName('build').mustRunAfter 'clean'
tasks.findByName('generatePom').mustRunAfter 'build'
tasks.findByName('generateSources').mustRunAfter 'generatePom'
}