Replace bootstrap-desktop.sh by verify-desktop-environmnent.sh
This commit is contained in:
Родитель
bed3e57bb9
Коммит
77faa9139b
|
@ -3,11 +3,18 @@
|
|||
# Unreleased Changes
|
||||
|
||||
[Full Changelog](https://github.com/mozilla/application-services/compare/v0.53.2...master)
|
||||
|
||||
## Rust
|
||||
|
||||
### What's New
|
||||
|
||||
- Sourcing `libs/bootstrap-desktop.sh` is not a thing anymore. Please run `./libs/verify-desktop-environment.sh` at least once instead. ([#2769](https://github.com/mozilla/application-services/pull/2769))
|
||||
|
||||
## Push
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- Android: The `PushManager.verifyConnection` now returns a `List<SubscriptionChanged>` that contain the channel ID and scope of the subscriptions that have expired.
|
||||
- Android: The `PushManager.verifyConnection` now returns a `List<SubscriptionChanged>` that contain the channel ID and scope of the subscriptions that have expired. ([#2632](https://github.com/mozilla/application-services/pull/2632))
|
||||
See [`onpushsubscriptionchange`][0] events on how this change can be propagated to notify web content.
|
||||
|
||||
[0]: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerGlobalScope/onpushsubscriptionchange
|
||||
|
|
|
@ -6,20 +6,19 @@ First of all, let us remind the reader that were are not dealing with a classic
|
|||
In fact, the project involves multiple build systems: `autoconf` for dependencies such as NSS or SQLCipher, `cargo` for the Rust common code, then either `gradle` (Android) or `XCode` (iOS) for the platform-specific wrappers.
|
||||
The guide will make sure your system is configured appropriately to run these build systems without issues.
|
||||
|
||||
## Rust-only development
|
||||
## Rust-only (desktop) development
|
||||
|
||||
This part assumes you are not interested in building the Android or iOS wrappers and only want to run the Rust tests.
|
||||
The easiest way to get started is to source the following script in your terminal:
|
||||
This part assumes you are not interested in building the Android or iOS wrappers and only want to do rust development/run tests.
|
||||
The following command will ensure your environment variables are set properly and build the dependencies needed by the project:
|
||||
|
||||
```
|
||||
source ./libs/bootstrap-desktop.sh
|
||||
./libs/verify-desktop-environment.sh
|
||||
```
|
||||
|
||||
This script will build your dependencies, check your system configuration and export the necessary environment variables. Because of the latter, **do not forget to re-source this script in every new terminal window**.
|
||||
Once the previous script runs successfully, you are ready to run the following command to execute all Rust tests:
|
||||
You can then run the Rust tests using:
|
||||
|
||||
```
|
||||
cargo test --all
|
||||
cargo test
|
||||
```
|
||||
|
||||
## Android development
|
||||
|
|
|
@ -1,30 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# shellcheck disable=SC2148,SC2164
|
||||
# Set environment variables for using vendored dependencies in desktop builds.
|
||||
#
|
||||
# This file should be used via `source ./libs/bootstrap-desktop.sh` and will
|
||||
# not have the desired effect if you try to run it directly, because it
|
||||
# uses `export` to set environment variables.
|
||||
|
||||
if [[ ! -f "$(pwd)/libs/build-all.sh" ]]; then
|
||||
echo "ERROR: bootstrap-desktop.sh should be run from the root directory of the repo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$(pwd)/libs/bootstrap-common.sh"
|
||||
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
APPSERVICES_PLATFORM_DIR="$(pwd)/libs/desktop/darwin"
|
||||
else
|
||||
APPSERVICES_PLATFORM_DIR="$(pwd)/libs/desktop/linux-x86-64"
|
||||
fi
|
||||
export SQLCIPHER_LIB_DIR="${APPSERVICES_PLATFORM_DIR}/sqlcipher/lib"
|
||||
export SQLCIPHER_INCLUDE_DIR="${APPSERVICES_PLATFORM_DIR}/sqlcipher/include"
|
||||
export NSS_STATIC="1"
|
||||
export NSS_DIR="${APPSERVICES_PLATFORM_DIR}/nss"
|
||||
if [[ ! -d "${SQLCIPHER_LIB_DIR}" ]] || [[ ! -d "${NSS_DIR}" ]]; then
|
||||
pushd libs
|
||||
./build-all.sh desktop
|
||||
popd
|
||||
fi;
|
||||
echo "You do not need to source this file anymore."
|
||||
echo "Please run ./libs/verify-desktop-environment.sh at least once instead."
|
||||
echo ""
|
||||
echo "Have a great day!"
|
||||
|
|
|
@ -15,7 +15,7 @@ if [[ ! -f "$(pwd)/libs/build-all.sh" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
"$(pwd)/libs/bootstrap-common.sh"
|
||||
"$(pwd)/libs/verify-common.sh"
|
||||
|
||||
# If you add a dependency below, mention it in building.md in the Android section!
|
||||
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Ensure the build toolchains are set up correctly for desktop builds.
|
||||
#
|
||||
# This file should be used via `./libs/verify-desktop-environment.sh`.
|
||||
|
||||
set -e
|
||||
|
||||
if [[ ! -f "$(pwd)/libs/build-all.sh" ]]; then
|
||||
echo "ERROR: bootstrap-desktop.sh should be run from the root directory of the repo"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$(pwd)/libs/verify-common.sh"
|
||||
|
||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
||||
APPSERVICES_PLATFORM_DIR="$(pwd)/libs/desktop/darwin"
|
||||
else
|
||||
APPSERVICES_PLATFORM_DIR="$(pwd)/libs/desktop/linux-x86-64"
|
||||
fi
|
||||
|
||||
if [[ -z "${SQLCIPHER_LIB_DIR}" ]] || [[ -z "${SQLCIPHER_INCLUDE_DIR}" ]] || [[ -z "${NSS_DIR}" ]] || [[ -z "${NSS_STATIC}" ]]; then
|
||||
echo "Some necessary environment variables are not set."
|
||||
echo "Please export or add to your shell initialization file (.zshenv, .bashrc etc.) the following:"
|
||||
echo ""
|
||||
echo "export SQLCIPHER_LIB_DIR=${APPSERVICES_PLATFORM_DIR}/sqlcipher/lib"
|
||||
echo "export SQLCIPHER_INCLUDE_DIR=${APPSERVICES_PLATFORM_DIR}/sqlcipher/include"
|
||||
echo "export NSS_DIR=${APPSERVICES_PLATFORM_DIR}/nss"
|
||||
echo "export NSS_STATIC=1"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d "${SQLCIPHER_LIB_DIR}" ]] || [[ ! -d "${NSS_DIR}" ]]; then
|
||||
pushd libs
|
||||
./build-all.sh desktop
|
||||
popd
|
||||
fi;
|
||||
|
||||
echo "Looks good! Try running the test suite with \`cargo test\`"
|
|
@ -13,7 +13,7 @@ if [[ ! -f "$(pwd)/libs/build-all.sh" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
"$(pwd)/libs/bootstrap-common.sh"
|
||||
"$(pwd)/libs/verify-common.sh"
|
||||
|
||||
rustup target add "${RUST_TARGETS[@]}"
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче