forked from lucee/lucee-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cfm
39 lines (33 loc) · 1.15 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
<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()
savecontent variable="suppressingwhitespacehere" {
new api.build.BuildRunner().buildAll();
}
content reset="true" type="text/plain";
echo( "---" & newline );
echo( "Documentation built in #NumberFormat( getTickCount()-startTime )#ms" & newline );
echo( "---" & newline );
} catch ( any e ) {
exitCode( 1 );
echo( "" & newline );
echo( "Documentation build error" & newline );
echo( "-------------------------" & newline );
echo( "" & newline );
echo( "[#e.type#] error occurred while building the docs. Message: [#e.message#]. Detail: [#e.detail#]." & newline );
if ( ( e.tagContext ?: [] ).len() ) {
echo( "" & newline );
echo( "Stacktrace:" & newline );
for( var tracePoint in e.tagContext ) {
echo( " " & tracepoint.template & " (line #tracepoint.line#)" & newline );
}
}
}
</cfscript>