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

Frama-c plugin skeleton #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions packages/framac_plugin/dune_
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; generated by drom from package skeleton 'framac_plugin'

(plugin
(name !{program-name})
(package !{name})
(libraries !{program-name}.core)
(site (frama-c plugins))
)

(library
(name !{program-name}_lib)
(public_name !{program-name}.core)
(flags -open Frama_c_kernel :standard)
(libraries frama-c.kernel !{dune-libraries})
)
5 changes: 5 additions & 0 deletions packages/framac_plugin/index.mld
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{1 Plugin !{name}}

!{description}

Version: !{version}
23 changes: 23 additions & 0 deletions packages/framac_plugin/main.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
!{header-ml}

(* If you delete or rename this file, you should add
'src/!{name}/main.ml' to the 'skip' field in "drom.toml" *)

let help_msg = "output a warm welcome message to the user"
module Self = Plugin.Register (struct
let name = "!{program-name}"
let shortname = "!{name}"
let help = help_msg
end)

let run () =
try
let chan = open_out "hello.out" in
Printf.fprintf chan "Hello, world!\n";
flush chan;
close_out chan
with Sys_error _ as exc ->
let msg = Printexc.to_string exc in
Printf.eprintf "There was an error: %s\n" msg

let () = Boot.Main.extend run
4 changes: 4 additions & 0 deletions packages/framac_plugin/package.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Everything above is inherited from 'virtual' package skeleton

skeleton := "framac_plugin"
kind := "program"
9 changes: 9 additions & 0 deletions packages/framac_plugin/skeleton.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[skeleton]
name = "framac_plugin"
inherits = "virtual"

[file]
dune_ = { file = "dune", skips = "@dune" }
"main.ml" = {skips = "@code" }
"index.mld" = { skips = [ "@docs" ] }