+Fasl generation, +Selective recompiling
[lineal.git] / src / webui / serv.lisp
blob300e4d7e93fb5cf2fe20792f2cd52d62885815ed
2 ; This file should be called from the toplevel directory.
3 ; You can call it like (load "src/webui/serv"),
4 ; use a system link,
5 ; or *default-pathname-defaults*
7 ;V Just in case user loaded this file first.V
8 (defpackage :lineal.devvars (:use :cl))
9 (in-package :lineal.devvars)
11 (format t "serv.lisp is loaded...~%")
12 (load (make-pathname :directory '(:relative "src" "webui")
13 :name "devvars"))
15 (format t "No errors? Relative path is good...~%")
17 (format t "Using ASDF, you better have it loaded already...~%")
18 (use-package :asdf)
19 (format t "... looks like it worked.~%")
21 (format t "Loading package dependencies.~%")
23 ;V Load the required libraries using V
24 ;V functions best with the lisp. V
25 (mapcar
26 (lambda (pkg)
27 (format t "Loading ~A...~%" pkg)
28 #+(or :sbcl :mcl :ecl :cmucl)
29 (require pkg)
30 #-(or :sbcl :mcl :ecl :cmucl)
31 (asdf:operate 'asdf:load-op pkg)
32 (format t "... ~A loaded.~%" pkg))
33 (list :hunchentoot :cl-who :parenscript))
35 (format t "Compiling and loading source tree...~%")
36 ;V Compile and Load V
37 (compile-lineal)
39 (format t "Generating JavaScript files if needed...~%")
40 (lineal.webui::recompile-ps)
41 (format t "... success! We are now w3c complaint!~%")
43 ;V Enact any config options.V
44 (when (boundp 'tmp-directory)
45 (ensure-directories-exist
46 (symbol-value 'tmp-directory))
47 (setf lineal.webui::*tmp-directory*
48 (symbol-value 'tmp-directory))
49 (format t "Custom tmp directory set to: ~A~%"
50 (truename (symbol-value 'tmp-directory))))
52 (when (boundp 'log-file)
53 (open (ensure-directories-exist
54 (symbol-value 'log-file))
55 :direction :probe :if-does-not-exist :create)
56 (setf (lineal.webui::log-file)
57 (symbol-value 'log-file))
58 (format t "Custom log file will be at: ~A~%"
59 (truename (symbol-value 'log-file))))
61 ;V Load up restore file.V
62 (when (boundp 'restore-from-file)
63 (let ((file (symbol-value 'restore-from-file)))
64 (unless (pathnamep file)
65 (setq file (make-pathname :name "captured_session")))
66 (format t "Restoring session from: \"~A\"...~%"
67 (namestring file))
68 (princ (lineal::local-restore file))
69 (fresh-line)))
71 ;V Start server at specified port. V
72 (let ((the-port (if (boundp 'port)
73 (symbol-value 'port) 41938)))
74 (format t "Starting Lineal on port ~A... " the-port)
75 (lineal.webui:start-server :port the-port)
76 (format t "OK~%Now point your bowser to ~
77 http://localhost:~A/ and have at it!~%"
78 the-port))
80 (import 'lineal::local-capture :cl-user)