From 3cd03b8609c8ddbc53c5978ae16d3fd07899da62 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Thu, 15 May 2014 00:08:43 +0200 Subject: [PATCH 1/4] Add target webodf.js.zip-target --- CMakeLists.txt | 3 +++ webodf/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fd90faf..5a782d16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -316,6 +316,9 @@ set(TOOLS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/webodf/tools) set(RUNTIMEJS ${CMAKE_CURRENT_SOURCE_DIR}/webodf/lib/runtime.js) set(LIBJSLICENSEFILE ${CMAKE_CURRENT_SOURCE_DIR}/AGPL-3.0.txt) +set(WEBODFJS_DIR ${CMAKE_CURRENT_BINARY_DIR}/webodf.js-${WEBODF_VERSION}) +set(WEBODFJS_ZIP webodf.js-${WEBODF_VERSION}.zip) + set(VIEWERBUILDDIR ${CMAKE_CURRENT_BINARY_DIR}/viewer) set(FIREFOX_EXTENSION_ODFVIEWER_DIR ${CMAKE_CURRENT_BINARY_DIR}/firefox-extension-odfviewer-${WEBODF_VERSION}) diff --git a/webodf/CMakeLists.txt b/webodf/CMakeLists.txt index 89a48a38..64461f35 100644 --- a/webodf/CMakeLists.txt +++ b/webodf/CMakeLists.txt @@ -208,6 +208,35 @@ if (NOT APPLE) add_custom_target(instrumented DEPENDS instrumented/index.html) endif(NOT APPLE) + +add_custom_command( + OUTPUT ${WEBODFJS_DIR} + + # clear working dir + COMMAND ${CMAKE_COMMAND} -E remove_directory ${WEBODFJS_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${WEBODFJS_DIR} + + # API docs + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/docs ${WEBODFJS_DIR}/docs + # webodf.js + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/webodf.js ${WEBODFJS_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/webodf-debug.js ${WEBODFJS_DIR} + COMMAND ${CMAKE_COMMAND} -E copy ${LIBJSLICENSEFILE} ${WEBODFJS_DIR} + + # zip using javascript code running in Node.js + COMMAND ${NODE} ARGS ${RUNTIMEJS} ${TOOLS_DIR}/zipdir.js + ${WEBODFJS_DIR} + ${CMAKE_BINARY_DIR}/${WEBODFJS_ZIP} + + DEPENDS + ${TOOLS_DIR}/zipdir.js + doc + webodf.js-target + webodf-debug.js-target + ${LIBJSLICENSEFILE} +) +add_custom_target(webodf.js.zip-target DEPENDS ${WEBODFJS_DIR}) + add_subdirectory(tests) # vim:expandtab From 2eb335662b0a80f60efba9f8da186f76f50da1b0 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Thu, 15 May 2014 00:12:38 +0200 Subject: [PATCH 2/4] Rename product targets and add consistent prefix "product-" --- CMakeLists.txt | 6 +----- programs/firefoxextension/CMakeLists.txt | 2 +- programs/viewer/CMakeLists.txt | 3 ++- webodf/CMakeLists.txt | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a782d16..dfafa592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -336,10 +336,6 @@ add_subdirectory(webodf) add_subdirectory(programs) -############ -## Package -############ - set(WEBODFZIP webodf-${WEBODF_VERSION}.zip) set(WEBODFZIPDIR ${CMAKE_CURRENT_BINARY_DIR}/webodf-${WEBODF_VERSION}) add_custom_command( @@ -369,7 +365,7 @@ add_custom_command( editor-compiled.js-target html-benchmark viewer-minimized.js-target - firefoxextension-target + product-firefoxextension WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) add_custom_target(zip DEPENDS ${WEBODFZIP}) diff --git a/programs/firefoxextension/CMakeLists.txt b/programs/firefoxextension/CMakeLists.txt index 620e6cd0..696d921d 100644 --- a/programs/firefoxextension/CMakeLists.txt +++ b/programs/firefoxextension/CMakeLists.txt @@ -35,4 +35,4 @@ add_custom_command( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) -add_custom_target(firefoxextension-target DEPENDS ${FIREFOX_EXTENSION_ODFVIEWER}) +add_custom_target(product-firefoxextension DEPENDS ${FIREFOX_EXTENSION_ODFVIEWER}) diff --git a/programs/viewer/CMakeLists.txt b/programs/viewer/CMakeLists.txt index da3b61d8..5331d8da 100644 --- a/programs/viewer/CMakeLists.txt +++ b/programs/viewer/CMakeLists.txt @@ -67,4 +67,5 @@ add_custom_command( webodf.js-target viewer-minimized.js-target ) -add_custom_target(viewerbuilddir-target DEPENDS ${VIEWERBUILDDIR}) +add_custom_target(viewerbuilddir-target DEPENDS ${VIEWERBUILDDIR}) # remove once ViewerJS build uses product-viewerjsdir as target +add_custom_target(product-viewerjsdir DEPENDS viewerbuilddir-target) diff --git a/webodf/CMakeLists.txt b/webodf/CMakeLists.txt index 64461f35..edbaee33 100644 --- a/webodf/CMakeLists.txt +++ b/webodf/CMakeLists.txt @@ -235,7 +235,7 @@ add_custom_command( webodf-debug.js-target ${LIBJSLICENSEFILE} ) -add_custom_target(webodf.js.zip-target DEPENDS ${WEBODFJS_DIR}) +add_custom_target(product-library DEPENDS ${WEBODFJS_DIR}) add_subdirectory(tests) From a67bc0941317e57413d05759f3f008735773a326 Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 23 May 2014 15:50:08 +0200 Subject: [PATCH 3/4] Note the products which can be built currently in README-Building.md --- README-Building.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README-Building.md b/README-Building.md index 9e7afbd5..f3a8bb3a 100644 --- a/README-Building.md +++ b/README-Building.md @@ -78,3 +78,33 @@ Qt5 can be installed via homebrew, but will not be linked by default. CMake must specifying the Qt5 location in CMAKE_PATH_PREFIX environment variable: cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.2.1 ../webodf + + +## Products + +There are several products that can be created during build. + +### webodf.js library with API documentation + +After you have prepared the buildsystem as described above, you execute this command: + + make product-library + +This creates a file "webodf.js-x.y.z.zip", which can be copied and used on a system where you want to develop using the webodf.js library +and have the documentation of the classes' API as HTML pages. + +### Firefox Add-on ODF Viewer + +After you have prepared the buildsystem as described above, you execute this command: + + make product-firefoxextension + +This creates a file "firefox-extension-odfviewer-x.y.z.xpi", which can be directly installed as add-on in Firefox browsers, so ODF files can be viewed directly in Firefox. + +### ViewerJS Plugin + +This is currently only called automatically during the build of [ViewerJS](http://viewerjs.org), you will not do this yourself. + + make product-viewerjsdir + +It creates a folder "viewer", which is then further processed in the build of ViewerJS. From 5b437aabe7cb2cdcaf57fef4a3bd5594aed6840c Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Fri, 23 May 2014 19:57:58 +0200 Subject: [PATCH 4/4] Add note to remove build target "zip" when CI no longer uses it --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dfafa592..92d75962 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -335,7 +335,8 @@ add_subdirectory(webodf) # the programs/components add_subdirectory(programs) - +# old target used by the CI, with no user for the actual content +# to be removed after CI switched to build products directly set(WEBODFZIP webodf-${WEBODF_VERSION}.zip) set(WEBODFZIPDIR ${CMAKE_CURRENT_BINARY_DIR}/webodf-${WEBODF_VERSION}) add_custom_command(