mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Merge pull request #582 from kossebau/CIZip
Add library product (zip with webodf.js + API dox), normalize product build targets, "zip" build target flagged for removal
This commit is contained in:
+6
-6
@@ -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})
|
||||
@@ -332,11 +335,8 @@ add_subdirectory(webodf)
|
||||
# the programs/components
|
||||
add_subdirectory(programs)
|
||||
|
||||
|
||||
############
|
||||
## Package
|
||||
############
|
||||
|
||||
# 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(
|
||||
@@ -366,7 +366,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})
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(product-library DEPENDS ${WEBODFJS_DIR})
|
||||
|
||||
add_subdirectory(tests)
|
||||
|
||||
# vim:expandtab
|
||||
|
||||
Reference in New Issue
Block a user