root / webodf / CMakeLists.txt @ 229288c0
History | View | Annotate | Download (3.1 kB)
| 1 | |
|---|---|
| 2 | set(LIBJSFILES lib/packages.js lib/runtime.js lib/core/Base64.js lib/core/RawDeflate.js lib/core/ByteArray.js lib/core/RawInflate.js lib/core/Cursor.js lib/core/UnitTester.js lib/core/PointWalker.js lib/core/Async.js lib/core/Zip.js lib/gui/Caret.js lib/gui/SelectionMover.js lib/gui/XMLEdit.js lib/odf/OdfContainer.js lib/odf/Style2CSS.js odf.js) |
| 3 | |
| 4 | if (CMAKE_Java_RUNTIME) |
| 5 | |
| 6 | set(SHARED_CLOSURE_ARGS --warning_level VERBOSE --formatting PRETTY_PRINT --jscomp_error accessControls --jscomp_error checkRegExp --jscomp_error checkTypes --jscomp_error checkVars --jscomp_error deprecated --jscomp_error fileoverviewTags --jscomp_error invalidCasts --jscomp_error missingProperties --jscomp_error nonStandardJsDocs --jscomp_error strictModuleDepCheck --jscomp_error undefinedVars --jscomp_error unknownDefines --jscomp_error visibility) |
| 7 | |
| 8 | foreach(JSFILE ${LIBJSFILES})
|
| 9 | set(SHARED_CLOSURE_ARGS ${SHARED_CLOSURE_ARGS}
|
| 10 | --js ${CMAKE_CURRENT_SOURCE_DIR}/${JSFILE})
|
| 11 | endforeach(JSFILE ${LIBJSFILES})
|
| 12 | |
| 13 | add_custom_command( |
| 14 | OUTPUT simplecompiled.js |
| 15 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 16 | ARGS -jar ${CLOSURE_JAR}
|
| 17 | ${SHARED_CLOSURE_ARGS}
|
| 18 | --compilation_level WHITESPACE_ONLY |
| 19 | --js_output_file simplecompiled.js |
| 20 | DEPENDS ${LIBJSFILES}
|
| 21 | ) |
| 22 | |
| 23 | add_custom_command( |
| 24 | OUTPUT compiled.js |
| 25 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 26 | ARGS -jar ${CLOSURE_JAR}
|
| 27 | --define='IS_COMPILED_CODE=true' |
| 28 | ${SHARED_CLOSURE_ARGS}
|
| 29 | --compilation_level ADVANCED_OPTIMIZATIONS |
| 30 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 31 | --js_output_file compiled.js |
| 32 | DEPENDS ${LIBJSFILES} tools/externs.js
|
| 33 | ) |
| 34 | |
| 35 | add_custom_target(syntaxcheck ALL DEPENDS simplecompiled.js compiled.js) |
| 36 | |
| 37 | add_custom_target(rhinotest |
| 38 | COMMAND ${CMAKE_Java_RUNTIME} -jar ${RHINO}
|
| 39 | -debug lib/runtime.js tests/tests.js |
| 40 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 41 | SOURCES ${LIBJSFILES}
|
| 42 | ) |
| 43 | add_custom_target(simplerhinotest |
| 44 | COMMAND ${CMAKE_Java_RUNTIME} -jar ${RHINO}
|
| 45 | ${CMAKE_CURRENT_BINARY_DIR}/simplecompiled.js
|
| 46 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
|
| 47 | DEPENDS simplecompiled.js |
| 48 | ) |
| 49 | add_custom_command( |
| 50 | OUTPUT docs/index.html |
| 51 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 52 | ARGS -jar ${JSDOCDIR}/jsrun.jar
|
| 53 | ${JSDOCDIR}/app/run.js -d=${CMAKE_CURRENT_BINARY_DIR}/docs
|
| 54 | -t=${JSDOCDIR}/templates/jsdoc ${LIBJSFILES}
|
| 55 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 56 | DEPENDS ${LIBJSFILES}
|
| 57 | ) |
| 58 | add_custom_target(doc DEPENDS docs/index.html) |
| 59 | |
| 60 | endif (CMAKE_Java_RUNTIME) |
| 61 | |
| 62 | add_custom_target(nodetest ALL |
| 63 | COMMAND ${NODE} lib/runtime.js tests/tests.js
|
| 64 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 65 | SOURCES ${LIBJSFILES}
|
| 66 | ) |
| 67 | add_custom_target(simplenodetest ALL |
| 68 | COMMAND ${NODE} ${CMAKE_CURRENT_BINARY_DIR}/simplecompiled.js
|
| 69 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
|
| 70 | DEPENDS simplecompiled.js |
| 71 | ) |
| 72 | add_custom_command( |
| 73 | OUTPUT instrumented/index.html |
| 74 | COMMAND ${JSCOVERAGE}
|
| 75 | ARGS ${CMAKE_CURRENT_SOURCE_DIR} instrumented
|
| 76 | DEPENDS ${LIBJSFILES}
|
| 77 | ) |
| 78 | add_custom_target(instrumented DEPENDS instrumented/index.html) |