diff --git a/ivette/src/frama-c/api_generator.ml b/src/plugins/api-generator/api_generator.ml similarity index 97% rename from ivette/src/frama-c/api_generator.ml rename to src/plugins/api-generator/api_generator.ml index 5e29fab1eb556a5c6925f9f7eaafc9369d33c2bd..58e8852eef68efba8f3e7ca90c3bb20189f5e495 100644 --- a/ivette/src/frama-c/api_generator.ml +++ b/src/plugins/api-generator/api_generator.ml @@ -559,20 +559,22 @@ let makePackage pkg path fmt = (* -------------------------------------------------------------------------- *) let generate () = - begin - Pkg.iter - begin fun pkg -> - let path = pkg_path ~plugin:pkg.p_plugin ~package:pkg.p_package in - Self.feedback "Package %s" path ; - let out = OUT.get () in - let file = Printf.sprintf "%s/%s/index.ts" out path in - let dir = Filename.dirname file in - if not (Sys.file_exists dir && Sys.is_directory dir) then - Extlib.mkdir ~parents:true dir 0o755 ; - Command.print_file file (makePackage pkg path) ; - end - end - -let () = Db.Main.extend generate + if TSC.get () then + begin + Pkg.iter + begin fun pkg -> + let path = pkg_path ~plugin:pkg.p_plugin ~package:pkg.p_package in + Self.feedback "Package %s" path ; + let out = OUT.get () in + let file = Printf.sprintf "%s/%s/index.ts" out path in + let dir = Filename.dirname file in + if not (Sys.file_exists dir && Sys.is_directory dir) then + Extlib.mkdir ~parents:true dir 0o755 ; + Command.print_file file (makePackage pkg path) ; + end + end + +let () = + Db.Main.extend generate (* -------------------------------------------------------------------------- *) diff --git a/src/plugins/api-generator/dune b/src/plugins/api-generator/dune new file mode 100644 index 0000000000000000000000000000000000000000..680e379bab49f54f791c260c40085f8e703ff462 --- /dev/null +++ b/src/plugins/api-generator/dune @@ -0,0 +1,8 @@ +( library + (name api_generator) + (public_name frama-c-api-generator.core) + (flags -open Frama_c_kernel :standard -w -9) + (libraries frama-c.kernel frama-c-server.core) +) + +(plugin (optional) (name api_generator) (libraries frama-c-api-generator.core) (site (frama-c plugins))) diff --git a/src/plugins/api-generator/dune-project b/src/plugins/api-generator/dune-project new file mode 100644 index 0000000000000000000000000000000000000000..f6165d71f2653e808953df171e5b6317b96cc254 --- /dev/null +++ b/src/plugins/api-generator/dune-project @@ -0,0 +1,3 @@ +(lang dune 2.8) +(name frama-c-api-generator) +(using dune_site 0.1) diff --git a/src/plugins/api-generator/frama-c-api-generator.opam b/src/plugins/api-generator/frama-c-api-generator.opam new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391