xquery / xquerydoc

xquerydoc - generate XQuery API documentation from your source code comments
https://github.com/xquery/xquerydoc
Other
38 stars 11 forks source link

Failing on Windows #38

Open dmcassel opened 6 years ago

dmcassel commented 6 years ago

Tried running using PowerShell and normal Command Prompt. I get the same error:

xquerydoc 0.1, generates xquery api documentation Copyright (c) 2011, 2012 Jim Fuller, John Snelson see https://github.com/xquery/xquerydoc ECHO is off. xquery dir: C:\Users\dcassel\git\smart-mastering-core\src\main\ml-modules\ext\com.marklogic.smart-mastering\test output dir: C:\Users\dcassel\git\smart-mastering-core\src\main\ml-modules\ext\com.marklogic.smart-mastering\test\xqdoc format: html ECHO is off. generating documentation ... Jun 22, 2018 11:48:23 AM com.xmlcalabash.util.DefaultXProcMessageListener error SEVERE: java.net.MalformedURLException: unknown protocol: c Jun 22, 2018 11:48:24 AM com.xmlcalabash.util.DefaultXProcMessageListener error SEVERE: java.net.MalformedURLException: unknown protocol: c Jun 22, 2018 11:48:24 AM com.xmlcalabash.drivers.Main error SEVERE: com.xmlcalabash.core.XProcException: java.net.MalformedURLException: unknown protocol: c Jun 22, 2018 11:48:24 AM com.xmlcalabash.drivers.Main error SEVERE: Underlying exception: java.net.MalformedURLException: unknown protocol: c com.xmlcalabash.core.XProcException: java.net.MalformedURLException: unknown protocol: c at com.xmlcalabash.util.URIUtils.getFile(Unknown Source) at com.xmlcalabash.library.DirectoryList.run(Unknown Source) at com.xmlcalabash.runtime.XAtomicStep.run(Unknown Source) at com.xmlcalabash.runtime.XCompoundStep.run(Unknown Source) at com.xmlcalabash.runtime.XChoose.run(Unknown Source) at com.xmlcalabash.runtime.XPipeline.doRun(Unknown Source) at com.xmlcalabash.runtime.XPipeline.run(Unknown Source) at com.xmlcalabash.runtime.XPipelineCall.run(Unknown Source) at com.xmlcalabash.runtime.XPipeline.doRun(Unknown Source) at com.xmlcalabash.runtime.XPipeline.run(Unknown Source) at com.xmlcalabash.drivers.Main.run(Unknown Source) at com.xmlcalabash.drivers.Main.main(Unknown Source) Caused by: java.net.MalformedURLException: unknown protocol: c at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) at java.net.URL.(Unknown Source) ... 12 more Creating directory at "C:\Users\dcassel\git\smart-mastering-core\src\main\ml-modules\ext\com.marklogic.smart-mastering\test\xqdoc" ...

Thought there might be a problem with my XQuery, so I created a really simple example. Got the same error. Example follows:

xquery version "1.0-ml";
(:
: Module Name: Sample
: Module Version: 1.0
: Date: June 22, 2018
: Copyright: None
: Proprietary
: Extensions: None
:
: XQuery
: Specification : XQuery v1.0
: Module Overview: Example for xqdoc processing
:)

module namespace test = "test";

(:~
: This function doesn't do squat.
: @returns not a thing
:)
declare function test:do-nothing()
{
  ()
};
xquery commented 6 years ago

looks like bit rot is setting in and I have no (time|plans) to maintain.

dmcassel commented 6 years ago

@xquery I'm looking into using Docker let this run in a Linux environment. Should I interpret your comment to mean that I probably shouldn't use xquerydoc? If so, do you (or anyone else) know of an alternative?

dmcassel commented 6 years ago

For anyone else who runs into this, xquerydoc runs well in Linux. You can get around the Windows problem by using Docker. Start by creating Dockerfile.xquerydoc:

FROM nimmis/java-centos:openjdk-8-jre

# Get any CentOS updates then clear the <span class="hit_highlight">Docker</span> cache
RUN yum -y update && yum clean all

# Install the initscripts package so MarkLogic starts ok
RUN yum -y install initscripts && yum clean all

RUN yum -y install git

WORKDIR /usr/local
RUN git clone https://github.com/xquery/xquerydoc

# Set the Path
ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/xquerydoc

Then create a Docker image:

docker build -f .\Dockerfile.xquerydoc  -t xquerydoc:latest .

Test that the setup was successful:

docker run --rm xquerydoc:latest xquerydoc --help

That should give you the usage notes for xquerydoc. The next thing is to run with volumes so that xquerydoc can see your code and generate output outside the Docker container. You'll also tell xquerydoc where to look for your code and where to generate that output. Remember that the paths xquerydoc sees are inside (Linux). For me, it looks like this:

docker run -v c:/Users/dcassel:/home/dcassel --rm xquerydoc:latest xquerydoc -x /home/dcassel/git/smart-mastering-core/src/main/ml-modules -o /home/dcassel/git/smart-mastering-core/docs