Verified Commit 1a173867 authored by Camil Staps's avatar Camil Staps 🚀

Remove runtime --sapldir option; add --bytecodepath option; rely on cpm/IDE to...

Remove runtime --sapldir option; add --bytecodepath option; rely on cpm/IDE to generate prelinked bytecode
parent 19534303
Pipeline #20782 failed with stage
in 1 minute and 16 seconds
......@@ -74,7 +74,7 @@ instance Startable (a,b) | Startable a & Startable b
, webDirPath :: FilePath // Location of public files that are served by the iTask webserver
, storeDirPath :: FilePath // Location of the application's persistent data files
, tempDirPath :: FilePath // Location for temporary files used in tasks
, saplDirPath :: FilePath // Location of the application's sapl files (client-side code)
, byteCodePath :: FilePath // Location of the application's bytecode
}
/**
......
......@@ -126,8 +126,8 @@ where
("Specify the folder containing the data stores\ndefault: " +++ defaults.storeDirPath)
, Option [] ["tempdir"] (ReqArg (\p->fmap \o->{o & tempDirPath=p}) "PATH")
("Specify the folder containing the temporary files\ndefault: " +++ defaults.tempDirPath)
, Option [] ["sapldir"] (ReqArg (\p->fmap \o->{o & saplDirPath=p}) "PATH")
("Specify the folder containing the sapl files\ndefault: " +++ defaults.saplDirPath)
, Option [] ["bytecodepath"] (ReqArg (\p->fmap \o->{o & byteCodePath=p}) "PATH")
("Specify the app's bytecode file\ndefault: " +++ defaults.byteCodePath)
, Option [] ["distributed"] (NoArg (fmap \o->{o & distributed=True}))
"Enable distributed mode (populate the symbols share)"
, Option ['s'] ["sdsPort"] (ReqArg (\p->fmap \o->{o & sdsPort=toInt p}) "SDSPORT")
......@@ -212,7 +212,7 @@ defaultEngineOptions world
, webDirPath = appDir </> appName +++ "-www"
, storeDirPath = appDir </> appName +++ "-data" </> "stores"
, tempDirPath = appDir </> appName +++ "-data" </> "tmp"
, saplDirPath = appDir </> appName +++ "-sapl"
, byteCodePath = appDir </> appName +++ ".bc"
}
= (options,world)
......
......@@ -14,8 +14,7 @@ import iTasks.UI.Editor
serialize_for_client :: f !*IWorld -> *(!MaybeErrorString String, !*IWorld)
serialize_for_client f iworld=:{world,options}
# (graph,world) = serialize_for_prelinked_interpretation f (options.appName+++".bc") options.appPath world
// TODO: store bytecodePath in EngineOptions
# (graph,world) = serialize_for_prelinked_interpretation f options.byteCodePath options.appPath world
# iworld & world = world
# graph = case graph of
Nothing -> Error "Failed to serialize graph"
......
......@@ -513,10 +513,13 @@ where
lostFun _ _ s env = (Nothing, env)
handleStaticResourceRequest :: !HTTPRequest *IWorld -> (!HTTPResponse,!*IWorld)
handleStaticResourceRequest req iworld=:{IWorld|options={webDirPath},world}
# filename = if (isMember req.HTTPRequest.req_path taskPaths) //Check if one of the published tasks is requested, then serve bootstrap page
(webDirPath +++ filePath "/index.html")
(webDirPath +++ filePath req.HTTPRequest.req_path)
handleStaticResourceRequest req iworld=:{IWorld|options={webDirPath,byteCodePath},world}
# filename = case isMember req.HTTPRequest.req_path taskPaths of //Check if one of the published tasks is requested, then serve bootstrap page
True
-> webDirPath +++ filePath "/index.html"
-> if (req.HTTPRequest.req_path=="/js/app.pbc")
((byteCodePath % (0,size byteCodePath-3)) +++ "pbc")
(webDirPath +++ filePath req.HTTPRequest.req_path)
# type = mimeType filename
# (mbInfo,world) = getFileInfo filename world
......
......@@ -85,7 +85,7 @@ const abc_interpreter={
},
};
abc_interpreter.loading_promise=fetch('js/app.ubc').then(function(resp){
abc_interpreter.loading_promise=fetch('js/app.pbc').then(function(resp){
if (!resp.ok)
throw 'failed to fetch bytecode';
return resp.arrayBuffer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment