generated from nicorac/ionic-capacitor-angular-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application version is now retrieved from application build data, no …
…need to store it in multiple files anymore
- Loading branch information
Showing
8 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<resources> | ||
<string name="app_name">BCR Gui</string> | ||
<string name="title_activity_main">BCR Gui</string> | ||
<string name="app_name">BCR-GUI</string> | ||
<string name="title_activity_main">BCR-GUI</string> | ||
<string name="package_name">com.github.nicorac.bcrgui</string> | ||
<string name="custom_url_scheme">com.github.nicorac.bcrgui</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
export default { | ||
// NOTE: remember to change version number in Android apk too: | ||
// android\app\build.gradle --> versionName + versionCode | ||
"appName": "BCR-GUI", | ||
"version": "0.0.10", | ||
"copyright": "Claudio Nicora (nicorac) 2023", | ||
"website": "https://coolsoft.altervista.org", | ||
"sources": "https://github.com/nicorac/bcr-gui" | ||
} | ||
import { App } from '@capacitor/app'; | ||
|
||
class versionClass { | ||
|
||
// dynamic values | ||
// these fields are injected at runtime by SettingsService.initialize() | ||
// set their values in file `android/app/build.gradle` | ||
private _appName = ''; | ||
get appName(): string { return this._appName }; | ||
private _version = ''; | ||
get version(): string { return this._version }; | ||
|
||
// static values | ||
readonly copyright = "Claudio Nicora (nicorac) 2023"; | ||
readonly websiteUri = "https://coolsoft.altervista.org"; | ||
readonly sourcesUri = "https://github.com/nicorac/bcr-gui"; | ||
|
||
// read version | ||
async initialize() { | ||
const ver = await App.getInfo(); | ||
this._appName = ver.name; | ||
this._version = ver.version; | ||
} | ||
|
||
} | ||
|
||
let version = new versionClass(); | ||
export default version; |