Skip to content

Commit

Permalink
支持multidex
Browse files Browse the repository at this point in the history
  • Loading branch information
huangx committed Jun 19, 2020
1 parent 70b7e35 commit f4c046e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
targetSdkVersion 29
versionCode 1
versionName "1.0"

multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand All @@ -33,8 +33,8 @@ android.applicationVariants.all { variant ->
packageCount = 30
activityCountPerPackage = 3
otherCountPerPackage = 10
methodCountPerClass = 10
resPrefix = "lite_junk_"
methodCountPerClass = 20
resPrefix = "junk_"
drawableCount = 30
stringCount = 30
})
Expand All @@ -45,6 +45,7 @@ android.applicationVariants.all { variant ->
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="cn.hx.plugin.junkcode.demo">

<application
android:name=".AppApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/java/cn/hx/plugin/junkcode/demo/AppApplication.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cn.hx.plugin.junkcode.demo

import android.app.Application
import android.content.Context
import androidx.multidex.MultiDex

class AppApplication : Application() {
override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base)
MultiDex.install(this)
}
}
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (projectPropertiesFile.exists()) {
def projectName = properties.getProperty("project.name")
def projectGroupId = properties.getProperty("project.groupId")
def projectArtifactId = properties.getProperty("project.artifactId")
def projectArtifactName = properties.getProperty("project.artifactVersion")
def projectArtifactVersion = properties.getProperty("project.artifactVersion")
def projectSiteUrl = properties.getProperty("project.siteUrl")
def projectGitUrl = properties.getProperty("project.gitUrl")
def projectDesc = properties.getProperty("project.desc")
Expand All @@ -43,7 +43,7 @@ publish {
website = projectSiteUrl
repository = projectGitUrl
desc = projectDesc
publishVersion = projectArtifactName
publishVersion = projectArtifactVersion
userOrg = bintray_Org
bintrayUser = bintray_User
bintrayKey = bintrayApikey
Expand All @@ -57,7 +57,7 @@ uploadArchives {
// authentication(userName: mavenUserName, password: mavenUserPassword)
// }
repository(url: uri("../repo"))
pom.version = '1.0.1'
pom.version = projectArtifactVersion
pom.artifactId = 'android-junk-code'
pom.groupId = 'cn.hx.plugin'
pom.project {
Expand Down
2 changes: 1 addition & 1 deletion library/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
project.name=AndroidJunkCode
project.groupId=cn.hx.plugin
project.artifactId=android-junk-code
project.artifactVersion=1.0.0
project.artifactVersion=1.0.1
project.siteUrl=https://github.com/qq549631030/AndroidJunkCode
project.gitUrl=https://github.com/qq549631030/AndroidJunkCode.git
project.desc=generate junk code for android

0 comments on commit f4c046e

Please sign in to comment.