commandbox/docbox question I am trying to create s...
# box-products
t
commandbox/docbox question I am trying to create some documentation for our test suite there some old tests that fail with
invalid component definition, can't find component [mxunit.framework.TestCase]
. its fine if I run the generate command in a server with an /mxunit (pointing to
/testbox/system/compat
of course šŸ˜‰ ) mapping but I am running this as a
box docbox generate...
is there any way I can supply the mapping to box.exe?
b
@thisOldDave The information you seek is in the command help šŸ™‚
Copy code
docbox Generate ?
Ex...
Copy code
docbox generate mappings:mxunit=testbox/system/compat
That will create a CF Mapping inside the CLI where the CFCs are getting compiled
t
thanks Brad I assume that is not going to create docs for testbox
as usual assume has made an arse of me i will try and work out the exclude param
b
thanks Brad I assume that is not going to create docs for testbox
@thisOldDave Can you explain what you mean? Are you wanting to create docs for TestBox itself or for your test suites?
t
no i dont want to create docs for testbox but if i add it to the mappings it does so I presume i need to add it to the excludes param but that doesnt appear to work
b
The CF mappings you create have absolutely nothing to do with what folders of code the docs are generated for
The CF mappings are just created inside the CLI for the code that's being processed to be able to create the CFCs and get their metadata and satisfy any
extends
or
implements
keywords.
The
source
param is what controls the files that have docs generated for them
t
maybe i have the wrong end of the stick this is what I have been using
Copy code
box docbox generate \
            mappings:mxunit=${mxunitpath} \
            mappings:testbox=${testboxpath} \
            mappings:icm.conf.model=$(pwd)/src/main/webapp/icm/conf/model \
            mappings:icm.health.model=$(pwd)/src/main/webapp/icm/health/model \
            mappings:icm.admin.cfc=$(pwd)/src/main/webapp/icm/admin/cfc \
            mappings:tests.conf=$(pwd)/src/test/cfml/conf \
            mappings:tests.ext=$(pwd)/src/test/cfml/ext \
            strategy-outputDir=$(pwd)/target/site/icmdocs \
            strategy-projectTitle="Component Documentation" \
            excludes="(mxunit|testbox)"
I have been using mappings= rather than source as I only want to scan certain paths from the docs Arguments: •
strategy
- The strategy class to use to generate the docs. •
source
- The directory containing the CFML source. •
mapping
- The base mapping for the source folder. •
excludes
- A regex that will be applied to the input source to exclude from the docs. •
mappings:*
- One or more dynamic parameters defining source and mapping. This argument will override
source
and
mapping
if provided.
b
Again, the mappings do not control what files are looked at go generate docs. The
source
param does that
The source param defaults to the current working dir you run the command in, so I assume you've just been creating docs for the entire folder
The mappings are ONLY there so your code can correctly compile, not to limit what files are looed at.
t
so this is wrong?
•
mappings:*
- One or more dynamic parameters defining source and mapping. This argument will override
source
and
mapping
if provided.
b
hold on, I've just now been looking at the code
It seems I'm wrong -- the behavior of this command was changed since I first wrote it šŸ˜•
Sorry
I... don't like the way this has been changed, lol
It's not how it was meant to work
It was changed in a pull 4 years ago that I merged myself -- oops
I didn't see that logic had been changed
The source param was always supposed to specify what code was being looked at. The mappings were only there to help the source compile
At some point, it got changed to also generated docs for any mappings which I suppose isn't terrible, even though it doesn't make a ton of sense
And then later, someone refactored it to favor mappings OVER source, which is just wrong IMO
This was all the code did originally that I wrote. Mappings were used for nothing other than this little block https://github.com/Ortus-Solutions/commandbox-docbox/blob/development/commands/docbox/Generate.cfc#L100-L105
t
ok so I am back to trying to get exclude to work
b
Which just creates the mappings inside Lucee so the code can compile properly
Well, now I want to fix this command, lol. It's all messed up
THere's zero reason why supplying a single mapping should start overriding your source dir
t
šŸ™‚ happy thursday, I might just put it in a runner, i can combine it with cflint to get rid of an additional call to box
b
Especially since there's no good way to add a
/
mapping in Lucee (plus it would break a bunch of stuff) so this entire feature is bunk now šŸ˜•
I guess this is what happens when several people contribute to open source without quite understanding how it works šŸ™‚
t
we have the same issue internally with c# devs contributing to java projects or visa versa