2022-04-29 10:13:57 +00:00
|
|
|
.PHONY: dist api
|
2022-04-23 19:47:39 +00:00
|
|
|
|
|
|
|
# Build distributable binaries.
|
|
|
|
dist:
|
2024-04-01 13:27:15 +00:00
|
|
|
cd api && make grpc-web
|
2023-05-29 13:41:30 +00:00
|
|
|
cd chirpstack && make dist
|
|
|
|
|
|
|
|
# Install dev dependencies
|
|
|
|
dev-dependencies:
|
|
|
|
cargo install cross --version 0.2.5
|
2024-08-26 12:22:35 +00:00
|
|
|
cargo install diesel_cli --version 2.2.1 --no-default-features --features postgres,sqlite
|
2023-05-29 13:41:30 +00:00
|
|
|
cargo install cargo-deb --version 1.43.1
|
2023-09-07 15:39:49 +00:00
|
|
|
cargo install cargo-generate-rpm --version 0.12.1
|
2022-04-23 10:31:54 +00:00
|
|
|
|
2022-04-29 10:13:57 +00:00
|
|
|
# Set the versions
|
|
|
|
version:
|
|
|
|
test -n "$(VERSION)"
|
2024-06-25 11:27:28 +00:00
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./chirpstack/Cargo.toml
|
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./backend/Cargo.toml
|
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./lrwn/Cargo.toml
|
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./lrwn-filters/Cargo.toml
|
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./chirpstack-integration/Cargo.toml
|
2022-04-29 10:13:57 +00:00
|
|
|
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./ui/package.json
|
|
|
|
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./api/grpc-web/package.json
|
|
|
|
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./api/js/package.json
|
|
|
|
sed -i 's/version.*/version = "$(VERSION)",/g' ./api/python/src/setup.py
|
2024-06-25 11:27:28 +00:00
|
|
|
sed -i 's/^ version.*/ version = "$(VERSION)"/g' ./api/rust/Cargo.toml
|
2023-01-10 15:46:04 +00:00
|
|
|
sed -i 's/^version.*/version = "$(VERSION)"/g' ./api/java/build.gradle.kts
|
|
|
|
sed -i 's/^version.*/version = "$(VERSION)"/g' ./api/kotlin/build.gradle.kts
|
2024-06-11 10:50:02 +00:00
|
|
|
sed -i 's/"version.*/"version": "$(VERSION)",/g' ./api/php/composer.json
|
2023-01-10 15:46:04 +00:00
|
|
|
|
2022-09-28 08:09:51 +00:00
|
|
|
cd api && make
|
|
|
|
make build-ui
|
2022-07-28 08:02:54 +00:00
|
|
|
make test
|
|
|
|
git add .
|
|
|
|
git commit -v -m "Bump version to $(VERSION)"
|
|
|
|
git tag -a v$(VERSION) -m "v$(VERSION)"
|
|
|
|
git tag -a api/go/v$(VERSION) -m "api/go/v$(VERSION)"
|
2022-04-29 10:13:57 +00:00
|
|
|
|
|
|
|
api: version
|
|
|
|
cd api && make
|
|
|
|
|
2022-04-06 20:18:32 +00:00
|
|
|
# Builds the UI.
|
|
|
|
build-ui:
|
2024-04-01 13:27:15 +00:00
|
|
|
cd api && make grpc-web
|
|
|
|
cd ui && make build
|
2022-04-06 20:18:32 +00:00
|
|
|
|
2023-05-31 11:11:48 +00:00
|
|
|
# Enter the devshell.
|
|
|
|
devshell:
|
|
|
|
nix-shell
|
|
|
|
|
|
|
|
# Enters the Docker devshell for ChirpStack development.
|
2023-05-30 11:08:52 +00:00
|
|
|
docker-devshell:
|
2024-03-12 11:27:27 +00:00
|
|
|
docker compose run --rm --service-ports --name chirpstack chirpstack
|
2022-04-06 20:18:32 +00:00
|
|
|
|
|
|
|
# Runs the tests
|
|
|
|
test:
|
2024-04-01 13:27:15 +00:00
|
|
|
cd api && make rust
|
2023-05-29 13:41:30 +00:00
|
|
|
cd backend && cargo test
|
|
|
|
cd chirpstack && make test
|
|
|
|
cd lrwn && make test
|
|
|
|
cd lrwn-filters && make test
|
2023-06-26 11:44:22 +00:00
|
|
|
|
|
|
|
# Runs all the tests (including some that normally are ignored)
|
|
|
|
test-all:
|
2024-04-01 13:27:15 +00:00
|
|
|
cd api && make rust
|
2023-06-26 11:44:22 +00:00
|
|
|
cd backend && cargo test
|
|
|
|
cd chirpstack && make test-all
|
2023-10-13 10:37:47 +00:00
|
|
|
cd chirpstack-integration && cargo test
|
2023-06-26 11:44:22 +00:00
|
|
|
cd lrwn && make test
|
|
|
|
cd lrwn-filters && make test
|