Skip to content

Commit

Permalink
fix miss file in assets
Browse files Browse the repository at this point in the history
  • Loading branch information
typ0520 committed Nov 29, 2017
1 parent e528f70 commit 5201338
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 20 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.8.4 (2017-11-29)

Bugfixes:

- 修复assets目录下的子目录的内容没有被打进补丁资源包的问题

## 0.8.3 (2017-11-27)

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.8.3'
classpath 'com.github.typ0520:fastdex-gradle:0.8.4'
}
}
````
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import com.android.ddmlib.AndroidDebugBridge
import com.android.ddmlib.IDevice
import fastdex.build.variant.FastdexVariant
import fastdex.common.utils.FileUtils
import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.Project
import java.nio.file.FileVisitResult
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.SimpleFileVisitor
import java.nio.file.attribute.BasicFileAttributes

/**
* Created by tong on 17/3/12.
Expand Down Expand Up @@ -250,11 +256,22 @@ class FastdexInstantRun {
if (dir.listFiles().length == 0) {
return result
}
for (File file : dir.listFiles()) {
if (file.isFile() && !file.getName().startsWith(".")) {
result.add(file.getName())

boolean isWindows = Os.isFamily(Os.FAMILY_WINDOWS)
Path path = dir.toPath()
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Override
FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
if (!file.toFile().isHidden()) {
String relativePath = path.relativize(file).toString()
if (isWindows) {
relativePath = relativePath.replaceAll("\\\\","/")
}
result.add(relativePath)
}
return FileVisitResult.CONTINUE
}
}
})
return result
}

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.8.3
version=0.8.4

ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=22
Expand Down
26 changes: 13 additions & 13 deletions sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ android {
}
}

productFlavors {
flavor1 {
if (com.android.builder.model.Version.ANDROID_GRADLE_PLUGIN_VERSION.compareTo("3.0") >= 0) {
flavorDimensions "versionCode"
}
}

flavor2 {
if (com.android.builder.model.Version.ANDROID_GRADLE_PLUGIN_VERSION.compareTo("3.0") >= 0) {
flavorDimensions "versionCode"
}
}
}
// productFlavors {
// flavor1 {
// if (com.android.builder.model.Version.ANDROID_GRADLE_PLUGIN_VERSION.compareTo("3.0") >= 0) {
// flavorDimensions "versionCode"
// }
// }
//
// flavor2 {
// if (com.android.builder.model.Version.ANDROID_GRADLE_PLUGIN_VERSION.compareTo("3.0") >= 0) {
// flavorDimensions "versionCode"
// }
// }
// }

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
1 change: 1 addition & 0 deletions sample/app/src/main/assets/font/cn/haha.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
haha
1 change: 1 addition & 0 deletions sample/app/src/main/assets/font/xx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
xxx
1 change: 1 addition & 0 deletions sample/app/src/main/assets/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ buildscript {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "me.tatarka:gradle-retrolambda:3.7.0"
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
classpath 'com.github.typ0520:fastdex-gradle:0.8.3'
classpath 'com.github.typ0520:fastdex-gradle:0.8.4'
}
}

Expand Down

0 comments on commit 5201338

Please sign in to comment.