change module name

This commit is contained in:
luyao 2019-06-27 16:53:14 +08:00
parent e9381c468b
commit f4ebd474ff
32 changed files with 130 additions and 79 deletions

View File

@ -39,5 +39,5 @@ dependencies {
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.45-androidx'
implementation 'com.afollestad.material-dialogs:core:3.0.0-rc4'
implementation 'com.afollestad.material-dialogs:files:3.0.0-rc4'
implementation project(path: ':library')
implementation project(path: ':ktx')
}

View File

@ -10,6 +10,7 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.novoda:bintray-release:0.9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

109
ktx/build.gradle Normal file
View File

@ -0,0 +1,109 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'com.novoda.bintray-release'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 15
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'androidx.appcompat:appcompat:1.1.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
api "androidx.core:core-ktx:1.2.0-alpha02"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.afollestad.material-dialogs:core:3.0.0-rc4'
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-alpha01"
api 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
api 'androidx.recyclerview:recyclerview:1.1.0-alpha06'
}
repositories {
mavenCentral()
}
if (project.hasProperty("kotlin")) {
// Disable creating javadocs
tasks.withType(Javadoc) {
enabled = false
}
}
//
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
//Javadoc文档
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
//jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
//javadoc文件
task copyDoc(type: Copy) {
from "${buildDir}/docs/"
into "docs"
}
//JCenter所需要的源码文件
artifacts {
archives javadocJar
archives sourcesJar
}
// JavaDoc
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
// Bintray
publish {
userOrg = 'lulululbj' //bintray.com
groupId = 'luyao.util.ktx' //访 jcenter上此项目的路径
artifactId = 'AndroidUtilKTX' //bintray.com Package
publishVersion = '0.0.1' //
desc = 'temp version' //
website = 'https://github.com/lulululbj/AndroidUtilCodeKTX' //
}

View File

@ -0,0 +1,16 @@
package luyao.util.ktx
import android.app.Application
/**
* Created by luyao
* on 2019/6/19 10:53
*/
class KtxApp : Application() {
override fun onCreate() {
super.onCreate()
}
}

View File

@ -20,9 +20,9 @@ fun Context.getAppInfo(apkPath: String): AppInfo {
val packageName = packageInfo.packageName
val appName =packageManager.getApplicationLabel(packageInfo.applicationInfo).toString()
val versionName = packageInfo.versionName
val versionCode = packageInfo.longVersionCode
val versionCode = packageInfo.versionCode
val icon = packageManager.getApplicationIcon(packageInfo.applicationInfo)
return AppInfo(apkPath,packageName,versionName,versionCode,appName,icon)
return AppInfo(apkPath,packageName,versionName, versionCode.toLong(),appName,icon)
}
fun Context.getAppInfos(apkFolderPath:String):List<AppInfo>{

View File

@ -1,54 +0,0 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 15
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
api "androidx.core:core-ktx:1.2.0-alpha02"
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'com.afollestad.material-dialogs:core:3.0.0-rc4'
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1"
api "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0-alpha01"
api 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha06'
implementation 'com.jeremyliao:live-event-bus-x:1.4.4'
}
repositories {
mavenCentral()
}

View File

@ -1,21 +0,0 @@
package luyao.util.ktx
import android.app.Application
import com.jeremyliao.liveeventbus.LiveEventBus
/**
* Created by luyao
* on 2019/6/19 10:53
*/
class KtxApp : Application() {
override fun onCreate() {
super.onCreate()
LiveEventBus.get()
.config()
.supportBroadcast(this)
.lifecycleObserverAlwaysActive(true)
.autoClear(false)
}
}

View File

@ -1 +1 @@
include ':app', ':library'
include ':app', ':ktx'