File tree 4 files changed +54
-0
lines changed 4 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Build information file.
3
+ * To be overwritten for builds by util/publish.
4
+ */
5
+
6
+ QMLWEB_BUILDINFO = {
7
+ // Base commit hash for build.
8
+ // "git" when not built
9
+ hash : "git" ,
10
+ // Timestamp of build, in seconds since epoch
11
+ timestamp : Math . floor ( ( new Date ) . getTime ( ) / 1000 )
12
+ } ;
Original file line number Diff line number Diff line change 2
2
< script src ="../../src/parser.js "> </ script >
3
3
< script src ="../../src/import.js "> </ script >
4
4
< script src ="../../src/qtcore.js "> </ script >
5
+ < script src ="../../src/buildinfo.js "> </ script >
5
6
< style >
6
7
.hidden {
7
8
display : none;
12
13
< canvas id ="canvas " style ="border: 1px solid black "> </ canvas > < br />
13
14
< b > Currently supported browsers: Opera, Firefox, Chrome</ b > -- behavior on other browsers may vary.< br />
14
15
Your browser: < span id ="browserId "> Unknown</ span > < br />
16
+ QMLWEB buildinfo: < span id ="buildId "> Unknown</ span > < br />
15
17
< table > < tr > < td style ="vertical-align: bottom;width: 50% ">
16
18
Select file to run:< br />
17
19
< span id ="qmlList "> </ span >
103
105
} ;
104
106
105
107
document . getElementById ( "browserId" ) . innerHTML = navigator . userAgent ;
108
+ document . getElementById ( "buildId" ) . innerHTML = JSON . stringify ( QMLWEB_BUILDINFO ) ;
106
109
107
110
// CSS class helpers
108
111
function addClass ( el , name ) {
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # See src/buildinfo.js for details
4
+
5
+
6
+ HASH=` git log -n 1 --format=tformat:%H`
7
+ DATE=` date +%s`
8
+
9
+ echo " QMLWEB_BUILDINFO = { hash: '$HASH ', date: $DATE };"
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ function usage {
4
+ echo " Usage: $0 TARGET"
5
+ echo " Copies files to TARGET directory and updates buildinfo.js."
6
+ echo " TARGET should exist."
7
+ }
8
+
9
+ if [ -z " $1 " ]; then
10
+ usage
11
+ exit
12
+ fi
13
+
14
+ if [ ! -d " $1 " ]; then
15
+ echo " $1 must be a directory."
16
+ exit ;
17
+ fi
18
+
19
+ UTIL_DIR=` dirname $0 `
20
+ BASE=` readlink -f " $UTIL_DIR /.." `
21
+ TARGET=$1
22
+
23
+ # Copy files
24
+ echo " Copying files to $TARGET "
25
+ cp --recursive " $BASE /src" " $TARGET "
26
+ cp --recursive " $BASE /test" " $TARGET "
27
+
28
+ echo " Updating build info to $TARGET /src/buildinfo.js"
29
+ $UTIL_DIR /gen_buildinfo > " $TARGET /src/buildinfo.js"
30
+
You can’t perform that action at this time.
0 commit comments