change module name
This commit is contained in:
parent
e9381c468b
commit
f4ebd474ff
|
|
@ -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')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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' //关于这个开源项目的网站,随意
|
||||
}
|
||||
|
|
@ -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()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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>{
|
||||
|
|
@ -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()
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
include ':app', ':library'
|
||||
include ':app', ':ktx'
|
||||
|
|
|
|||
Loading…
Reference in New Issue