VirtualBox

Changeset 99571 in vbox for trunk/doc/manual


Ignore:
Timestamp:
May 3, 2023 1:34:42 AM (21 months ago)
Author:
vboxsync
Message:

manual: dita-ot 4.0.2 changes. bugref:10302

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r99516 r99571  
    141141        $2 \
    142142        -- $(ASH) $(VBOX_PATH_MANUAL_SRC)/dita-ot-copy-exec.sh "$(VBOX_DITA_ORIGINAL_PATH)" "$1" \
    143         -- $(VBOX_JAVA) -jar "$1/lib/dost.jar" "/ditadir:$1" $3 $4 # "/outercontrol:fail" ?
     143        -- $(VBOX_JAVA) -jar "$1/lib/dost.jar" "/ditadir:$1" \
     144        $(if-expr defined(VBOX_DITA_DEBUG),"/cleantemp:no" "/debug:yes",) \
     145        $3 $4 # "/outercontrol:fail" ?
    144146
    145147 ifdef VBOX_DITA_USING_LATEST # Experiments with dita-ot v4.0.2. Requires java 17.
    146148  VBOX_DITA_USING_LATEST  := 1
    147   VBOX_JAVA_HOME          := C:/Program Files/Java/jdk-17/
    148   VBOX_DITA_ORIGINAL_PATH := D:/Tmp/dita/dita-ot-4.0.2
     149  ifeq ($(VBOX_JAVA17PLUS_HOME),)
     150   VBOX_JAVA17PLUS_HOME   := $(firstfile \
     151        $(rversortfiles $(qwildcard ,    $(KBUILD_DEVTOOLS_HST)/jdk/v1[789].*     $(KBUILD_DEVTOOLS_HST)/jdk/v[2-9][0-9].* )) \
     152        $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/jdk/v1[789].* $(KBUILD_DEVTOOLS_HST_ALT)/jdk/v[2-9][0-9].* )) \
     153   )
     154  endif
     155  VBOX_DITA_ORIGINAL_PATH := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/common/dita-ot/v[4-9].*)) \
     156        $(KBUILD_DEVTOOLS)/common/dita-ot/v4.0.2-r1)
     157
    149158  VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH = $(VBOX_DITA_ORIGINAL_PATH)/plugins/org.oasis-open.dita.v1_2/dtd/technicalContent/dtd
    150159  VBOX_DITA_CLASSPATH = \
    151         $(subst $(SP),;,$(strip \
     160        $(subst $(SP),$(HOST_PATH_SEP),$(strip \
    152161                        $(VBOX_DITA_ORIGINAL_PATH)/lib/ant-launcher.jar \
    153162                        $(VBOX_DITA_ORIGINAL_PATH)/config \
     
    156165                                $(VBOX_DITA_ORIGINAL_PATH)/lib/*.jar \
    157166                                $(VBOX_DITA_ORIGINAL_PATH)/plugins/*/lib/*.jar)))
    158   VBOX_DITA_RUN_DOST = $(REDIRECT) \
     167  VBOX_DITA_RUN_DOST = $(REDIRECT_EXT) \
    159168        -E 'ANT_HOME=$(VBOX_DITA_ORIGINAL_PATH)' \
    160169        -E 'DITA_DIR=$(VBOX_DITA_ORIGINAL_PATH)' \
    161         -E 'JAVA_HOME=$(VBOX_JAVA_HOME)' \
     170        -E 'JAVA_HOME=$(VBOX_JAVA17PLUS_HOME)' \
    162171        -E 'CLASSPATH=$(VBOX_DITA_CLASSPATH)' \
    163172        $2 \
    164173        -- \
    165         $(VBOX_JAVA) \
     174        $(VBOX_JAVA17PLUS_HOME)/bin/java \
    166175        "-Djava.awt.headless=true" \
    167176        "-Dsun.io.useCanonCaches=true" \
     
    172181        -buildfile "$(VBOX_DITA_ORIGINAL_PATH)/build.xml" \
    173182        -main "org.dita.dost.invoker.Main" \
     183        --args.grammar.cache=yes \
     184       --store-type=memory \
    174185        $(patsubst "/i:%,"--input=%, \
    175186                $(patsubst "/transtype:%,"--format=%, \
     
    178189                                        $(patsubst "/filter:%,"--filter=%, \
    179190                                                $(patsubst "/debug","--debug",$3)))))) \
    180         $5 --verbose --debug
     191        $(if-expr defined(VBOX_DITA_DEBUG),"--clean.temp=no" "--debug",) \
     192        $5 --verbose
    181193 endif
    182194
     
    806818                $$(VBOX_PATH_MANUAL_SRC)/pdf-theme-UserManual.yaml \
    807819                $$(VBOX_PATH_MANUAL_SRC)/en_US/images/vboxlogo.png
     820        $$(call MSG_L1,Building $@ ($(@D)/UserManual_pdf.log))
    808821        $$(QUIET)$$(RM) -f -- "$$@" "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log"
    809822        $$(QUIET)$$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf/"
     
    816829                , \
    817830               "/grammarcache:yes" \
    818                $(if-expr defined(VBOX_DITA_DEBUG),"/cleantemp:no" "/debug:yes",) \
    819831                , \
    820832                "--theme=$$(VBOX_PATH_MANUAL_SRC)/pdf-theme-UserManual.yaml" \
    821833                "--logfile=$$(@D)/UserManual_pdf.log" \
    822                 $(if-expr defined(VBOX_DITA_DEBUG),"--clean.temp=no",) \
    823834                )
    824835
     
    844855                $(VBOX_USER_MANUAL_DITA_STAGED_FILES_en_US) \
    845856                $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_en_US)
    846         $(call MSG_L1,Building html chunks $@)
     857        $(call MSG_L1,Building html chunks $@ ($(@D)/UserManual_xhtml.log))
    847858        $(QUIET)$(RM) -Rf -- "$(@D)" "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks/"
    848859        $(QUIET)$(MKDIR) -- "$(@D)"
     
    856867               "/grammarcache:yes" \
    857868               , \
    858                "--logfile=$(@D)/UserManual_xhtml.log")
     869               "--logfile=$(@D)/UserManual_xhtml.log" \
     870                )
    859871
    860872 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
     
    866878 # We stich the index.html and UserManual-Single.html files together using
    867879 # SED since we haven't been able to convince DITA-OT to combine them.
     880 #
     881 ## @todo This is excruciatingly slow with 4.0.2 because of a preprocessing step
     882 #        (move-meta in the org.dita.base plugin) is doing 986 read+writes of
     883 #        the singled combined dita document (XML).  This is probably the two
     884 #        for loops in the pushMetadata() method in
     885 #        src/main/java/org/dita/dost/module/MoveMetaModule.java.  The netbeans
     886 #        profiler says that ouf 283 sec runtime, 64 secs are spent reading
     887 #        the xml big doc and 212 secs spent writing it out again (212+64=276).
     888 #
     889 #        For the chunked version, the move-meta work is done on each .ditamap
     890 #        and .dita (topic) file instead, which is a lot less expensive.
     891 #
     892 #        The problem is forced by the AbstractDomFilter.read() design, which
     893 #        reads XML to DOM, modifies DOM, writes out DOM as XML.  The
     894 #        modifications done by the DitaMetaWriter.process function is
     895 #        restricted to a single topic, which is means this must be done this
     896 #        way.
     897 #
     898 #         A workaround, though, would be to implement a custom cache that
     899 #        cache the document and doesn't write it to disk until the loops
     900 #        finishes.  This could build on the CacheStore.java code, only
     901 #        potential challenge is to clone the job as the Job.store property is
     902 #        immutable.
     903 #
    868904 ## @todo front page
    869905 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
    870906                $(VBOX_USER_MANUAL_DITA_STAGED_FILES_en_US) \
    871907                $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_en_US)
    872         $(call MSG_L1,Building html chunks $@)
     908        $(call MSG_L1,Building html chunks $@ ($(@D)/UserManual-Single_xhtml.log))
    873909        $(QUIET)$(RM) -f -- "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual-Single.ditamap"
    874910        $(SED) -r -e 's/ chunk=["][^"]+["]//g' -e 's/<bookmap /<bookmap chunk="to-content" /' \
     
    885921               "/grammarcache:yes" \
    886922               , \
    887                "--logfile=$(@D)/UserManual-Single_xhtml.log")
     923               "--logfile=$(@D)/UserManual-Single_xhtml.log" \
     924                )
    888925        $(SED) -ne '1,/<body>/{p}' \
    889926                --output "$@" "$(@D)/UserManual-Single.html"
     
    9661003   # compilation step that produces the .chm-file, since we don't need it and it
    9671004   # mangles the path so it always fails anyway.
     1005   #
     1006   # HACK ALERT! Putting MSG_L1 between RM and MKDIR as the latter sometimes fails
     1007   #             on windows because the deleted directory still exists on Windows.
     1008   #
     1009   # HACK ALERT! For 4.0.2 we must set Ant property dita.output.dir to the output
     1010   #             dir to prevent the *.hhp+*.html+*.png files from being placed in
     1011   #             the temporary directory and removed upon completion (idea being
     1012   #             that hhc.exe had run and the files weren't needed any more - the
     1013   #             htmlhelp plugin sets temp.output.dir.name to 'temp_chm_dir').
     1014   #
    9681015   ## @todo front page.
    9691016   $(2)/UserManual.hhp: \
    9701017                $(VBOX_USER_MANUAL_DITA_STAGED_FILES_$(1)) \
    9711018                $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$(1))
    972         $$(call MSG_L1,dita-ot-qhelp, => $$@)
    9731019        $$(QUIET)$$(RM) -Rf -- "$$(@D)" "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp/"
     1020        $$(call MSG_L1,dita-ot-qhelp, => $$@ ($(2)/UserManual_htmlhelp.log))
    9741021        $$(QUIET)$$(MKDIR) -- "$$(@D)"
    975         $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp, -EHHCDIR="$$(@D)", \
     1022        $$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp, -EHHCDIR="$$(@D)", \
    9761023                "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
    9771024                "/transtype:htmlhelp" \
     
    9801027                "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_qhelp" \
    9811028                , \
    982                "/grammarcache:yes" \
    983                , \
    984                "--logfile=$(2)/UserManual_htmlhelp.log")
     1029                "/grammarcache:yes" \
     1030                , \
     1031                "--logfile=$(2)/UserManual_htmlhelp.log" \
     1032                "-Ddita.output.dir=$(2)" \
     1033                )
    9851034
    9861035
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette