Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix contract #1174

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions apps/freenet-email-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,34 @@ IDENTITY_DELEGATE := $(FREENET_ROOT)$(PATH_SEP)modules$(PATH_SEP)identity-manage
WEB_DIR_SRC := $(ROOT)$(PATH_SEP)web$(PATH_SEP)src
FILE := $(IDENTITY_DELEGATE)$(PATH_SEP)build$(PATH_SEP)identity-manager-key.private.pem

ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif


all: install-deps build

install-deps:
cargo install dioxus-cli

build: \
generate-id-manager-key \
build-inbox \
build-webapp \
publish-webapp
build:
ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
make generate-id-manager-key
make build-inbox
make build-webapp
make publish-webapp

generate-id-manager-key:
ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
@if [ ! -f "$(FILE)" ]; then \
cd "$(IDENTITY_DELEGATE)" && cargo run -- --path "$(IDENTITY_DELEGATE)$(PATH_SEP)build"; \
fi

build-inbox:
ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
cd $(INBOX_DIR) && fdev build --features contract && \
hash=$$(bash -c "fdev inspect build$(PATH_SEP)freenet$(PATH_SEP)freenet_email_inbox code | grep 'code hash:' | cut -d' ' -f3") && \
mkdir -p $(WEB_DIR_SRC)$(PATH_SEP)..$(PATH_SEP)build && \
Expand All @@ -53,6 +60,9 @@ run-web:
dx serve --features use-node --port 57616

build-webapp:
ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
cd $(INBOX_WEB_DIR) && dx build --target index.html --release --platform web --features use-node && \
sed -i 's@/./assets@./assets@g' dist/index.html && \
fdev build
Expand All @@ -61,4 +71,7 @@ publish-webapp:
cd $(INBOX_WEB_DIR) && fdev publish --code build$(PATH_SEP)freenet$(PATH_SEP)freenet_email_app_web contract --state build$(PATH_SEP)freenet$(PATH_SEP)contract-state

clean:
ifeq ($(CARGO_TARGET_DIR),)
$(error CARGO_TARGET_DIR is not set)
endif
rm -rf $(CARGO_TARGET_DIR)
2 changes: 1 addition & 1 deletion build-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export CARGO_TARGET_DIR="$(pwd)/target" &&
cd stdlib/typescript/ &&
npm run dev.package &&
cd ../.. &&
cargo install dioxus-cli
cargo install dioxus-cli --force
cargo install --path crates/core --force &&
cargo install --path crates/fdev --force &&
cd ./modules/identity-management/ && make build &&
Expand Down
Loading