Skip to content

Commit f4c046e

Browse files
author
huangx
committed
支持multidex
1 parent 70b7e35 commit f4c046e

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
targetSdkVersion 29
1313
versionCode 1
1414
versionName "1.0"
15-
15+
multiDexEnabled true
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
1818

@@ -33,8 +33,8 @@ android.applicationVariants.all { variant ->
3333
packageCount = 30
3434
activityCountPerPackage = 3
3535
otherCountPerPackage = 10
36-
methodCountPerClass = 10
37-
resPrefix = "lite_junk_"
36+
methodCountPerClass = 20
37+
resPrefix = "junk_"
3838
drawableCount = 30
3939
stringCount = 30
4040
})
@@ -45,6 +45,7 @@ android.applicationVariants.all { variant ->
4545
dependencies {
4646
implementation fileTree(dir: "libs", include: ["*.jar"])
4747
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
48+
implementation 'androidx.multidex:multidex:2.0.1'
4849
implementation 'androidx.core:core-ktx:1.3.0'
4950
implementation 'androidx.appcompat:appcompat:1.1.0'
5051
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package="cn.hx.plugin.junkcode.demo">
44

55
<application
6+
android:name=".AppApplication"
67
android:allowBackup="true"
78
android:icon="@mipmap/ic_launcher"
89
android:label="@string/app_name"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package cn.hx.plugin.junkcode.demo
2+
3+
import android.app.Application
4+
import android.content.Context
5+
import androidx.multidex.MultiDex
6+
7+
class AppApplication : Application() {
8+
override fun attachBaseContext(base: Context?) {
9+
super.attachBaseContext(base)
10+
MultiDex.install(this)
11+
}
12+
}

library/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (projectPropertiesFile.exists()) {
2525
def projectName = properties.getProperty("project.name")
2626
def projectGroupId = properties.getProperty("project.groupId")
2727
def projectArtifactId = properties.getProperty("project.artifactId")
28-
def projectArtifactName = properties.getProperty("project.artifactVersion")
28+
def projectArtifactVersion = properties.getProperty("project.artifactVersion")
2929
def projectSiteUrl = properties.getProperty("project.siteUrl")
3030
def projectGitUrl = properties.getProperty("project.gitUrl")
3131
def projectDesc = properties.getProperty("project.desc")
@@ -43,7 +43,7 @@ publish {
4343
website = projectSiteUrl
4444
repository = projectGitUrl
4545
desc = projectDesc
46-
publishVersion = projectArtifactName
46+
publishVersion = projectArtifactVersion
4747
userOrg = bintray_Org
4848
bintrayUser = bintray_User
4949
bintrayKey = bintrayApikey
@@ -57,7 +57,7 @@ uploadArchives {
5757
// authentication(userName: mavenUserName, password: mavenUserPassword)
5858
// }
5959
repository(url: uri("../repo"))
60-
pom.version = '1.0.1'
60+
pom.version = projectArtifactVersion
6161
pom.artifactId = 'android-junk-code'
6262
pom.groupId = 'cn.hx.plugin'
6363
pom.project {

library/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
project.name=AndroidJunkCode
33
project.groupId=cn.hx.plugin
44
project.artifactId=android-junk-code
5-
project.artifactVersion=1.0.0
5+
project.artifactVersion=1.0.1
66
project.siteUrl=https://github.com/qq549631030/AndroidJunkCode
77
project.gitUrl=https://github.com/qq549631030/AndroidJunkCode.git
88
project.desc=generate junk code for android

0 commit comments

Comments
 (0)