Skip to content

Commit

Permalink
Merge pull request #513 from Stanllley/master
Browse files Browse the repository at this point in the history
kotlin extension
  • Loading branch information
huanghaibin-dev committed Aug 1, 2019
2 parents 9c873b5 + 7ac4428 commit 8fb4654
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.41'
repositories {
jcenter()
google()
}
dependencies {
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

Expand Down
1 change: 1 addition & 0 deletions kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
29 changes: 29 additions & 0 deletions 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'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api project(':calendarview')
}
21 changes: 21 additions & 0 deletions kotlin/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions kotlin/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<manifest package="com.haibin.calendarview.kotlin" />

12 changes: 12 additions & 0 deletions kotlin/src/main/java/com/haibin/calendarview/Scheme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.haibin.calendarview

/**
*@Author xuyang
*@Email youtouchyang@sina.com
*@Date 2019/7/24.
*@Description
*/
import com.haibin.calendarview.Calendar.Scheme

@Suppress("EXTENSION_SHADOWED_BY_MEMBER")
inline fun<reified T : Any> Scheme.getObj():T = obj as T
3 changes: 3 additions & 0 deletions kotlin/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name" translatable="false">kotlin</string>
</resources>
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':calendarview'
include ':app', ':calendarview', ':kotlin'

0 comments on commit 8fb4654

Please sign in to comment.