protoc-gen-doc
protoc-gen-doc copied to clipboard
Windows Build
Can you please let me know steps for windows BUILD ?
For the most part, it would be making the commands in Makefile Windowsy. I could see one of two options. Either adding a build.cmd/bat/ps1 file, or having the Makefile detect the os and run different commands.
If you just want to run this on Windows you can get a prebuilt binary of the latest release.
I'd happily review a PR if you're interested in tackling the Windows build
Hi, I pulled the prebuilt binary as linked above, but I'm unclear on how to invoke it.
I tried a variety of invocations, including:
C:..\protoc-gen-doc-1.0.0.windows-amd64.go1.9>protoc-gen-doc.exe --doc-out=. --doc-opt=html,index.html ..\proto_testing*.proto
C:..\protoc-gen-doc-1.0.0.windows-amd64.go1.9>protoc-gen-doc.exe --doc-out=. --doc-opt=html,index.html ..\proto_testing\
C:..\protoc-gen-doc-1.0.0.windows-amd64.go1.9>protoc-gen-doc.exe
But, I never saw any output or sign of computer activity, the executable seemed to just sit there. I apologize if there's directions for invocation somewhere in the codebase, if so, a pointer to the appropriate file might be enough.
Did it add an index.html in the current directory?
Nope.
I verified that I can create a file in that directory from the same cmd.exe shell from which I was executing the protoc-gen-doc.exe.
I think I found my mistake: I had thought that the protoc-gen-doc.exe was standalone. But I bet that it is the plugin only, correct?
My Linux commandline, where the plug-in executable is specified to the protoc compiler, works: "protoc --plugin=protoc-gen-doc=./protoc-gen-doc --doc_out=. --doc_opt=html,index.html --proto_path=/home/emonsler/proto_testing ~/proto_testing/comp_messages.proto "
I bet that if I did the Windows equivalent, invoking protoc and specifying the plug-in, that it would work.
Could I recommend that the README.md section on using a custom build be changed from: "With a Custom Build" to "Using the precompiled Release binaries, or with a Custom Build" ?
The precompiled releases are a huge help, much easier than docker for me, and I bet they would be also for others.
@emonsler you're absolutely right about the app not being standalone. I'm sorry I didn't notice that in your description.
I've updated the README as you suggested with (hopefully) clearer instructions.
I have a similar issue where I am not getting any output on Windows. I did some of the Docker steps, but I am not very familiar with it -- I ended up downloading the Go build tools and manually invoking the command. I believe I have a valid exe, the help/version cmds work, etc. I get protoc output, but no generated docs.
.\protoc --version libprotoc 3.5.1
.\protoc-gen-doc.exe --version D:\protoc-gen-doc.exe version 1.0.0
.\protoc.exe --plugin=protoc-gen-doc="protoc-gen-doc.exe --doc_out=. --doc_opt=html,index.html" examples/proto/Customer.proto examples/proto/Vehicle.proto --cpp_out=build
Is it related to the quotes and the cpp_out flag?
.\protoc.exe --plugin=protoc-gen-doc="protoc-gen-doc.exe --doc_out=. --doc_opt=html,index.html" examples/proto/Customer.proto examples/proto/Vehicle.proto --cpp_out=build
vs.
.\protoc.exe --plugin=protoc-gen-doc=protoc-gen-doc.exe --cpp_out=build --doc_out=. --doc_opt=html,index.html examples/proto/Customer.proto examples/proto/Vehicle.proto
Yes it was! I thought I was quoting all the args to the plug in, but that was clearly wrong. I now get an index.html. Thank you very much!