Skip to content

Commit 9453bde

Browse files
authored
Merge pull request #3 from skydoves/feature/whatif-android
Separate to whatIf and whatIf-android module
2 parents 63b2361 + 99704f2 commit 9453bde

20 files changed

Lines changed: 120 additions & 73 deletions

File tree

.github/workflows/android.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
branches:
9+
- master
710

811
jobs:
912
build:

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
Add a dependency code to your **module**'s `build.gradle` file.
2626
```gradle
2727
dependencies {
28-
implementation "com.github.skydoves:whatif:1.0.5"
28+
implementation "com.github.skydoves:whatif:1.0.6"
29+
implementation "com.github.skydoves:whatif-android:1.0.6" // for android extensions
2930
}
3031
```
3132

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ dependencies {
1919
implementation "androidx.appcompat:appcompat:$versions.androidxAppcompat"
2020
implementation "com.github.skydoves:balloon:$versions.balloon"
2121
implementation project(":whatif")
22+
implementation project(":whatif-android")
2223
}
2324

2425
apply from: '../spotless.gradle'

build.gradle

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
buildscript {
2-
apply from: './dependencies.gradle'
3-
repositories {
4-
google()
5-
jcenter()
6-
}
7-
dependencies {
8-
classpath "com.android.tools.build:gradle:$versions.gradleBuildTool"
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
10-
classpath "com.diffplug.spotless:spotless-plugin-gradle:$versions.spotlessGradle"
11-
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokkaGradle"
12-
classpath "com.novoda:bintray-release:$versions.bintrayRelease"
13-
}
2+
apply from: './dependencies.gradle'
3+
repositories {
4+
google()
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath "com.android.tools.build:gradle:$versions.gradleBuildTool"
9+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
10+
classpath "com.diffplug.spotless:spotless-plugin-gradle:$versions.spotlessGradle"
11+
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$versions.dokkaGradle"
12+
classpath "com.novoda:bintray-release:$versions.bintrayRelease"
13+
}
1414
}
1515

1616
allprojects {
17-
repositories {
18-
google()
19-
jcenter()
20-
}
17+
repositories {
18+
google()
19+
jcenter()
20+
}
2121
}
2222

2323
task clean(type: Delete) {
24-
delete rootProject.buildDir
24+
delete rootProject.buildDir
2525
}

dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ ext.versions = [
22
minSdkLib : 15,
33
minSdkDemo : 16,
44
compileSdk : 29,
5-
versionCode : 6,
6-
versionName : '1.0.5',
5+
versionCode : 7,
6+
versionName : '1.0.6',
77

88
gradleBuildTool : '3.6.3',
99
spotlessGradle : '4.5.1',

publish.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
apply plugin: 'com.novoda.bintray-release'
22
apply from: '../dependencies.gradle'
33

4-
publish {
5-
userOrg = 'devmagician'
6-
groupId = 'com.github.skydoves'
7-
artifactId = 'whatif'
8-
publishVersion = versions.versionName
9-
desc = 'WhatIf is kotlin extensions for expressing a single if-else statement, nullable and boolean.'
10-
website = 'https://github.com/skydoves/WhatIf'
11-
issueTracker = "${website}/issues"
12-
repository = "${website}.git"
4+
ext {
5+
metadata = [
6+
userOrg : 'devmagician',
7+
groupId : 'com.github.skydoves',
8+
publishVersion: versions.versionName,
9+
desc : 'WhatIf is kotlin extensions for expressing a single if-else statement, nullable and boolean.',
10+
website : 'https://github.com/skydoves/WhatIf',
11+
issueTracker : '${website}/issues',
12+
repository : 'https://github.com/skydoves/WhatIf.git',
13+
licences : ['Apache-2.0']]
1314
}

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
include ':whatif-android'
12
include ':app', ':whatif'
23
rootProject.name='WhatifDemo'

whatif-android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

whatif-android/build.gradle

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'org.jetbrains.dokka'
4+
apply from: '../dependencies.gradle'
5+
apply from: '../publish.gradle'
6+
7+
android {
8+
compileSdkVersion versions.compileSdk
9+
defaultConfig {
10+
minSdkVersion versions.minSdkLib
11+
targetSdkVersion versions.compileSdk
12+
versionCode versions.versionCode
13+
versionName versions.versionName
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15+
}
16+
testOptions {
17+
unitTests {
18+
includeAndroidResources = true
19+
}
20+
}
21+
}
22+
23+
publish {
24+
artifactId = 'whatif-android'
25+
userOrg = metadata.userOrg
26+
groupId = metadata.groupId
27+
publishVersion = metadata.publishVersion
28+
desc = metadata.desc
29+
website = metadata.website
30+
issueTracker = metadata.issueTracker
31+
repository = metadata.repository
32+
licences = metadata.licences
33+
}
34+
35+
36+
dependencies {
37+
api project(":whatif")
38+
39+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin"
40+
implementation "androidx.appcompat:appcompat:$versions.androidxAppcompat"
41+
42+
testImplementation "junit:junit:$versions.junit"
43+
testImplementation "org.robolectric:robolectric:$versions.robolectric"
44+
}
45+
46+
dokka {
47+
outputFormat = 'html'
48+
outputDirectory = "$buildDir/javadoc"
49+
configuration {
50+
moduleName = 'whatif'
51+
}
52+
}
53+
54+
tasks.withType(Javadoc) {
55+
excludes = ['**/*.kt']
56+
options.addBooleanOption('Xdoclint:none', true)
57+
}
58+
59+
apply from: '../spotless.gradle'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<manifest package="com.skydoves.whatif_android" />

0 commit comments

Comments
 (0)