Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin module #147

Merged
merged 25 commits into from
Sep 12, 2017
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies {
compile project(':emoji-google-compat')
compile project(':emoji-twitter')
compile project(':emoji-one')
compile project(':emoji-kotlin')

compile rootProject.ext.supportAppCompat
compile rootProject.ext.supportRecyclerView
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'com.vanniktech.code.quality.tools'
apply plugin: 'com.vanniktech.android.junit.jacoco'

buildscript {
ext.kotlin_version = '1.1.4-3'
ext.versions = [
espresso: '3.0.1',
testRules: '1.0.1',
Expand Down Expand Up @@ -31,6 +32,7 @@ buildscript {

classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand All @@ -56,7 +58,8 @@ codeQualityTools {
}

junitJacoco {
ignoreProjects = ['app', 'emoji-ios', 'emoji-google', 'emoji-twitter', 'emoji-one', 'emoji-compat'] // Don't care about sample and generated modules
// Don't care about sample and generated modules
ignoreProjects = ['app', 'emoji-ios', 'emoji-google', 'emoji-twitter', 'emoji-one', 'emoji-compat', 'emoji-kotlin']
}

subprojects {
Expand Down
1 change: 1 addition & 0 deletions emoji-kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
29 changes: 29 additions & 0 deletions emoji-kotlin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion rootProject.ext.compileSdkVersion as int
buildToolsVersion rootProject.ext.buildToolsVersion as String

compileOptions {
sourceCompatibility rootProject.ext.javaVersion as JavaVersion
targetCompatibility rootProject.ext.javaVersion as JavaVersion
}

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion as int
}

resourcePrefix 'emoji'

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you just do everything in src/main/java?

}
}

dependencies {
compile project(':emoji')
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 3 additions & 0 deletions emoji-kotlin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=Emoji
POM_ARTIFACT_ID=emoji-kotlin
POM_PACKAGING=aar
1 change: 1 addition & 0 deletions emoji-kotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest package="com.vanniktech.emoji.kotlin" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.vanniktech.emoji.kotlin

import com.vanniktech.emoji.EmojiUtils

fun String.isOnlyEmojis() = EmojiUtils.isOnlyEmojis(this)

fun String.emojisCount() = EmojiUtils.emojisCount(this)
1 change: 1 addition & 0 deletions gradle/gradle-mvn-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ afterEvaluate { project ->
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
excludes = ['**/*.kt']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this fixed the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, basically ignoring Kotlin files for javadoc generation.


if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':emoji', ':emoji-ios', ':emoji-google', ':emoji-twitter', ':emoji-one', ':emoji-google-compat'
include ':app', ':emoji', ':emoji-ios', ':emoji-google', ':emoji-twitter', ':emoji-one', ':emoji-google-compat', ':emoji-kotlin'