-
-
Notifications
You must be signed in to change notification settings - Fork 146
/
build.gradle
156 lines (135 loc) · 4.47 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.jetbrains.dokka-android'
// Required by bintray
// archivesBaseName is required if artifactId is different from gradle module name
// or you can add baseName to each archive task (sources, javadoc, aar)
version = '1.5.0'
group = 'com.otaliastudios'
archivesBaseName = 'zoomlayout'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api "androidx.annotation:annotation:1.0.1"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.1"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.1"
}
install {
repositories.mavenInstaller {
pom.project {
name 'ZoomLayout'
description 'A View container that supports zooming and panning of View hierarchies and more.'
url 'https://github.com/natario1/ZoomLayout'
packaging 'aar'
groupId project.group
artifactId 'zoomlayout'
version project.version
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection 'https://github.com/natario1/ZoomLayout.git'
developerConnection 'https://github.com/natario1/ZoomLayout.git'
url 'https://github.com/natario1/ZoomLayout'
}
developers {
developer {
id = 'natario'
name 'Natario'
}
}
}
}
}
def bintrayUser
def bintrayKey
def hasBintray = false
if (System.getenv('TRAVIS') == 'true') {
if (System.getenv('TRAVIS_SECURE_ENV_VARS') == 'true') {
bintrayUser = System.getenv("BINTRAY_USER")
bintrayKey = System.getenv("BINTRAY_KEY")
hasBintray = true
}
} else {
Properties props = new Properties()
props.load(project.rootProject.file('local.properties').newDataInputStream())
bintrayUser = props.getProperty('bintray.user')
bintrayKey = props.get('bintray.key')
hasBintray = true
}
if (hasBintray) {
bintray {
// https://github.com/bintray/gradle-bintray-plugin
user = bintrayUser
key = bintrayKey
configurations = ['archives']
pkg {
repo = 'android'
name = 'ZoomLayout'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/natario1/ZoomLayout.git'
publish = true
override = true
version {
name = project.version
desc = 'ZoomLayout v. '+project.version
released = new Date()
vcsTag = 'v'+project.version
}
}
}
}
// From official sample https://github.com/bintray/bintray-examples/blob/master/gradle-aar-example/build.gradle
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += project.files("${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
project.android.libraryVariants.all { variant ->
if (variant.name == 'release') {
classpath += files(variant.javaCompile.classpath)
}
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
exclude '**/internal/**'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task dokkaJar(type: Jar, dependsOn: dokka) {
classifier = 'javadoc'
from dokka.outputDirectory
}
artifacts {
archives dokkaJar
archives sourcesJar
}
repositories {
mavenCentral()
}
// export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
// To deploy ./gradlew bintrayUpload