Skip to content

Commit

Permalink
* fix hack process compatibility problem (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
lomanyong committed Aug 22, 2016
1 parent c70b1b4 commit 6adc931
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def developerEmail = '[email protected]'
def publishedGroupId = 'com.antfortune.freeline'
def artifact = 'gradle'
def libraryName = 'freeline-gradle'
def publishVersion = '0.5.1'
def publishVersion = '0.5.2'

install {
repositories {
Expand Down
2 changes: 1 addition & 1 deletion gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'java'
apply from: 'bintray.gradle'

group 'com.antfortune.freeline'
version '0.5.1'
version '0.5.2'

sourceCompatibility = 1.6
targetCompatibility = 1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ class FreelinePlugin implements Plugin<Project> {
def classesProcessTask
def preDexTask
if (isLowerVersion) {
if (project.android.defaultConfig.multiDexEnabled) {
if (variant.mergedFlavor.multiDexEnabled) {
classesProcessTask = project.tasks.findByName("packageAll${variant.name.capitalize()}ClassesForMultiDex")
} else {
classesProcessTask = project.tasks.findByName("dex${variant.name.capitalize()}")
preDexTask = project.tasks.findByName("preDex${variant.name.capitalize()}")
}
} else {
if (project.android.defaultConfig.multiDexEnabled) {
if (variant.mergedFlavor.minSdkVersion.apiLevel < 21 && variant.mergedFlavor.multiDexEnabled) {
classesProcessTask = project.tasks.findByName("transformClassesWithJarMergingFor${variant.name.capitalize()}")
} else {
classesProcessTask = project.tasks.findByName("transformClassesWithDexFor${variant.name.capitalize()}")
Expand Down Expand Up @@ -214,8 +214,9 @@ class FreelinePlugin implements Plugin<Project> {

project.rootProject.allprojects.each { p ->
if (p.hasProperty("android") && p.android.hasProperty("sourceSets")) {
def mapper = ["match" : "", "path" : p.android.sourceSets.main.res.srcDirs.asList().get(0).path]
def mapper = ["match" : "", "path" : []]
mapper.match = "exploded-aar${File.separator}${p.group}${File.separator}${p.name}${File.separator}"
p.android.sourceSets.main.res.srcDirs.asList().collect(mapper.path) { it.absolutePath }
mappers.add(mapper)
}
}
Expand All @@ -226,7 +227,7 @@ class FreelinePlugin implements Plugin<Project> {
def marker = false
mappers.each { mapper ->
if (path.contains(mapper.match)) {
resourcesDependencies.local_resources.add(mapper.path)
mapper.path.collect(resourcesDependencies.local_resources) {it}
marker = true
return false
}
Expand Down

0 comments on commit 6adc931

Please sign in to comment.