Skip to content

Commit

Permalink
Weather-demo: unify directory and package names
Browse files Browse the repository at this point in the history
Rename every possible entity from rusty-weather to
weather-demo to avoid confusions.
Justyna-JustCode authored and tronical committed Jul 29, 2024
1 parent 58a483a commit ed00552
Showing 5 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
@@ -555,13 +555,13 @@ jobs:
run: cargo apk build -p energy-monitor --target aarch64-linux-android --lib --release
- name: Build todo demo
run: cargo apk build -p todo --target aarch64-linux-android --lib --release
- name: Build rusty-weather example
run: cargo apk build -p rusty-weather --target aarch64-linux-android --lib --release
- name: Build weather-demo example
run: cargo apk build -p weather-demo --target aarch64-linux-android --lib --release
- name: "upload APK artifact"
uses: actions/upload-artifact@v4
with:
name: android-demo
path: |
target/release/apk/energy-monitor.apk
target/release/apk/todo_lib.apk
target/release/apk/rusty_weather_lib.apk
target/release/apk/weather_demo_lib.apk
10 changes: 7 additions & 3 deletions examples/weather-demo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: MIT

[package]
name = "rusty-weather"
name = "weather-demo"
version = "1.7.1"
authors = ["FELGO GmbH <contact@felgo.com>"]
edition = "2021"
@@ -45,10 +45,14 @@ open_weather = ["dep:openweather_sdk", "dep:openssl"]

# Android-activity / wasm support
[lib]
name="rusty_weather_lib"
name="weather_demo_lib"
crate-type = ["lib", "cdylib"]
path = "src/lib.rs"

[[bin]]
name = "weather-demo"
path = "src/main.rs"

# Andoroid settings
# See more: https://github.com/rust-mobile/cargo-apk?tab=readme-ov-file#manifest
[package.metadata.android]
@@ -57,7 +61,7 @@ resources = "android-res"
build_targets = [ "aarch64-linux-android" ]

[package.metadata.android.application]
label = "Rusty Weather"
label = "Weather Demo"
icon = "@mipmap/ic_launcher"

[[package.metadata.android.uses_permission]]
6 changes: 3 additions & 3 deletions examples/weather-demo/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Copyright © SixtyFPS GmbH <info@slint.dev> ; SPDX-License-Identifier: MIT -->

# Rusty Weather
# Weather Demo

Rusty Weather is a weather application made by [Felgo](https://felgo.com/).
Weather Demo is a weather application made by [Felgo](https://felgo.com/).

The application retrieves weather data from the [OpenWeather](https://openweathermap.org/) API to provide:
* Real-time weather data,
@@ -26,7 +26,7 @@ The application retrieves weather data from the [OpenWeather](https://openweathe
</p>

## Weather data
To enable real weather data from the [OpenWeather](https://openweathermap.org/) API, you must enable the `open_weather` feature and provide the `RUSTY_WEATHER_API_KEY` environment variable with your API key at build time. The [OpenCall API](https://openweathermap.org/price#onecall) subscription is required.
To enable real weather data from the [OpenWeather](https://openweathermap.org/) API, you must enable the `open_weather` feature and provide the `OPEN_WEATHER_API_KEY` environment variable with your API key at build time. The [OpenCall API](https://openweathermap.org/price#onecall) subscription is required.

If you do not enable the feature or provide the key, the application loads the dummy data instead.

2 changes: 1 addition & 1 deletion examples/weather-demo/index.html
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
<canvas id="canvas" data-slint-auto-resize-to-preferred="true" unselectable="on"></canvas>
<script type="module">
// import the generated file.
import init from "./pkg/rusty_weather_lib.js";
import init from "./pkg/weather_demo_lib.js";
init();
</script>
</div>
2 changes: 1 addition & 1 deletion examples/weather-demo/src/app_main.rs
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ impl AppHandler {

#[cfg(all(not(target_arch = "wasm32"), feature = "open_weather"))]
{
if let Some(api_key) = std::option_env!("RUSTY_WEATHER_API_KEY") {
if let Some(api_key) = std::option_env!("OPEN_WEATHER_API_KEY") {
data_controller_opt = Some(Box::new(OpenWeatherController::new(api_key.into())));
support_add_city = true;
}

0 comments on commit ed00552

Please sign in to comment.