forked from halfhp/androidplot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
181 lines (155 loc) · 5 KB
/
build.gradle
File metadata and controls
181 lines (155 loc) · 5 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/*
* Copyright 2015 AndroidPlot.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.vanniktech.android.junit.jacoco'
apply plugin: 'com.github.kt3k.coveralls'
class AttrMarkdown extends DefaultTask {
def inFile
def outFile
@TaskAction
def generate() {
def input = project.file(inFile)
def output = project.file(outFile)
if(output.exists()) {
output.delete()
}
output.parentFile.mkdirs()
input.text.findAll(/<!--\n?([\s\S]*?)\n?-->/) { match, g1 -> g1
if(!g1.startsWith("NODOC")) {
output.append(g1)
output.append "\n\n"
}
}
}
}
/**
* Generates xml attrs markdown docs. To run:
* at the command line from the project root dir type:
* ./gradlew generateAttrsMarkdown
*
* The generated doc will appear in / replace androidplot/docs/attrs.md
*/
task generateAttrsMarkdown(type: AttrMarkdown) {
inFile = { "src/main/res/values/attrs.xml"}
outFile = { "../docs/attrs.md" }
}
android {
compileSdkVersion theCompileSdkVersion
defaultConfig {
versionCode theVersionCode
versionName theVersionName
minSdkVersion theMinSdkVersion
targetSdkVersion theTargetSdkVersion
testApplicationId "com.androidplot.test"
}
/**
* TODO: enable and address lint issues.
*/
lintOptions {
abortOnError false
}
}
group = 'com.androidplot'
version = theVersionName
def siteUrl = 'http://androidplot.com'
def gitUrl = 'https://github.com/halfhp/androidplot.git'
dependencies {
compile 'com.halfhp.fig:figlib:1.0.7'
compile 'com.android.support:support-annotations:27.0.2'
testCompile "org.mockito:mockito-core:1.10.19"
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile "org.robolectric:robolectric:3.1"
// temp fix for:
// https://github.com/robolectric/robolectric/issues/1932
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
failOnError false
options {
links "http://docs.oracle.com/javase/7/docs/api/"
linksOffline "http://d.android.com/reference","${android.sdkDirectory}/docs/reference"
}
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
name 'Androidplot Core Library'
description = "Androidplot is a library for creating dynamic and static charts within your Android application."
url siteUrl
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'halfhp'
name 'Nick Fellows'
email '[email protected]'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
bintray {
// these environment vars must be set when deploying to bintray.
// note: BINTRAY_PASSWORD is actually the api key, but naming it 'password'
// tells the CI environment to obfuscate the value in public logs.
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_PASSWORD')
configurations = ['archives']
pkg {
version {
name = theVersionName
}
repo = "androidplot"
name = "com.androidplot:androidplot-core"
issueTrackerUrl = "https://github.com/halfhp/androidplot/issues"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
}
}
javadoc {
options.overview = "src/main/java/overview.html"
}
artifacts {
archives javadocJar
archives sourcesJar
}