Fetching contributors…
Cannot retrieve contributors at this time
64 lines (55 sloc) 1.53 KB
Copyright © 2011 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 <>.
module Extension =
type extension = string
let bypass = "bypass"
let jsconf = "jsconf"
let plugin = "opp"
module Suffix =
type suffix = string
let jskeys = "JSkeys"
let loader = "Loader"
let marshalplugin = ""
let mlruntime = "MLRuntime"
let plugin = "Plugin"
let plugin_name name =
let name = Filename.basename name in
let name = File.chop_extension name in
let name = String.uncapitalize name in
type inclusion = {
extrapath : string ;
extralib : string ;
plugin : string ;
let inclusion ~cwd opp =
let plugin_name = plugin_name opp in
let prefix =
if Filename.is_relative opp
then cwd
else ""
let (/) = Filename.concat in
let extrapath = prefix/opp in
let extralib = plugin_name^Suffix.mlruntime^".cmx" in
let plugin = prefix/opp/(plugin_name^"."^Extension.bypass) in
extrapath ;
extralib ;
plugin ;