This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
(executables
|
||||
(names technologic)
|
||||
(libraries js_of_ocaml x)
|
||||
(js_of_ocaml
|
||||
(flags (:standard))
|
||||
(javascript_files runtime.js)))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
global.globalPrintFunction = function(x){
|
||||
console.log(x);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
module Js = Js_of_ocaml.Js
|
||||
|
||||
let _ =
|
||||
print_endline X.buy_it;
|
||||
let obj = Js.Unsafe.obj [|"name", Js.Unsafe.inject (Js.string Z.use_it)|] in
|
||||
Printf.printf "%s\n%!" (X.print obj);
|
||||
X.external_print (Js.string "break it");
|
||||
(fun x ->
|
||||
let global = Js.Unsafe.get Js.Unsafe.global "global" in
|
||||
let globalPrintFunction : Js.js_string Js.t -> unit =
|
||||
Js.Unsafe.get global "globalPrintFunction" in
|
||||
globalPrintFunction x
|
||||
) (Js.string "fix it")
|
||||
|
|
@ -0,0 +1 @@
|
|||
let use_it = "use it"
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.11)
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
(library
|
||||
(name x)
|
||||
(libraries js_of_ocaml)
|
||||
(public_name x)
|
||||
(js_of_ocaml
|
||||
(flags (--pretty)) (javascript_files runtime.js)))
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
|
||||
//Provides: jsPrint
|
||||
function jsPrint(x){
|
||||
console.log(x);
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
module Js = Js_of_ocaml.Js
|
||||
|
||||
let buy_it = "buy " ^ Y.it
|
||||
let print x = Js.to_string (Js.Unsafe.get x "name")
|
||||
external external_print : Js.js_string Js.t -> unit = "jsPrint"
|
||||
|
|
@ -0,0 +1 @@
|
|||
let it = "it"
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
Compilation using jsoo
|
||||
|
||||
$ dune build --display short bin/technologic.bc.js @install 2>&1 | \
|
||||
> sed s,^\ *$(ocamlc -config-var c_compiler),\ \ C_COMPILER,g
|
||||
ocamldep bin/.technologic.eobjs/technologic.impl.d
|
||||
ocamldep lib/.x.objs/x.impl.d
|
||||
ocamlc lib/.x.objs/byte/x__.{cmi,cmo,cmt}
|
||||
ocamldep lib/.x.objs/x__Y.impl.d
|
||||
js_of_ocaml bin/.technologic.eobjs/jsoo/technologic.bc.runtime.js
|
||||
ocamldep bin/.technologic.eobjs/z.impl.d
|
||||
ocamlopt lib/.x.objs/native/x__.{cmx,o}
|
||||
ocamlc lib/.x.objs/byte/x__Y.{cmi,cmo,cmt}
|
||||
js_of_ocaml .js/default/stdlib/stdlib.cma.js
|
||||
js_of_ocaml .js/default/stdlib/std_exit.cmo.js
|
||||
ocamlopt lib/.x.objs/native/x__Y.{cmx,o}
|
||||
ocamlc lib/.x.objs/byte/x.{cmi,cmo,cmt}
|
||||
js_of_ocaml .js/default/js_of_ocaml-compiler.runtime/jsoo_runtime.cma.js
|
||||
ocamlopt lib/.x.objs/native/x.{cmx,o}
|
||||
ocamlc bin/.technologic.eobjs/byte/z.{cmi,cmo,cmt}
|
||||
ocamlc lib/x.cma
|
||||
js_of_ocaml .js/default/js_of_ocaml/js_of_ocaml.cma.js
|
||||
ocamlopt lib/x.{a,cmxa}
|
||||
ocamlc bin/.technologic.eobjs/byte/technologic.{cmi,cmo,cmt}
|
||||
js_of_ocaml lib/.x.objs/jsoo/default/x.cma.js
|
||||
ocamlopt lib/x.cmxs
|
||||
js_of_ocaml bin/.technologic.eobjs/jsoo/z.cmo.js
|
||||
js_of_ocaml bin/.technologic.eobjs/jsoo/technologic.cmo.js
|
||||
js_of_ocaml bin/technologic.bc.js
|
||||
$ node ./_build/default/bin/technologic.bc.js
|
||||
buy it
|
||||
use it
|
||||
break it
|
||||
fix it
|
||||
$ dune build bin/technologic.bc.js @install --profile release
|
||||
$ node ./_build/default/bin/technologic.bc.js
|
||||
buy it
|
||||
use it
|
||||
break it
|
||||
fix it
|
||||
$ cat >dune-workspace <<EOF
|
||||
> (lang dune 2.0)
|
||||
> (context
|
||||
> (default (disable_dynamically_linked_foreign_archives true)))
|
||||
> EOF
|
||||
$ dune build bin/technologic.bc.js @install --profile dev
|
||||
$ dune build bin/technologic.bc.js @install --profile release
|
||||
Loading…
Add table
Add a link
Reference in a new issue