Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (55 sloc) 1.99 KB
Copyright © 2011, 2012 MLstate
This file is part of Opa.
Opa is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
Opa is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with Opa. If not, see <>.
(** Generate plugin files from JS given to the opa compiler. Mostly
copied from
@author Arthur Azevedo de Amorim
module BR = BslRegisterLib
module BI = BslInterface
module PH = PassHandler
module O = OpaEnv
module List = BaseList
let process env =
let js_files = env.PH.options.O.client_plugin_files in
let nodejs_files = env.PH.options.O.server_plugin_files in
let all_files = js_files @ nodejs_files in
if not (List.is_empty js_files && List.is_empty nodejs_files) then (
(* TODO: ensure we are in qmljs, and not qmlflat *)
let basename = None in
let ml_plugin_filename =
"bundled" ^ BslConvention.Suffix.plugin ^ ".ml" in
let ml_runtime_filename =
"bundled" ^ BslConvention.Suffix.mlruntime ^ ".ml" in
let options = {
bypass_plugins = [];
check_style = false;
js_validator = None;
modular_plugins = false;
unsafe_js = false;
unsafe_opa = false;
js_classic_bypass_syntax = env.PH.options.O.js_classic_bypass_syntax;
} in
let session = BR.create ~options in
let session = List.fold_left BR.preprocess_file session all_files in
let fin = BR.finalize session in
let plugin = BR.plugin fin in plugin;
Jump to Line
Something went wrong with that request. Please try again.