1
+ apply plugin : ' com.android.library'
2
+ apply plugin : ' kotlin-android'
3
+ apply plugin : ' kotlin-android-extensions'
4
+ apply plugin : ' org.jetbrains.dokka-android'
5
+ apply plugin : ' com.github.dcendents.android-maven'
6
+ apply plugin : " com.jfrog.bintray"
7
+
8
+ group ' org.rekotlin-router'
9
+ version ' 0.1.0'
10
+
11
+ ext {
12
+ junitPlugin_version = ' 1.0.0'
13
+ junit_jupiter_version = ' 5.0.0'
14
+ bintrayRepo = ' rekotlin-router'
15
+ bintrayName = ' rekotlin-router'
16
+
17
+ publishedGroupId = ' org.rekotlinrouter'
18
+ libraryName = ' rekotlin-router'
19
+ artifact = ' rekotlin-router'
20
+ artifactName = ' org.rekotlinrouter:rekotlin-router'
21
+
22
+ libraryDescription = ' A declarative router for ReKotlin. Allows developers to declare routes in a similar manner as URLs are used on the web.'
23
+
24
+ siteUrl = ' https://github.com/kmmraj/rekotlin-router'
25
+ gitUrl = ' https://github.com/kmmraj/rekotlin-router.git'
26
+
27
+ libraryVersion = ' 0.1.0'
28
+
29
+ developerId = ' developerId'
30
+ developerName = ' Mohanraj K.M.'
31
+ developerEmail = ' kmmraj@gmail.com'
32
+
33
+ licenseName = ' MIT'
34
+ licenseUrl = ' https://tldrlegal.com/license/mit-license'
35
+ allLicenses = [" MIT" ]
36
+ }
37
+
38
+ android {
39
+ compileSdkVersion 25
40
+ buildToolsVersion " 26.0.0"
41
+
42
+
43
+ defaultConfig {
44
+ minSdkVersion 16
45
+ targetSdkVersion 25
46
+ versionCode 1
47
+ versionName " 1.0"
48
+
49
+ testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
50
+
51
+ }
52
+ buildTypes {
53
+ debug {
54
+ // TODO: Keep it false until..
55
+ // https://stackoverflow.com/questions/39195754/java-lang-noclassdeffounderror-failed-resolution-of-lorg-jacoco-agent-rt-inter
56
+ testCoverageEnabled = false
57
+ }
58
+ release {
59
+ minifyEnabled false
60
+ testCoverageEnabled = false
61
+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
62
+ }
63
+ }
64
+
65
+ testOptions {
66
+ unitTests. all {
67
+ }
68
+ }
69
+ }
70
+
71
+
72
+ dependencies {
73
+ compile fileTree(dir : ' libs' , include : [' *.jar' ])
74
+ androidTestImplementation(' com.android.support.test.espresso:espresso-core:3.0.1' , {
75
+ exclude group : ' com.android.support' , module : ' support-annotations'
76
+ })
77
+ implementation ' com.android.support:appcompat-v7:25.4.0'
78
+ implementation " org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version "
79
+ // implementation files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
80
+ // TODO: Fix the below mess - compileOnly & testImplementation of rekotlin
81
+ compileOnly ' tw.geothings.rekotlin:rekotlin:0.1.0-SNAPSHOT'
82
+ // compileOnly files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
83
+ // testImplementation files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
84
+ testImplementation ' tw.geothings.rekotlin:rekotlin:0.1.0-SNAPSHOT'
85
+ testImplementation ' junit:junit:4.12'
86
+ testImplementation ' org.mockito:mockito-core:1.10.19'
87
+ testImplementation ' org.assertj:assertj-core:3.6.2'
88
+ testImplementation ' org.powermock:powermock-module-junit4:1.7.0RC2' , ' org.powermock:powermock-api-mockito2:1.7.0RC2'
89
+ testImplementation group : ' com.googlecode.junit-toolbox' , name : ' junit-toolbox' , version : ' 1.10'
90
+ testImplementation ' org.awaitility:awaitility:3.0.0'
91
+ }
92
+
93
+ def siteUrl = ' https://github.com/kmmraj/rekotlin-router' // Homepage URL of the library
94
+ def gitUrl = ' https://github.com/kmmraj/rekotlin-router.git' // Git repository URL
95
+ group = " org.rekotlinrouter" // Maven Group ID for the artifact
96
+
97
+ install {
98
+ repositories. mavenInstaller {
99
+ // This generates POM.xml with proper parameters
100
+ pom {
101
+ project {
102
+ packaging ' aar'
103
+
104
+ // Add your description here
105
+ name ' org.rekotlinrouter:rekotlin-router' // TODO
106
+ description = libraryDescription
107
+ url siteUrl
108
+
109
+ // Set your license
110
+ licenses {
111
+ license {
112
+ name licenseName
113
+ url licenseUrl
114
+ }
115
+ }
116
+ developers {
117
+ developer {
118
+ id developerId
119
+ name developerName
120
+ email developerEmail
121
+ }
122
+ }
123
+ scm {
124
+ connection gitUrl
125
+ developerConnection gitUrl
126
+ url siteUrl
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+
133
+ task sourcesJar (type : Jar ) {
134
+ from android. sourceSets. main. java. srcDirs
135
+ classifier = ' sources'
136
+ }
137
+
138
+ // task javadoc(type: Javadoc) {
139
+ // source = android.sourceSets.main.java.srcDirs
140
+ // classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
141
+ // }
142
+ task dokkaJavadoc (type : org.jetbrains.dokka.gradle.DokkaTask ) {
143
+ outputFormat = ' javadoc'
144
+ outputDirectory = " $buildDir /javadoc"
145
+ inputs. dir ' src/main/java'
146
+ }
147
+
148
+ task javadocJar (type : Jar , dependsOn : dokkaJavadoc) {
149
+ // classifier = 'javadoc'
150
+ // from javadoc.destinationDir
151
+ classifier = ' javadoc'
152
+ from " $buildDir /javadoc"
153
+ }
154
+ artifacts {
155
+ archives javadocJar
156
+ archives sourcesJar
157
+ }
158
+
159
+ Properties properties = new Properties ()
160
+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
161
+
162
+ // https://github.com/bintray/gradle-bintray-plugin
163
+ bintray {
164
+ user = properties. getProperty(" bintray.user" )
165
+ key = properties. getProperty(" bintray.apikey" )
166
+
167
+ configurations = [' archives' ]
168
+ pkg {
169
+ repo = bintrayRepo
170
+ // it is the name that appears in bintray when logged
171
+ name = artifactName
172
+ websiteUrl = siteUrl
173
+ vcsUrl = gitUrl
174
+ licenses = [" MIT" ]
175
+ publish = true
176
+ version {
177
+ gpg {
178
+ sign = true // Determines whether to GPG sign the files. The default is false
179
+ passphrase = properties. getProperty(" bintray.gpg.password" ) // Optional. The passphrase for GPG signing'
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+
186
+ // ------- Start -- //
187
+
188
+ /*
189
+
190
+ task sourcesJar(type: Jar) {
191
+ from android.sourceSets.main.java.srcDirs
192
+ classifier = 'sources'
193
+ }
194
+
195
+ //task copyTestClasses(type: Copy) {
196
+ // from "${buildDir}/tmp/kotlin-classes/debugUnitTest"
197
+ // into "${buildDir}/intermediates/classes/debug"
198
+ //}
199
+
200
+ dependencies {
201
+ implementation fileTree(include: ['*.jar'], dir: 'libs')
202
+
203
+ androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
204
+ exclude group: 'com.android.support', module: 'support-annotations'
205
+ })
206
+ implementation 'com.android.support:appcompat-v7:25.4.0'
207
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
208
+ //implementation files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
209
+ // TODO: Fix the below mess - compileOnly & testImplementation of rekotlin
210
+ compileOnly 'tw.geothings.rekotlin:rekotlin:0.1.0-SNAPSHOT'
211
+ //compileOnly files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
212
+ //testImplementation files('/Users/mkaratadipalayam/mohan/technotes/client/apps/android/kotlin/rekotlin/myFork/ReKotlin/build/libs/rekotlin-0.1.0-SNAPSHOT.jar')
213
+ testImplementation 'tw.geothings.rekotlin:rekotlin:0.1.0-SNAPSHOT'
214
+ testImplementation 'junit:junit:4.12'
215
+ testImplementation 'org.mockito:mockito-core:1.10.19'
216
+ testImplementation 'org.assertj:assertj-core:3.6.2'
217
+ testImplementation 'org.powermock:powermock-module-junit4:1.7.0RC2', 'org.powermock:powermock-api-mockito2:1.7.0RC2'
218
+ testImplementation group: 'com.googlecode.junit-toolbox', name: 'junit-toolbox', version: '1.10'
219
+ testImplementation 'org.awaitility:awaitility:3.0.0'
220
+ }
221
+
222
+
223
+ sourceSets {
224
+ main.java.srcDirs += 'src/main/java'
225
+ }
226
+
227
+ task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
228
+ outputFormat = 'javadoc'
229
+ outputDirectory = "$buildDir/javadoc"
230
+ inputs.dir 'src/main/java'
231
+ }
232
+ task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
233
+ classifier = 'javadoc'
234
+ from "$buildDir/javadoc"
235
+ }
236
+
237
+ //artifacts {
238
+ // // archives aar
239
+ archives sourcesJar
240
+ archives javadocJar
241
+ //}
242
+
243
+ //Add these lines to publish library to bintray
244
+ //Place it at the end of the file
245
+ //apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
246
+ //apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
247
+
248
+ //publishing {
249
+ // publications {
250
+ // maven(MavenPublication) {
251
+ // groupId 'org.rekotlinrouter'
252
+ // artifactId 'rekotlinrouter'
253
+ // from components.java
254
+ //
255
+ // artifact(javadocJar){
256
+ // classifier = 'javadoc'
257
+ // }
258
+ //
259
+ // artifact(sourcesJar){
260
+ // classifier = 'sources'
261
+ // }
262
+ //
263
+ // repositories {
264
+ //
265
+ //
266
+ maven {
267
+ url 's3://rekotlin/snapshots'
268
+ credentials(AwsCredentials) {
269
+ accessKey AWS_ACCESS_KEY // put this in gradle.properties
270
+ secretKey AWS_SECRET_KEY // put this in gradle.properties
271
+ }
272
+ }
273
+ //
274
+ // maven {
275
+ // url "file:/${project.projectDir}/artifacts"
276
+ // }
277
+ // }
278
+ // }
279
+ // }
280
+ //}
281
+
282
+ //dokka {
283
+ // outputFormat = 'html'
284
+ // outputDirectory = "$buildDir/javadoc"
285
+ //}
286
+
287
+ */
0 commit comments