blob: c706e4d37700ba3fbf22970c018f9bb72ae0dcac [file] [log] [blame]
include ../make/
.PHONY: build
build: build-placeholders
$(BAZEL) build //jsfiddle/...
.PHONY: push
push: release
pushk jsfiddle
.PHONY: release
release: wasm_libs
$(BAZEL) run //jsfiddle:push_jsfiddle_container
$(MAKE) build-placeholders
.PHONY: wasm_libs
docker pull
rm -rf build/canvaskit build/pathkit build/debugger
mkdir -p build/canvaskit build/pathkit
# Extract them from the most recently built docker container. This is built
# with @skia//docker/skia-wasm-release/Dockerfile
docker run -u $$(id -u ${USER}):$$(id -g ${USER}) --rm \
--volume `pwd`/build:/OUT \
sh -c "cp -r /tmp/* /OUT/"
echo "const SKIA_VERSION = '`cat build/VERSION`';" > build/version.js
.PHONY: bazel_release_ci
# COPY_FROM_DIR is expected to be set by the auto deploy mechanism, e.g.
cp -r $(COPY_FROM_DIR)/* build/
echo "const SKIA_VERSION = '`cat ./build/VERSION`';" > ./build/version.js
bazelisk run //jsfiddle:push_jsfiddle_container --workspace_status_command=bazel/
$(MAKE) build-placeholders
.PHONY: run-local-instance
run-local-instance: build
../_bazel_bin/jsfiddle/go/jsfiddle/jsfiddle_/jsfiddle --local --resources_dir ../_bazel_bin/jsfiddle/pages/development
.PHONY: run-with-custom
echo "Using the wasm files in //jsfiddle/wasm_libs/local_build"
$(BAZEL) build //jsfiddle/... --with_local_wasm
../_bazel_bin/jsfiddle/go/jsfiddle/jsfiddle_/jsfiddle \
--local --resources_dir ../_bazel_bin/jsfiddle/pages/development
.PHONY: build-placeholders
rm -rf build
mkdir -p build/canvaskit build/pathkit
touch build/pathkit/pathkit.js
touch build/pathkit/pathkit.wasm
touch build/canvaskit/canvaskit.js
touch build/canvaskit/canvaskit.wasm
touch build/version.js