Skip to content

Commit e5431e6

Browse files
author
fuzzagrosner
committed
[deployment] add delploying instructions.
1 parent 3f85028 commit e5431e6

File tree

8 files changed

+135
-22
lines changed

8 files changed

+135
-22
lines changed

LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2017 Andrew Grosner
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ holder.unbindAll() // when done, unbind
4444

4545
```
4646

47+
## Including in your project
48+
49+
```gradle
50+
51+
allProjects {
52+
repositories {
53+
// required to find the project's artifacts
54+
maven { url "https://www.jitpack.io" }
55+
}
56+
}
57+
```
58+
59+
```gradle
60+
compile 'org.jetbrains.anko:anko-sdk15:0.9.1' // current version of anko used
61+
compile 'com.github.agrosner.KBinding:kbinding:1.0' // version of KPoet
62+
```
63+
4764
## Getting Started
4865

4966
KBinding works best with [Anko](https://github.com/Kotlin/anko), but can be used by other consumers.

bintray-upload.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* This task will generate the pom.xml file and install the AAR to the local M2 repo
3+
*/
4+
install {
5+
repositories {
6+
mavenInstaller {
7+
pom.artifactId = bt_artifact_id
8+
pom {
9+
project {
10+
packaging bt_packaging
11+
name bt_name
12+
url bt_siteUrl
13+
14+
licenses {
15+
license {
16+
name bt_licenseName
17+
url bt_licenseUrl
18+
}
19+
}
20+
21+
scm {
22+
connection bt_gitUrl
23+
developerConnection bt_gitUrl
24+
url bt_siteUrl
25+
}
26+
}
27+
}
28+
}
29+
}
30+
}

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ buildscript {
88
dependencies {
99
classpath 'com.android.tools.build:gradle:2.3.1'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11+
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1112

1213
// NOTE: Do not place your application dependencies here; they belong
1314
// in the individual module build.gradle files

gradle.properties

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
# Project-wide Gradle settings.
2-
3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
6-
7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
org.gradle.jvmargs=-Xmx1536m
13-
14-
# When configured, Gradle will run in incubating parallel mode.
15-
# This option should only be used with decoupled projects. More details, visit
16-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17-
# org.gradle.parallel=true
1+
version=1.0.0
2+
version_code=1
3+
group=com.grosner
4+
bt_siteUrl=https://github.com/agrosner/KBinding
5+
bt_gitUrl=https://github.com/agrosner/KBinding.git
6+
bt_licenseName=The MIT License
7+
bt_licenseUrl=http://opensource.org/licenses/MIT
8+
bt_repo=Libraries
9+
bt_packaging=jar
10+
bt_name=kbinding

kotlin-artifacts.gradle

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apply plugin: 'com.github.dcendents.android-maven'
2+
3+
install {
4+
repositories.mavenInstaller {
5+
pom {
6+
project {
7+
packaging bt_packaging
8+
name bt_name
9+
url bt_siteUrl
10+
licenses {
11+
license {
12+
name bt_licenseName
13+
url bt_licenseUrl
14+
}
15+
}
16+
scm {
17+
connection bt_gitUrl
18+
developerConnection bt_gitUrl
19+
url bt_siteUrl
20+
}
21+
}
22+
}
23+
}
24+
}
25+
26+
// restore when found.
27+
/*task sourcesJar(type: Jar, dependsOn: classes) {
28+
classifier = 'sources'
29+
from sourceSets.main.allSource
30+
}*/
31+
32+
/*task javadocJar(type: Jar, dependsOn: javadoc) {
33+
classifier = 'javadoc'
34+
from javadoc.destinationDir
35+
}*/
36+
37+
artifacts {
38+
//archives sourcesJar
39+
//archives javadocJar
40+
}

okbinding/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ dependencies {
3636
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
3737
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
3838

39-
compile 'com.android.support:appcompat-v7:25.3.1'
4039
compile 'org.jetbrains.anko:anko-sdk15:0.9.1'
41-
compile 'org.jetbrains.anko:anko-support-v4:0.9.1'
4240
}
41+
42+
apply from: '../kotlin-artifacts.gradle'

okbinding/src/main/java/com/andrewgrosner/okbinding/viewextensions/ViewExtensions.kt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.andrewgrosner.okbinding.viewextensions
22

3-
import android.support.v4.content.ContextCompat
3+
import android.graphics.drawable.Drawable
4+
import android.os.Build
45
import android.view.View
56

67
fun View.setVisibilityIfNeeded(visibility: Int) {
@@ -19,6 +20,18 @@ fun View.boolean(resId: Int) = context.resources.getBoolean(resId)
1920

2021
fun View.text(resId: Int) = context.getText(resId)!!
2122

22-
fun View.color(colorRes: Int) = ContextCompat.getColor(context, colorRes)
23+
fun View.color(colorRes: Int): Int {
24+
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
25+
context.getColor(colorRes)
26+
} else {
27+
resources.getColor(colorRes)
28+
}
29+
}
2330

24-
fun View.drawable(drawableRes: Int) = ContextCompat.getDrawable(context, drawableRes)!!
31+
fun View.drawable(drawableRes: Int): Drawable {
32+
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
33+
context.getDrawable(drawableRes)!!
34+
} else {
35+
resources.getDrawable(drawableRes)
36+
}
37+
}

0 commit comments

Comments
 (0)