root / webodf / CMakeLists.txt @ 4eb07bc1
History | View | Annotate | Download (7.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/ByteArrayWriter.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 |
| 3 | lib/gui/Caret.js lib/gui/SelectionMover.js lib/gui/XMLEdit.js |
| 4 | lib/xmldom/LSSerializerFilter.js lib/xmldom/LSSerializer.js lib/xmldom/RelaxNG.js |
| 5 | lib/odf/StyleInfo.js lib/odf/Style2CSS.js lib/odf/OdfContainer.js lib/odf/Formatting.js lib/odf/OdfCanvas.js) |
| 6 | |
| 7 | set(TESTJSFILES tests/core/ZipTests.js |
| 8 | tests/core/Base64Tests.js |
| 9 | tests/core/PointWalkerTests.js |
| 10 | tests/core/CursorTests.js |
| 11 | tests/core/RuntimeTests.js |
| 12 | tests/gui/XMLEditTests.js |
| 13 | tests/gui/SelectionMoverTests.js |
| 14 | tests/gui/CaretTests.js |
| 15 | tests/tests.js |
| 16 | ) |
| 17 | |
| 18 | add_custom_target(jslintcheck ALL |
| 19 | COMMAND ${NODE} lib/runtime.js tools/runjslint.js
|
| 20 | ${LIBJSFILES} ${TESTJSFILES}
|
| 21 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 22 | SOURCES ${LIBJSFILES} ${TESTJSFILES}
|
| 23 | ) |
| 24 | |
| 25 | if (CMAKE_Java_RUNTIME) |
| 26 | |
| 27 | set(SHARED_CLOSURE_ARGS --warning_level VERBOSE --jscomp_error accessControls --jscomp_error ambiguousFunctionDecl --jscomp_error checkRegExp --jscomp_error checkTypes --jscomp_error checkVars --jscomp_error constantProperty --jscomp_error deprecated --jscomp_error externsValidation --jscomp_error fileoverviewTags --jscomp_error globalThis --jscomp_error invalidCasts --jscomp_error missingProperties --jscomp_error nonStandardJsDocs --jscomp_error strictModuleDepCheck --jscomp_error typeInvalidation --jscomp_error undefinedVars --jscomp_error unknownDefines --jscomp_error uselessCode --jscomp_error visibility --summary_detail_level 3) |
| 28 | |
| 29 | foreach(JSFILE ${LIBJSFILES})
|
| 30 | set(LIB_CLOSURE_ARGS ${LIB_CLOSURE_ARGS}
|
| 31 | --js ${CMAKE_CURRENT_SOURCE_DIR}/${JSFILE})
|
| 32 | endforeach(JSFILE ${LIBJSFILES})
|
| 33 | |
| 34 | foreach(JSFILE ${TESTJSFILES})
|
| 35 | set(TEST_CLOSURE_ARGS ${TEST_CLOSURE_ARGS}
|
| 36 | --js ${CMAKE_CURRENT_SOURCE_DIR}/${JSFILE})
|
| 37 | endforeach(JSFILE ${TESTJSFILES})
|
| 38 | |
| 39 | add_custom_command( |
| 40 | OUTPUT simplecompiled.js |
| 41 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 42 | ARGS -jar ${CLOSURE_JAR}
|
| 43 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS} ${TEST_CLOSURE_ARGS}
|
| 44 | --compilation_level WHITESPACE_ONLY |
| 45 | --formatting PRETTY_PRINT |
| 46 | --js_output_file simplecompiled.js |
| 47 | DEPENDS ${LIBJSFILES} ${TESTJSFILES}
|
| 48 | ) |
| 49 | |
| 50 | add_custom_command( |
| 51 | OUTPUT compiled.js |
| 52 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 53 | ARGS -jar ${CLOSURE_JAR}
|
| 54 | --define IS_COMPILED_CODE=true |
| 55 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS} ${TEST_CLOSURE_ARGS}
|
| 56 | --compilation_level ADVANCED_OPTIMIZATIONS |
| 57 | --formatting PRETTY_PRINT |
| 58 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 59 | --js_output_file compiled.js |
| 60 | DEPENDS ${LIBJSFILES} ${TESTJSFILES} tools/externs.js
|
| 61 | ) |
| 62 | |
| 63 | add_custom_command( |
| 64 | OUTPUT webodf.js |
| 65 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 66 | ARGS -jar ${CLOSURE_JAR}
|
| 67 | --define IS_COMPILED_CODE=true |
| 68 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS}
|
| 69 | --compilation_level SIMPLE_OPTIMIZATIONS |
| 70 | --formatting PRINT_INPUT_DELIMITER |
| 71 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 72 | --js_output_file webodf.js |
| 73 | DEPENDS ${LIBJSFILES} tools/externs.js
|
| 74 | ) |
| 75 | |
| 76 | add_custom_command( |
| 77 | OUTPUT webodf-experimental.js |
| 78 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 79 | ARGS -jar ${CLOSURE_JAR}
|
| 80 | --define IS_COMPILED_CODE=true |
| 81 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS}
|
| 82 | --js ${CMAKE_CURRENT_SOURCE_DIR}/lib/export.js
|
| 83 | --compilation_level ADVANCED_OPTIMIZATIONS |
| 84 | --formatting PRINT_INPUT_DELIMITER |
| 85 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 86 | --js_output_file webodf-experimental.js |
| 87 | DEPENDS ${LIBJSFILES} lib/export.js tools/externs.js
|
| 88 | ) |
| 89 | |
| 90 | add_custom_command( |
| 91 | OUTPUT webodf-debug.js |
| 92 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 93 | ARGS -jar ${CLOSURE_JAR}
|
| 94 | --define IS_COMPILED_CODE=true |
| 95 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS}
|
| 96 | --compilation_level WHITESPACE_ONLY |
| 97 | --formatting PRETTY_PRINT |
| 98 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 99 | --js_output_file webodf-debug.js |
| 100 | DEPENDS ${LIBJSFILES} tools/externs.js
|
| 101 | ) |
| 102 | |
| 103 | add_custom_command( |
| 104 | OUTPUT odfedit.js |
| 105 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 106 | ARGS -jar ${CLOSURE_JAR}
|
| 107 | --define IS_COMPILED_CODE=true |
| 108 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS}
|
| 109 | --js ${CMAKE_CURRENT_SOURCE_DIR}/odfedit.js
|
| 110 | --compilation_level ADVANCED_OPTIMIZATIONS |
| 111 | --formatting PRETTY_PRINT |
| 112 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 113 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/extjsexterns.js
|
| 114 | --js_output_file odfedit.js |
| 115 | DEPENDS ${LIBJSFILES} ${APPJSFILES} tools/externs.js tools/extjsexterns.js odfedit.js
|
| 116 | ) |
| 117 | |
| 118 | add_custom_command( |
| 119 | OUTPUT gui.js |
| 120 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 121 | ARGS -jar ${CLOSURE_JAR}
|
| 122 | --define IS_COMPILED_CODE=true |
| 123 | ${SHARED_CLOSURE_ARGS} ${LIB_CLOSURE_ARGS}
|
| 124 | --js ${CMAKE_CURRENT_SOURCE_DIR}/filelister.js
|
| 125 | --js ${CMAKE_CURRENT_SOURCE_DIR}/gui.js
|
| 126 | --compilation_level ADVANCED_OPTIMIZATIONS |
| 127 | --formatting PRETTY_PRINT |
| 128 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/externs.js
|
| 129 | --externs ${CMAKE_CURRENT_SOURCE_DIR}/tools/extjsexterns.js
|
| 130 | --js_output_file gui.js |
| 131 | DEPENDS ${LIBJSFILES} ${APPJSFILES} tools/externs.js tools/extjsexterns.js filelister.js gui.js
|
| 132 | ) |
| 133 | |
| 134 | add_custom_target(syntaxcheck ALL DEPENDS simplecompiled.js webodf.js webodf-experimental.js webodf-debug.js compiled.js odfedit.js gui.js) |
| 135 | |
| 136 | add_custom_target(rhinotest |
| 137 | COMMAND ${CMAKE_Java_RUNTIME} -jar ${RHINO}
|
| 138 | -debug lib/runtime.js tests/tests.js |
| 139 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 140 | SOURCES ${LIBJSFILES}
|
| 141 | ) |
| 142 | add_custom_target(simplerhinotest |
| 143 | COMMAND ${CMAKE_Java_RUNTIME} -jar ${RHINO}
|
| 144 | ${CMAKE_CURRENT_BINARY_DIR}/simplecompiled.js
|
| 145 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
|
| 146 | DEPENDS simplecompiled.js |
| 147 | ) |
| 148 | add_custom_command( |
| 149 | OUTPUT docs/index.html |
| 150 | COMMAND ${CMAKE_Java_RUNTIME}
|
| 151 | ARGS -jar ${JSDOCDIR}/jsrun.jar
|
| 152 | ${JSDOCDIR}/app/run.js -d=${CMAKE_CURRENT_BINARY_DIR}/docs
|
| 153 | -t=${JSDOCDIR}/templates/jsdoc ${LIBJSFILES}
|
| 154 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 155 | DEPENDS ${LIBJSFILES}
|
| 156 | ) |
| 157 | add_custom_target(doc DEPENDS docs/index.html) |
| 158 | |
| 159 | endif (CMAKE_Java_RUNTIME) |
| 160 | |
| 161 | add_custom_target(nodetest ALL |
| 162 | COMMAND ${NODE} lib/runtime.js tests/tests.js
|
| 163 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
| 164 | SOURCES ${LIBJSFILES}
|
| 165 | ) |
| 166 | add_custom_target(simplenodetest ALL |
| 167 | COMMAND ${NODE} ${CMAKE_CURRENT_BINARY_DIR}/simplecompiled.js
|
| 168 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests
|
| 169 | DEPENDS simplecompiled.js |
| 170 | ) |
| 171 | add_custom_command( |
| 172 | OUTPUT instrumented/index.html |
| 173 | COMMAND ${JSCOVERAGE}
|
| 174 | ARGS --exclude=extjs --exclude=extjs/.git ${CMAKE_CURRENT_SOURCE_DIR}
|
| 175 | ${CMAKE_CURRENT_BINARY_DIR}/instrumented
|
| 176 | DEPENDS ${LIBJSFILES}
|
| 177 | ) |
| 178 | add_custom_target(instrumented ALL DEPENDS instrumented/index.html) |