Skip to content

Commit 41a3447

Browse files
author
liabao
committed
[feat] 项目kts改造
1 parent 1a94a9d commit 41a3447

30 files changed

+576
-78
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 10 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AutoRegister/build.gradle

Lines changed: 0 additions & 51 deletions
This file was deleted.

CoroutineSupport/build.gradle.kts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
2+
3+
plugins {
4+
id("com.android.library")
5+
id("kotlin-android")
6+
}
7+
8+
android {
9+
compileSdkVersion(29)
10+
11+
defaultConfig {
12+
minSdkVersion(21)
13+
targetSdkVersion(29)
14+
versionCode(1)
15+
versionName("1.0")
16+
17+
testInstrumentationRunner("androidx.test.runner.AndroidJUnitRunner")
18+
consumerProguardFiles("consumer-rules.pro")
19+
}
20+
21+
buildTypes {
22+
getByName("release") {
23+
minifyEnabled(false)
24+
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
25+
}
26+
}
27+
compileOptions {
28+
sourceCompatibility(JavaVersion.VERSION_1_8)
29+
targetCompatibility(JavaVersion.VERSION_1_8)
30+
}
31+
kotlinOptions {
32+
jvmTarget = 1.8.toString()
33+
}
34+
}
35+
36+
dependencies {
37+
implementation("org.jetbrains.kotlin:kotlin-stdlib:${getKotlinPluginVersion()}")
38+
implementation("androidx.core:core-ktx:1.3.2")
39+
implementation("androidx.appcompat:appcompat:1.2.0")
40+
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.0")
41+
testImplementation("junit:junit:4.+")
42+
androidTestImplementation("androidx.test.ext:junit:1.1.2")
43+
androidTestImplementation("androidx.test.espresso:espresso-core:3.3.0")
44+
implementation(project(":RouterAnnotation"))
45+
implementation(project(":RouterLib"))
46+
}
47+
//version = PROJ_VERSION
48+
//group = PROJ_GROUP // Maven Group ID for the artifact,一般填你唯一的包名

CoroutineSupport/nexus.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nexus_artifactId=CoroutineSupport
2+
nexus_description=CoroutineSupport
3+
nexus_fileName=CoroutineSupport
4+
nexus_type=library
5+
nexus_url=https://github.com/Leifzhang/AndroidAutoTrack
6+

CoroutineSupport/proguard-rules.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add project specific ProGuard rules here.
22
# You can control the set of applied configuration files using the
3-
# proguardFiles setting in build.gradle.
3+
# proguardFiles setting in build.gradle.kts.kts.kts.
44
#
55
# For more details, see
66
# http://developer.android.com/guide/developing/tools/proguard.html

EmptyLoader/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
2+
3+
plugins {
4+
id("java-library")
5+
id("kotlin")
6+
}
7+
dependencies {
8+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinPluginVersion()}")
9+
}

EmptyLoader/nexus.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nexus_artifactId=EmptyLoader
2+
nexus_description=EmptyLoader
3+
nexus_fileName=EmptyLoader
4+
nexus_type=library
5+
nexus_url=https://github.com/Leifzhang/AndroidAutoTrack
6+

Plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = "1.4.10"
3+
ext.kotlin_version = "1.4.30"
44
repositories {
55
google()
66
jcenter()

RouterAnnotation/build.gradle.kts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
plugins {
2+
id("java-library")
3+
id("kotlin")
4+
id("com.github.dcendents.android-maven")
5+
id("com.jfrog.bintray")
6+
}
7+
8+
dependencies {
9+
// implementation fileTree(dir: 'libs', include: ['*.jar'])
10+
}
11+
/*
12+
13+
sourceCompatibility = "1.7"
14+
targetCompatibility = "1.7"
15+
def siteUrl = 'https://github.com/Leifzhang/AndroidRouter' // 项目的主页
16+
def gitUrl = 'https://github.com/Leifzhang/AndroidRouter.git' // Git仓库的url
17+
group = PROJ_GROUP // Maven Group ID for the artifact,一般填你唯一的包名
18+
version = PROJ_VERSION
19+
install {
20+
repositories.mavenInstaller {
21+
// This generates POM.xml with proper parameters
22+
pom {
23+
project {
24+
packaging 'aar'
25+
// Add your description here
26+
name 'An Android Router Lib annotation' //项目描述
27+
url siteUrl
28+
// Set your license
29+
licenses {
30+
license {
31+
name 'The Apache Software License, Version 2.0'
32+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
33+
}
34+
}
35+
developers {
36+
developer {
37+
id 'LeifZhang' //填写的一些基本信息
38+
name '肉老师'
39+
40+
}
41+
}
42+
scm {
43+
connection gitUrl
44+
developerConnection gitUrl
45+
url siteUrl
46+
}
47+
}
48+
}
49+
}
50+
}
51+
task sourcesJar(type: Jar, dependsOn: classes) {
52+
classifier = 'sources'
53+
from sourceSets.main.allSource
54+
}
55+
56+
task javadocJar(type: Jar, dependsOn: javadoc) {
57+
classifier = 'javadoc'
58+
from javadoc.destinationDir
59+
}
60+
artifacts {
61+
archives javadocJar
62+
archives sourcesJar
63+
}
64+
Properties properties = new Properties()
65+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
66+
bintray {
67+
user = properties.getProperty("bintray.user")
68+
key = properties.getProperty("bintray.apikey")
69+
configurations = ['archives']
70+
pkg {
71+
repo = "maven"
72+
name = "routerLib-annotation" //发布到JCenter上的项目名字
73+
websiteUrl = siteUrl
74+
vcsUrl = gitUrl
75+
licenses = ["Apache-2.0"]
76+
publish = true
77+
}
78+
}
79+
*/

RouterAnnotation/nexus.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nexus_artifactId=RouterAnnotation
2+
nexus_description=RouterAnnotation
3+
nexus_fileName=RouterAnnotation
4+
nexus_type=library
5+
nexus_url=https://github.com/Leifzhang/AndroidAutoTrack
6+

RouterLib/build.gradle.kts

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
2+
3+
plugins {
4+
id("com.android.library")
5+
id("kotlin-android")
6+
id("com.github.dcendents.android-maven")
7+
id("com.jfrog.bintray")
8+
}
9+
10+
android {
11+
compileSdkVersion(30)
12+
13+
defaultConfig {
14+
minSdkVersion(15)
15+
targetSdkVersion(30)
16+
}
17+
18+
buildTypes {
19+
getByName("release") {
20+
minifyEnabled(false)
21+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
22+
}
23+
}
24+
}
25+
26+
dependencies {
27+
compileOnly("androidx.appcompat:appcompat:1.3.0-alpha02")
28+
compileOnly(project(":EmptyLoader"))
29+
implementation(project(":RouterAnnotation"))
30+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinPluginVersion()}")
31+
}
32+
/*
33+
def siteUrl = 'https://github.com/Leifzhang/AndroidRouter' // 项目的主页
34+
def gitUrl = 'https://github.com/Leifzhang/AndroidRouter.git' // Git仓库的url
35+
group = PROJ_GROUP // Maven Group ID for the artifact,一般填你唯一的包名
36+
install {
37+
repositories.mavenInstaller {
38+
// This generates POM.xml with proper parameters
39+
pom {
40+
project {
41+
packaging 'aar'
42+
// Add your description here
43+
name 'An Android Router Lib' //项目描述
44+
url siteUrl
45+
// Set your license
46+
licenses {
47+
license {
48+
name 'The Apache Software License, Version 2.0'
49+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
50+
}
51+
}
52+
developers {
53+
developer {
54+
id 'LeifZhang' //填写的一些基本信息
55+
name '肉老师'
56+
57+
}
58+
}
59+
scm {
60+
connection gitUrl
61+
developerConnection gitUrl
62+
url siteUrl
63+
}
64+
}
65+
}
66+
}
67+
}
68+
task sourcesJar (type: Jar) {
69+
from android . sourceSets . main . java . srcDirs
70+
classifier = 'sources'
71+
}
72+
artifacts {
73+
archives sourcesJar
74+
}
75+
Properties properties = new Properties()
76+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
77+
bintray {
78+
user = properties.getProperty("bintray.user")
79+
key = properties.getProperty("bintray.apikey")
80+
configurations = ['archives']
81+
pkg {
82+
repo = "maven"
83+
name = "RouterLib" //发布到JCenter上的项目名字
84+
websiteUrl = siteUrl
85+
vcsUrl = gitUrl
86+
licenses = ["Apache-2.0"]
87+
publish = true
88+
}
89+
}
90+
repositories {
91+
mavenCentral()
92+
}*/

RouterLib/nexus.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
nexus_artifactId=RouterLib
2+
nexus_description=RouterLib
3+
nexus_fileName=RouterLib
4+
nexus_type=library
5+
nexus_url=https://github.com/Leifzhang/AndroidAutoTrack
6+

0 commit comments

Comments
 (0)