forked from lucee/lucee-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cfm
47 lines (41 loc) · 1.61 KB
/
build.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<cfprocessingdirective suppressWhitespace="true" />
<cfsetting requesttimeout="1200" />
<cfscript>
newline = Chr( 10 );
function exitCode( required numeric code ) {
var exitcodeFile = GetDirectoryFromPath( GetCurrentTemplatePath() ) & "/.exitcode";
FileWrite( exitcodeFile, code );
}
try {
startTime = getTickCount();
logger = new api.build.Logger( opts={ textOnly: true, console: true }, force: true );
request.loggerFlushEnabled = true;
logger.logger(" ");
logger.logger( "Lucee " & server.lucee.version & ", java " & server.java.version );
logger.logger(" ");
logger.logger ("assetBundleVersion: " & application.assetBundleVersion);
logger.logger(" ");
//savecontent variable="suppressingwhitespacehere" {
new api.build.BuildRunner(threads=1).buildAll();
//}
//content reset="true" type="text/plain";
logger.logger( "---" & newline );
logger.logger( "Documentation built in #NumberFormat( getTickCount()-startTime )#ms" & newline );
logger.logger( "---" & newline );
} catch ( any e ) {
logger.logger( "" & newline );
logger.logger( "Documentation build error" & newline );
logger.logger( "-------------------------" & newline );
logger.logger( "" & newline );
logger.logger( "[#e.type#] error occurred while building the docs. Message: [#e.message#]. Detail: [#e.detail#]." & newline );
if ( ( e.tagContext ?: [] ).len() ) {
logger.logger( "" & newline );
logger.logger( "Stacktrace:" & newline );
for( tracePoint in e.tagContext ) {
logger.logger( " " & tracepoint.template & " (line #tracepoint.line#)" & newline );
}
}
exitCode( 1 );
rethrow;
}
</cfscript>