Skip to content

Commit

Permalink
support AGP 8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aasitnikov committed Jun 24, 2024
1 parent a6cd454 commit e3c8849
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@

This fork adds support for AGP 8.0+

The solution of merging aar works with [AGP][3] 8.0 and higher. (Tested with AGP 8.3, and Gradle 8.6)
The solution of merging aar works with [AGP][3] 8.5 and Gradle 8.7

## Getting Started

### Step 1: Add classpath
#### Add snippet below to your root build script file:
For Maven Central (The lastest release is available on [Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.kezong/fat-aar)):
```groovy
buildscript {
repositories {
Expand All @@ -23,7 +22,7 @@ buildscript {
}
}
dependencies {
classpath 'com.github.aasitnikov:fat-aar-android:1.4.0'
classpath 'com.github.aasitnikov:fat-aar-android:1.4.1'
}
}
```
Expand Down Expand Up @@ -119,6 +118,7 @@ See [anatomy of an aar file here][2].
## Gradle Version Support
| Version | Android Gradle Plugin | Gradle |
|:---------------:|:---------------------:|:---------:|
| 1.4.1 | 8.5 | 8.7 |
| 1.4.0 | 8.3 | 8.6 |
| 1.3.8 | 3.0.0+ | 4.9+ |
| 1.3.6 | 3.0.0 - 4.2.0 | 4.9+ |
Expand All @@ -137,11 +137,13 @@ See [anatomy of an aar file here][2].

The following link which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, you should use the latest possible version of both Gradle and the plugin.

[Plugin version and Required Gradle version](https://developer.android.google.cn/studio/releases/gradle-plugin.html)
[Plugin version and Required Gradle version](https://developer.android.com/build/releases/gradle-plugin)

## Version Log
- [1.4.0](<https://github.com/kezong/fat-aar-android/releases/tag/v1.4.0>)
- Add support for AGP 8.3
- [1.4.1](<https://github.com/aasitnikov/fat-aar-android/releases/tag/1.4.1>)
- Support AGP 8.5
- [1.4.0](<https://github.com/aasitnikov/fat-aar-android/releases/tag/1.4.0>)
- Support AGP 8.3
- [1.3.8](<https://github.com/kezong/fat-aar-android/releases/tag/v1.3.8>)
- Fix the issue that plugin cannot be used in jdk 1.8 [#371](https://github.com/kezong/fat-aar-android/issues/371)
- [1.3.7](<https://github.com/kezong/fat-aar-android/releases/tag/v1.3.7>)
Expand Down
25 changes: 19 additions & 6 deletions source/src/main/groovy/com/kezong/fataar/VariantProcessor.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class VariantProcessor {
processGenerateProguard()
processDataBinding(bundleTask)
processRClasses(transform, bundleTask)
processDeepLinkTasks()
}

private static void printEmbedArtifacts(Collection<ResolvedArtifact> artifacts,
Expand Down Expand Up @@ -220,6 +221,18 @@ class VariantProcessor {
}
}

private void processDeepLinkTasks() {
String taskName = "extractDeepLinksForAar${mVariant.name.capitalize()}"
TaskProvider extractDeepLinks = mProject.tasks.named(taskName)
if (extractDeepLinks == null) {
throw new RuntimeException("Can not find task ${taskName}!")
}

extractDeepLinks.configure {
dependsOn(mExplodeTasks)
}
}

/**
* copy data binding file must be do last in BundleTask, and reBundleTask will be package it.
* @param bundleTask
Expand Down Expand Up @@ -469,13 +482,13 @@ class VariantProcessor {

resourceGenTask.configure {
dependsOn(mExplodeTasks)
}

for (archiveLibrary in mAndroidArchiveLibraries) {
FatUtils.logInfo("Merge resource,Library res:${archiveLibrary.resFolder}")
mVariant.registerGeneratedResFolders(
mProject.files(archiveLibrary.resFolder)
)
}
for (archiveLibrary in mAndroidArchiveLibraries) {
FatUtils.logInfo("Merge resource,Library res:${archiveLibrary.resFolder}")
mVariant.registerGeneratedResFolders(
mProject.files(archiveLibrary.resFolder)
)
}
}

Expand Down

0 comments on commit e3c8849

Please sign in to comment.