Skip to content

Commit

Permalink
Fix issue adwiv#46 (transformNative_libsWithSyncJniLibsForRelease -> …
Browse files Browse the repository at this point in the history
…transformNativeLibsWithSyncJniLibsForRelease) and warring about deprecated method Task.leftShift(Closure) and AndroidManifest.orig.xml (No such file or directory)
  • Loading branch information
Rômulo Oliveira committed Mar 14, 2017
1 parent 86bcc38 commit b654c85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Gradle script that allows you to merge and embed dependencies in generted aar fi

1. The Android build tools have changed a task name: transformNative_libsWithSyncJniLibsForRelease -> transformNativeLibsWithSyncJniLibsForRelease
2. The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0: I used [mrhaki's](http://mrhaki.blogspot.com.br/2016/11/gradle-goodness-replacing-operator-for.html) approach.
3. Execution failed for task ':<module>:embedManifests'. .../AndroidManifest.orig.xml (No such file or directory)

**Why do I need is a fat AAR?**

Expand Down
16 changes: 8 additions & 8 deletions fat-aar.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ext.build_dir = buildDir.path.replace(File.separator, '/');

ext.exploded_aar_dir = "$build_dir/intermediates/exploded-aar";
ext.classs_release_dir = "$build_dir/intermediates/classes/release";
ext.bundle_release_dir = "$build_dir/intermediates/bundles/release";
ext.bundle_default_dir = "$build_dir/intermediates/bundles/default";
ext.manifest_aaapt_dir = "$build_dir/intermediates/manifests/aapt/release";
ext.generated_rsrc_dir = "$build_dir/generated/source/r/release";

Expand Down Expand Up @@ -198,7 +198,7 @@ task embedProguard {
doLast {
println "Running FAT-AAR Task :embedProguard"

def proguardRelease = file("$bundle_release_dir/proguard.txt")
def proguardRelease = file("$bundle_default_dir/proguard.txt")
embeddedAarDirs.each { aarPath ->
try {
def proguardLibFile = file("$aarPath/proguard.txt")
Expand Down Expand Up @@ -278,7 +278,7 @@ task collectRClass {
}

task embedRClass(type: org.gradle.jvm.tasks.Jar, dependsOn: collectRClass) {
destinationDir file("$bundle_release_dir/libs/")
destinationDir file("$bundle_default_dir/libs/")
from base_r2x_dir
}

Expand All @@ -304,13 +304,13 @@ task embedJavaJars(dependsOn: embedRClass) {

copy {
from jars
into file("$bundle_release_dir/libs")
into file("$bundle_default_dir/libs")
}

// Copy all embedded jar files to bundle lib
copy {
from embeddedJars
into file("$bundle_release_dir/libs")
into file("$bundle_default_dir/libs")
}
}
}
Expand All @@ -328,7 +328,7 @@ task embedJniLibs {
// Copy JNI Folders
copy {
from fileTree(dir: "$aarPath/jni")
into file("$bundle_release_dir/jni")
into file("$bundle_default_dir/jni")
}
}
}
Expand All @@ -349,8 +349,8 @@ task embedManifests {

File reportFile = file("${build_dir}/embedManifestReport.txt")

File origManifest = file("$bundle_release_dir/AndroidManifest.xml")
File copyManifest = file("$bundle_release_dir/AndroidManifest.orig.xml")
File origManifest = file("$bundle_default_dir/AndroidManifest.xml")
File copyManifest = file("$bundle_default_dir/AndroidManifest.orig.xml")
File aaptManifest = file("$manifest_aaapt_dir/AndroidManifest.xml")

copy {
Expand Down

0 comments on commit b654c85

Please sign in to comment.