diff options
author | Torsten Grote <t@grobox.de> | 2020-05-08 13:40:34 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-05-08 13:40:34 -0300 |
commit | 35b28a4e957be263447c432d6ab28924d0ef245c (patch) | |
tree | 1702857a4d2ff727a1a9ff05797ddb673258badc /wallet | |
parent | dcf516ad2b32f896ad92cc97f77f7d82ec53fa43 (diff) | |
download | taler-android-35b28a4e957be263447c432d6ab28924d0ef245c.tar.gz taler-android-35b28a4e957be263447c432d6ab28924d0ef245c.tar.bz2 taler-android-35b28a4e957be263447c432d6ab28924d0ef245c.zip |
[wallet] prevent download of wallet-core with every build
Diffstat (limited to 'wallet')
-rw-r--r-- | wallet/.gitignore | 2 | ||||
-rw-r--r-- | wallet/build.gradle | 12 | ||||
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/wallet/.gitignore b/wallet/.gitignore index 85d7ef4..094515c 100644 --- a/wallet/.gitignore +++ b/wallet/.gitignore @@ -1,2 +1,2 @@ /build -/src/main/assets/taler-wallet-android.js +/src/main/assets/taler-wallet-android-*.js diff --git a/wallet/build.gradle b/wallet/build.gradle index b25fa95..c96696c 100644 --- a/wallet/build.gradle +++ b/wallet/build.gradle @@ -37,6 +37,7 @@ android { versionCode 6 versionName "0.7.1.dev.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + buildConfigField "String", "WALLET_CORE_VERSION", "\"$walletCoreVersion\"" } buildTypes { release { @@ -90,10 +91,10 @@ dependencies { implementation 'me.zhanghai.android.materialprogressbar:library:1.6.1' // Markdown rendering - final def markwon_version = '4.3.1' - implementation "io.noties.markwon:core:$markwon_version" - implementation "io.noties.markwon:ext-tables:$markwon_version" - implementation "io.noties.markwon:recycler:$markwon_version" + final def markwon_version = '4.3.1' + implementation "io.noties.markwon:core:$markwon_version" + implementation "io.noties.markwon:ext-tables:$markwon_version" + implementation "io.noties.markwon:recycler:$markwon_version" // JSON parsing and serialization implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.10.2' @@ -106,8 +107,9 @@ dependencies { def walletLibraryDir = "src/main/assets" task downloadWalletLibrary(type: Download) { src "https://git.taler.net/wallet-core.git/plain/${walletCoreVersion}/taler-wallet-android.js?h=prebuilt" - dest "${walletLibraryDir}/taler-wallet-android.js" + dest "${walletLibraryDir}/taler-wallet-android-${walletCoreVersion}.js" onlyIfModified true + overwrite false doFirst { new File(walletLibraryDir).mkdirs() } diff --git a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt index c0f7e9c..c810054 100644 --- a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt +++ b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendService.kt @@ -26,6 +26,7 @@ import android.os.Message import android.os.Messenger import android.os.RemoteException import android.util.Log +import net.taler.wallet.BuildConfig.WALLET_CORE_VERSION import net.taler.wallet.HostCardEmulatorService import org.json.JSONObject import java.lang.ref.WeakReference @@ -55,7 +56,7 @@ class WalletBackendService : Service() { private val subscribers = LinkedList<Messenger>() override fun onCreate() { - val talerWalletAndroidCode = assets.open("taler-wallet-android.js").use { + val talerWalletAndroidCode = assets.open("taler-wallet-android-$WALLET_CORE_VERSION.js").use { it.readBytes().toString(Charsets.UTF_8) } |