Commit 466d66fb authored by Marc Schwede's avatar Marc Schwede 💬 Committed by Eric Eastwood
Browse files

Add gradle task `getWebappAssets` to download latest required assets from the webapp repository.

fixes gitlab-org/gitter/gitter-android-app#122
parent ba1d0e0d
import java.nio.file.Files
apply plugin: 'com.android.application'
// Try reading secrets from file
......@@ -17,6 +19,24 @@ else {
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
// Download gitter-webapp assets from current release if assets folder not present
task getWebappAssets(type: Copy) {
String zipFile = "${buildDir}/tmp/webapp-artifacts.zip"
String assetsPath = "${projectDir}/src/main/assets"
String artifactURI = "https://gitlab.com/gitlab-org/gitter/webapp/-/jobs/artifacts/master/download?job=mobile-asset-build"
File f = new File(assetsPath)
if (!f.isDirectory()) {
new URL(artifactURI).withInputStream { i -> new File(zipFile).withOutputStream { it << i } }
from zipTree(zipFile)
into "."
doLast {
ant.move file: "./output/android/www",
todir: f.toPath()
delete("./output", zipFile)
}
}
}
android {
compileSdkVersion 26
buildToolsVersion '28.0.3'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment