diff --git a/.drom b/.drom index aea4ca6a..bf8a2af5 100644 --- a/.drom +++ b/.drom @@ -5,7 +5,7 @@ version:0.9.0 # hash of toml configuration files # used for generation of all files -d369e2949d85dee79233d322ce6f7587:. +1bebcb610f386901c07c8def471aced1:. # end context for . # begin context for .github/workflows/workflow.yml @@ -25,7 +25,7 @@ d369e2949d85dee79233d322ce6f7587:. # begin context for Makefile # file Makefile -47a1f06175119e41d07c168651c1a645:Makefile +8a54c5db91ea9eff48ead8dc49f5d05e:Makefile # end context for Makefile # begin context for README.md @@ -75,7 +75,7 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css # begin context for dune-project # file dune-project -456fa426d82598ce9843614e380d00d7:dune-project +b31bfdac90731aba7623d6bace37737f:dune-project # end context for dune-project # begin context for opam/cobol_cfg.opam @@ -95,7 +95,7 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css # begin context for opam/cobol_data.opam # file opam/cobol_data.opam -02198635cb5365931deb20b655889630:opam/cobol_data.opam +4d79b472ecc1854518e933df4c865a88:opam/cobol_data.opam # end context for opam/cobol_data.opam # begin context for opam/cobol_indent.opam @@ -320,7 +320,7 @@ c6c7cd50f0ebff63bab991bf9a1633e6:src/lsp/cobol_cfg/dune # begin context for src/lsp/cobol_data/dune # file src/lsp/cobol_data/dune -4c5f42c322869bf815a6afc8a9ebea98:src/lsp/cobol_data/dune +805bc16e08adbaf3eb464cf85f49c6fb:src/lsp/cobol_data/dune # end context for src/lsp/cobol_data/dune # begin context for src/lsp/cobol_data/version.mlt @@ -470,7 +470,7 @@ c222bcf238c7b0cd7c910fc5ec8e2dcd:src/lsp/sql_parser/dune # begin context for src/lsp/superbol-free/dune # file src/lsp/superbol-free/dune -095155be06e2840753e52b3d03d541b9:src/lsp/superbol-free/dune +4783fc059cd720e7b501e24e65b52688:src/lsp/superbol-free/dune # end context for src/lsp/superbol-free/dune # begin context for src/lsp/superbol-free/linking_flags.sh diff --git a/Makefile b/Makefile index ed2894e6..4e2177b3 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,12 @@ build: ./scripts/before.sh build ifeq ($(TARGET_PLAT)_$(BUILD_STATIC_EXECS),linux_true) ./scripts/static-build.sh +else +ifeq ($(TARGET_PLAT), web) + ${DUNE} build else ${DUNE} build ${DUNE_ARGS} ${DUNE_CROSS_ARGS} @install +endif ./scripts/copy-bin.sh superbol-studio-oss superbol-vscode-platform polka-js-stubs interop-js-stubs node-js-stubs vscode-js-stubs vscode-languageclient-js-stubs vscode-json vscode-debugadapter vscode-debugprotocol superbol-free superbol_free_lib superbol_preprocs superbol_project cobol_common cobol_parser cobol_ptree ebcdic_lib cobol_lsp ppx_cobcflags pretty cobol_config cobol_indent cobol_indent_old cobol_preproc cobol_data cobol_typeck cobol_unit ez_toml ezr_toml sql_ast sql_parser cobol_cfg endif ./scripts/after.sh build diff --git a/Makefile.drom-tpl b/Makefile.drom-tpl index a0a34fe6..35f97136 100644 --- a/Makefile.drom-tpl +++ b/Makefile.drom-tpl @@ -32,8 +32,12 @@ build: ./scripts/before.sh build ifeq ($(TARGET_PLAT)_$(BUILD_STATIC_EXECS),linux_true) ./scripts/static-build.sh +else +ifeq ($(TARGET_PLAT), web) + ${DUNE} build else ${DUNE} build!{build-profile} ${DUNE_ARGS} ${DUNE_CROSS_ARGS} @install +endif ./scripts/copy-bin.sh !{packages} endif ./scripts/after.sh build diff --git a/Makefile.header b/Makefile.header index 172f78eb..2f578fb9 100644 --- a/Makefile.header +++ b/Makefile.header @@ -19,17 +19,27 @@ DUNE_BUILD_SRCDIR = \ # TARGET_PLAT is defined in Makefile TARGET_ARCH ?= x64 -TARGET_SPEC = $(TARGET_PLAT)-$(TARGET_ARCH) +ifeq ($(TARGET_PLAT), web) + TARGET_SPEC = $(TARGET_PLAT) +else + TARGET_SPEC = $(TARGET_PLAT)-$(TARGET_ARCH) +endif + TARGET_PROFILE ?= release TARGET_VSIX = $(TARGET_NAME)-$(VERSION)-$(TARGET_SPEC)-$(TARGET_PROFILE).vsix DOT_EXE = $(if $(filter win32,$(TARGET_PLAT)),.exe) SUPERBOL_LSP = superbol-free-$(TARGET_SPEC)$(DOT_EXE) SUPERBOL_LSPs = $(wildcard superbol-free-*-*) -ifeq ($(TARGET_PLAT)_$(BUILD_STATIC_EXECS),linux_true) - SUPERBOL_LSP_BUILT = superbol-free +ifeq ($(TARGET_PLAT), web) + SUPERBOL_LSP_BUILT = ${DUNE_BUILD_SRCDIR}/lsp/superbol-free/main.bc.js + SUPERBOL_LSP = superbol-free.js else - SUPERBOL_LSP_BUILT = ${DUNE_BUILD_SRCDIR}/lsp/superbol-free/main.exe + ifeq ($(TARGET_PLAT)_$(BUILD_STATIC_EXECS),linux_true) + SUPERBOL_LSP_BUILT = superbol-free + else + SUPERBOL_LSP_BUILT = ${DUNE_BUILD_SRCDIR}/lsp/superbol-free/main.exe + endif endif # Setting `GENERATE_PACKAGE_DOT_JSON` to `no` skips generation of diff --git a/dune-project b/dune-project index 37efcf90..48d84214 100644 --- a/dune-project +++ b/dune-project @@ -393,6 +393,7 @@ (description "SuperBOL Studio OSS is a new platform for COBOL") (depends (ocaml (>= 4.14.0)) + (zarith_stubs_js ( >= 0.17 )) (zarith ( >= 1 )) (cobol_ptree (= version)) (cobol_config (= version)) diff --git a/opam/cobol_data.opam b/opam/cobol_data.opam index 8e971125..a9e1f3ab 100644 --- a/opam/cobol_data.opam +++ b/opam/cobol_data.opam @@ -47,6 +47,7 @@ install: [ depends: [ "ocaml" {>= "4.14.0"} "dune" {>= "2.8.0"} + "zarith_stubs_js" {>= "0.17"} "zarith" {>= "1"} "cobol_ptree" {= version} "cobol_config" {= version} diff --git a/src/lsp/cobol_data/dune b/src/lsp/cobol_data/dune index 511aff74..32e1cbf4 100644 --- a/src/lsp/cobol_data/dune +++ b/src/lsp/cobol_data/dune @@ -5,7 +5,7 @@ (public_name cobol_data) (wrapped true) ; use field 'dune-libraries' to add libraries without opam deps - (libraries zarith cobol_ptree cobol_config cobol_common ) + (libraries zarith_stubs_js zarith cobol_ptree cobol_config cobol_common ) ; use field 'dune-flags' to set this value (flags (:standard)) ; use field 'dune-stanzas' to add more stanzas here diff --git a/src/lsp/cobol_data/package.toml b/src/lsp/cobol_data/package.toml index 79d6cb2d..f8120665 100644 --- a/src/lsp/cobol_data/package.toml +++ b/src/lsp/cobol_data/package.toml @@ -57,6 +57,7 @@ cobol_common = "version" cobol_config = "version" cobol_ptree = "version" zarith = ">=1" +zarith_stubs_js = ">=0.17" # package tools dependencies [tools] diff --git a/src/lsp/superbol-free/dune b/src/lsp/superbol-free/dune index 1e0b7391..0042ea0a 100644 --- a/src/lsp/superbol-free/dune +++ b/src/lsp/superbol-free/dune @@ -8,7 +8,7 @@ (flags ((:standard (:include linking.sexp)))) ; use field 'dune-stanzas' to add more stanzas here - + (modes exe js) ) ; Use `static-clibs` to specify static C libs (without lib prefix) diff --git a/src/vscode/superbol-vscode-platform/superbol_languageclient.ml b/src/vscode/superbol-vscode-platform/superbol_languageclient.ml index f9c4f64a..41652948 100644 --- a/src/vscode/superbol-vscode-platform/superbol_languageclient.ml +++ b/src/vscode/superbol-vscode-platform/superbol_languageclient.ml @@ -48,7 +48,8 @@ let find_superbol root = Vscode.Uri.joinPath root ~pathSegments:[name]) @@ [ Format.asprintf "%s-%s-%s%s" prefix platform arch suffix; Format.asprintf "%s-%s%s" prefix platform suffix; - Format.asprintf "%s%s" prefix suffix + Format.asprintf "%s%s" prefix suffix; + Format.asprintf "main.bc.js" ] @ if platform = "darwin" && arch = "arm64" then [ Format.sprintf "%s-%s-%s%s" prefix platform "x64" suffix] else