annotate tests/urblog.ur @ 1739:c414850f206f

Add support for -boot flag, which allows in-tree execution of Ur/Web The boot flag rewrites most hardcoded paths to point to the build directory, and also forces static compilation. This is convenient for developing Ur/Web, or if you cannot 'sudo make install' Ur/Web. The following changes were made: * Header files were moved to include/urweb instead of include; this lets FFI users point their C_INCLUDE_PATH at this directory at write <urweb/urweb.h>. For internal Ur/Web executables, we simply pass -I$PATH/include/urweb as normal. * Differentiate between LIB and SRCLIB; SRCLIB is Ur and JavaScript source files, while LIB is compiled products from libtool. For in-tree compilation these live in different places. * No longer reference Config for paths; instead use Settings; these settings can be changed dynamically by Compiler.enableBoot () (TODO: add a disableBoot function.) * config.h is now generated directly in include/urweb/config.h, for consistency's sake (especially since it gets installed along with the rest of the headers!) * All of the autotools build products got updated. * The linkStatic field in protocols now only contains the name of the build product, and not the absolute path. Future users have to be careful not to reference the Settings files to early, lest they get an old version (this was the source of two bugs during development of this patch.)
author Edward Z. Yang <ezyang@mit.edu>
date Wed, 02 May 2012 17:17:57 -0400
parents 19e8e3d556d6
children
rev   line source
adam@1443 1 table entry : { Id : int, Title : string, Created : time, Author : string,
adam@1443 2 Body : string }
adam@1443 3 PRIMARY KEY Id
adam@1443 4
adam@1443 5 fun list () =
adam@1443 6 rows <- queryX (SELECT * FROM entry)
adam@1443 7 (fn row =>
adam@1443 8 <xml>
adam@1443 9 <div>
adam@1443 10 <h1>{[row.Entry.Title]}</h1><br />
adam@1443 11 <h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2>
adam@1443 12 <p>{[row.Entry.Body]}</p>
adam@1443 13 </div>
adam@1443 14 </xml>
adam@1443 15 );
adam@1443 16 return
adam@1443 17 <xml>
adam@1443 18 <head>
adam@1443 19 <title>All Entries</title>
adam@1443 20 </head>
adam@1443 21 <body>
adam@1443 22 <h1>All Entries</h1>
adam@1443 23 {rows}
adam@1443 24 </body>
adam@1443 25 </xml>
adam@1443 26
adam@1443 27 fun main () = return <xml>
adam@1443 28 <head>
adam@1443 29 <title>UrBlog</title>
adam@1443 30 </head>
adam@1443 31
adam@1443 32 <body>
adam@1443 33 <h1>UrBlog</h1>
adam@1443 34 </body>
adam@1443 35 </xml>