Skip to content

Commit

Permalink
0.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
typ0520 committed Oct 18, 2017
1 parent 03e574c commit b74cedc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.7.2 (2017-10-18)

Bugfixes:

- 修复清除fastdex缓存后有时候不触发dex transform的问题

## 0.7.1 (2017-10-17)

Bugfixes:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Android API 9(2.3)+ ; android-gradle-build 2.0.0+
}
dependencies {
classpath 'com.github.typ0520:fastdex-gradle:0.7.1'
classpath 'com.github.typ0520:fastdex-gradle:0.7.2'
}
}
````
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,8 @@ class FastdexPlugin implements Plugin<Project> {
FastdexCleanTask cleanTask = project.tasks.create("fastdexCleanFor${variantName}", FastdexCleanTask)
cleanTask.fastdexVariant = fastdexVariant


//TODO change api
variantOutput.processManifest.dependsOn getMergeDebugResources(project,variantName)
//variantOutput.processManifest.dependsOn variant.getVariantData().getScope().getMergeResourcesTask()
variantOutput.processManifest.dependsOn getMergeResources(project,variantName)
//替换项目的Application为fastdex.runtime.FastdexApplication
FastdexManifestTask manifestTask = project.tasks.create("fastdexProcess${variantName}Manifest", FastdexManifestTask)
manifestTask.fastdexVariant = fastdexVariant
Expand Down Expand Up @@ -259,12 +257,11 @@ class FastdexPlugin implements Plugin<Project> {
}
}

FastdexInstantRunTask fastdexInstantRunTask = project.tasks.create("fastdex${variantName}",FastdexInstantRunTask)
fastdexInstantRunTask.fastdexVariant = fastdexVariant

FastdexInstantRunMarkTask fastdexInstantRunMarkTask = project.tasks.create("fastdexMarkFor${variantName}",FastdexInstantRunMarkTask)
fastdexInstantRunMarkTask.fastdexVariant = fastdexVariant
//fastdexInstantRunMarkTask.mustRunAfter variantOutput.processManifest

FastdexInstantRunTask fastdexInstantRunTask = project.tasks.create("fastdex${variantName}",FastdexInstantRunTask)
fastdexInstantRunTask.fastdexVariant = fastdexVariant

prepareTask.mustRunAfter fastdexInstantRunMarkTask

Expand Down Expand Up @@ -425,7 +422,7 @@ class FastdexPlugin implements Plugin<Project> {
}
}

Task getMergeDebugResources(Project project, String variantName) {
Task getMergeResources(Project project, String variantName) {
String taskName = "merge${variantName}Resources"
try {
return project.tasks.getByName(taskName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,20 @@ public class FastdexVariant {
}
} catch (Throwable e) {
hasDexCache = false
//删掉classes目录和transforms目录,是为了重新触发java编译和dex transform
File classesDir = androidVariant.getVariantData().getScope().getJavaOutputDir()
classesDir.deleteDir()
File transformsDir = new File(androidVariant.getVariantData().getScope().getGlobalScope().getIntermediatesDir(), "/transforms")
transformsDir.deleteDir()
File apkLocationDir = androidVariant.getVariantData().getScope().getGlobalScope().getApkLocation()
apkLocationDir.deleteDir()

if (!(e instanceof JumpException) && configuration.debug) {
e.printStackTrace()
}

project.logger.error("==fastdex delete ${classesDir}")
project.logger.error("==fastdex delete ${transformsDir}")
project.logger.error("==fastdex delete ${apkLocationDir}")
project.logger.error("==fastdex ${e.getMessage()}")
project.logger.error("==fastdex we will remove ${variantName.toLowerCase()} cache")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
org.gradle.daemon=true

groupId=com.github.typ0520
version=0.7.1
version=0.7.2

ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=22
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "me.tatarka:gradle-retrolambda:3.6.0"
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
classpath 'com.github.typ0520:fastdex-gradle:0.7.1'
classpath 'com.github.typ0520:fastdex-gradle:0.7.2'
}
}

Expand Down

0 comments on commit b74cedc

Please sign in to comment.