1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-21 20:02:07 +01:00

Download podlist at build time

This commit is contained in:
Gregor Santner 2016-11-02 17:10:29 +01:00
parent 95dbb2cd34
commit e95082cefb
5 changed files with 28 additions and 1288 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@ app/src/main/res/raw/contributors.md
app/src/main/res/raw/license.md
app/src/main/res/raw/readme.md
app/src/main/res/raw/contributors.txt
app/src/main/res/raw/podlist.json
##############
### Common ###

View file

@ -12,4 +12,5 @@ Abhijith Balan (abhijithb21 AT openmailbox DOT org): Malayalam translation
Airon90 (https://diasp.eu/u/airon90): Italian translation
Gaukler Faun (https://github.com/scoute-dich): Diaspora Native WebApp additions
Martín Vukovic (martinvukovic@protonmail.com): Diaspora Native WebApp
Paweł Szymon Kosiński (pskosinski): Polish translation
SansPseudoFix (https://github.com/SansPseudoFix): French translation

View file

@ -76,5 +76,29 @@ task copyRepoFiles(type: Copy) {
}
}
// Download Podlist
final String PODLIST_PATH = "app/src/main/res/raw/podlist.json"
final String PODLIST_URL = 'https://raw.githubusercontent.com/Diaspora-for-Android/diaspora-android-extras/master/podList/podlist.json'
downloadFile(PODLIST_PATH, PODLIST_URL, false)
// Do if we build in release (signed apk) mode
android.applicationVariants.all { v ->
if (v.buildType.name == "release"){
v.assemble.doFirst {
downloadFile(PODLIST_PATH, PODLIST_URL, true)
}
}
}
}
tasks.copyRepoFiles.execute()
def downloadFile(filePath, url, downloadIfExists ) {
def f = new File(filePath)
if (f.exists() && downloadIfExists){
f.delete();
}
if (!f.exists()) {
new URL(url).withInputStream{ i -> f.withOutputStream{ it << i }}
}
}
tasks.copyRepoFiles.execute()

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@
<string name="fragment_debug__android_version">Wersja systemu Android: %1$s</string>
<string name="fragment_debug__device_name">Nazwa urządzenia: %1$s</string>
<string name="fragment_debug__app_codename">Nazwa kodowa: %1$s</string>
<string name="fragment_debug__pod_profile_name">Nazwa profilu na Podzie: %1$s</string>
<string name="fragment_debug__pod_profile_name">Alias Poda: %1$s</string>
<string name="fragment_debug__pod_profile_url">Domena Poda: %1$s</string>
<string name="fragment_debug__toast_log_copied">Log debugowania został skopiowany do schowka</string>
<string name="fragment_license__3rd_party_libs_title">Lista bibliotek zewnętrznych</string>