-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
164 lines (145 loc) · 5.1 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
157
158
159
160
161
162
163
164
/*
* Materialfields
* Copyright (c) 2020 by gabrielepmattia, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
// Library top buildscript
buildscript {
ext.kotlin_version = '1.3.72'
ext.dokka_version = '0.9.16'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
// Library build script
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply from: 'versioning.gradle'
publishing {
publications {
Library(MavenPublication) {
artifact("$buildDir/outputs/aar/materialfields-release.aar")
groupId = 'com.gabrielepmattia.me'
artifactId = 'materialfields'
version = getVersionName()
//The publication doesn't know about our dependencies, so we have to manually add them to the pom
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
configurations.implementation.allDependencies.each {
if (it.name != 'unspecified') {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
}
def getVersionName() throws GradleException {
if (project.hasProperty('publishTrack') && publishTrack == 'production')
return materialfieldsVersionName
else return materialfieldsVersionName + '-beta'
}
def getVcsTag() throws GradleException {
if (project.hasProperty('publishTrack') && publishTrack == 'production')
return 'v' + materialfieldsVersionName
else return 'v' + materialfieldsVersionName + 'b'
}
bintray {
user bintrayUser
key bintrayApiKey
override = true
pkg {
repo = 'maven'
name = 'materialfields'
userOrg = bintrayUser
licenses = ['LGPL-3.0']
issueTrackerUrl = 'https://gitlab.com/gabrielepmattia/materialfields/issues'
desc = 'Android library for creating awesome form fields'
vcsUrl = 'https://gitlab.com/gabrielepmattia/materialfields.git'
publish = true
publicDownloadNumbers = true
version {
name = getVersionName()
vcsTag = getVcsTag()
released = new Date()
}
}
publications = ['Library']
}
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode materialfieldsVersionCode.toInteger()
versionName materialfieldsVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
ext.support_lib_version = '28.0.0-rc02'
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-beta01'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
// 3rd party
implementation 'com.makeramen:roundedimageview:2.3.0'
}
repositories {
mavenCentral()
}
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/javadoc"
includeNonPublic = false
packageOptions {
prefix = "android" // will match kotlin.internal and all sub-packages of it
suppress = true
}
}
task buildWrapper(type: Wrapper) {
gradleVersion = '4.10.1'
}