@@ -5,9 +5,17 @@ apply plugin: 'kotlin-kapt'
5
5
apply plugin : ' kotlinx-serialization'
6
6
apply plugin : ' maven'
7
7
apply plugin : ' com.github.dcendents.android-maven'
8
+ apply plugin : ' org.jetbrains.dokka'
9
+ apply plugin : ' com.jfrog.bintray'
8
10
9
- version = " 1.0.0-SNAPSHOT"
10
- group = " com.pnuema.android.obd"
11
+ version = " 1.0.0"
12
+ group = " com.pnuema.android"
13
+
14
+ ext {
15
+ siteUrl = ' https://github.com/barnhill/AndroidOBD'
16
+ gitUrl = ' https://github.com/barnhill/AndroidOBD.git'
17
+ descr = ' Android library to communicate with ELM327 based OBD devices'
18
+ }
11
19
12
20
android {
13
21
compileSdkVersion 30
@@ -16,7 +24,7 @@ android {
16
24
minSdkVersion 17
17
25
targetSdkVersion 30
18
26
versionCode 1
19
- versionName " 1.0 "
27
+ versionName version
20
28
}
21
29
22
30
buildTypes {
@@ -43,11 +51,24 @@ dependencies {
43
51
implementation " androidx.startup:startup-runtime:1.0.0"
44
52
}
45
53
54
+ dokkaHtml. configure {
55
+ dokkaSourceSets {
56
+ named(" main" ) {
57
+ noAndroidSdkLink. set(false )
58
+ }
59
+ }
60
+ }
61
+
46
62
task sourcesJar (type : Jar ) {
47
63
classifier = ' sources'
48
64
from android. sourceSets. main. java. srcDirs
49
65
}
50
66
67
+ task javadocJar (type : Jar , dependsOn : dokkaJavadoc) {
68
+ classifier = ' javadoc'
69
+ from dokkaJavadoc. outputDirectory
70
+ }
71
+
51
72
task javadoc (type : Javadoc ) {
52
73
source = android. sourceSets. main. java. srcDirs
53
74
classpath + = project. files(android. getBootClasspath(). join(File . pathSeparator))
@@ -56,5 +77,116 @@ task javadoc(type: Javadoc) {
56
77
}
57
78
58
79
artifacts {
80
+ archives javadocJar
59
81
archives sourcesJar
60
- }
82
+ }
83
+
84
+ install {
85
+ repositories. mavenInstaller {
86
+ // This generates POM.xml with proper parameters
87
+ pom {
88
+ project {
89
+ packaging ' aar'
90
+
91
+ // Add your description here
92
+ name ' com.pnuema.android:obd'
93
+ description = descr
94
+ url siteUrl
95
+
96
+ // Set your license
97
+ licenses {
98
+ license {
99
+ name ' The Apache Software License, Version 2.0'
100
+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
101
+ }
102
+ }
103
+ developers {
104
+ developer {
105
+ id ' bbarnhill'
106
+ name ' Brad Barnhill'
107
+
108
+ }
109
+ }
110
+ scm {
111
+ connection gitUrl
112
+ developerConnection gitUrl
113
+ url siteUrl
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ bintray {
121
+ if (System . getenv(" BINTRAY_USER" ) != null )
122
+ user = System . getenv(" BINTRAY_USER" )
123
+ else
124
+ user = BINTRAY_USER
125
+
126
+ if (System . getenv(" BINTRAY_APIKEY" ) != null )
127
+ key = System . getenv(" BINTRAY_APIKEY" )
128
+ else
129
+ key = BINTRAY_APIKEY
130
+
131
+ dryRun = false // [Default: false] Whether to run this as dry-run, without deploying
132
+ publish = true // [Default: false] Whether version should be auto published after an upload
133
+ override = false // [Default: false] Whether to override version artifacts already published
134
+ pkg {
135
+ configurations = [' archives' ]
136
+ repo = " maven"
137
+ name = " obd"
138
+ desc = descr
139
+ websiteUrl = " https://github.com/barnhill/AndroidOBD"
140
+ githubRepo = ' barnhill/AndroidOBD'
141
+ githubReleaseNotesFile = ' README.md'
142
+ issueTrackerUrl = ' https://github.com/barnhill/AndroidOBD/issues'
143
+ vcsUrl = " https://github.com/barnhill/AndroidOBD.git"
144
+ licenses = [" Apache-2.0" ]
145
+ labels = [' android' , ' obd' , ' obdII' , ' diagnostics' , ' onboard' , ' aar' , ' android' ]
146
+ publicDownloadNumbers = true
147
+ publish = true
148
+ version {
149
+ gpg {
150
+ sign = true
151
+ if (System . getenv(" BINTRAY_GPGPASSWORD" ) != null )
152
+ passphrase = System . getenv(" BINTRAY_GPGPASSWORD" )
153
+ else
154
+ passphrase = BINTRAY_GPGPASSWORD
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ task createPom {
161
+ pom {
162
+ project {
163
+ packaging ' aar'
164
+
165
+ name project. name
166
+ description descr
167
+ url siteUrl
168
+ inceptionYear ' 2018'
169
+
170
+ licenses {
171
+ license {
172
+ name ' The Apache Software License, Version 2.0'
173
+ url ' http://www.apache.org/licenses/LICENSE-2.0.txt'
174
+ }
175
+ }
176
+ scm {
177
+ connection gitUrl
178
+ developerConnection gitUrl
179
+ url siteUrl
180
+ }
181
+ developers {
182
+ developer {
183
+ id ' barnhill'
184
+ name ' Brad Barnhill'
185
+
186
+ }
187
+ }
188
+ }
189
+ }. writeTo(" $buildDir /poms/pom-default.xml" ). writeTo(" pom.xml" )
190
+ }
191
+ build. dependsOn createPom
192
+ build. dependsOn dokkaJavadoc
0 commit comments