Skip to content

Commit 6c6f789

Browse files
committed
Allow drop-in of gz aar file
1 parent 5af0139 commit 6c6f789

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

connectors/analytics/adscript/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import java.util.zip.GZIPInputStream
2+
13
plugins {
24
alias(libs.plugins.android.library)
35
alias(libs.plugins.kotlin.android)
@@ -37,6 +39,19 @@ if (!adscriptSdkDir) {
3739
} else if (!rootProject.file(adscriptSdkDir).exists()) {
3840
logger.warn("⚠️ WARNING: adscriptSdkDir does not exist at: ${adscriptSdkDir}")
3941
} else {
42+
def aarFile = new File(adscriptSdkDir, 'AdScriptApiClient_v1.0.10.aar')
43+
44+
// The Adscript aar file is typically provided as .gz, check if we still need to extract.
45+
def gzFile = new File("${aarFile}.gz")
46+
if (!aarFile.exists() && gzFile.exists()) {
47+
new FileInputStream(gzFile).withCloseable { fis ->
48+
new GZIPInputStream(fis).withCloseable { gis ->
49+
new FileOutputStream(aarFile).withCloseable { fos ->
50+
fos << gis
51+
}
52+
}
53+
}
54+
}
4055
dependencies {
4156
compileOnly fileTree(dir: "${rootProject.file(adscriptSdkDir)}/AdScriptApiClient_v1.0.10.aar", include: ['*.aar', '*.jar'], exclude: [])
4257
}

0 commit comments

Comments
 (0)