Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to compile the source code? #4

Open
Darfka opened this issue Sep 5, 2017 · 9 comments
Open

How to compile the source code? #4

Darfka opened this issue Sep 5, 2017 · 9 comments
Assignees

Comments

@Darfka
Copy link

Darfka commented Sep 5, 2017

Hi! I was wondering if there was a proper way to recompile the project? I'm quite the newbie when it come to these things. Thank!

PS: It could be a good idea to include it in the readme markdown file.

@Darfka
Copy link
Author

Darfka commented Sep 5, 2017

I think I found how. Correct me if I'm wrong.

  1. Open the main folder in Visual Studio
  2. Go into the CLI folder and open CLI.csproj
  3. Choose "Release|x86" instead of "Debug|x86"
  4. Generate the solution (shortcut: F6)

Then you can find the application in CLI -> Bin -> Release.

@NaturalDocs
Copy link
Owner

Pretty much. I have to create a developer's guide for the web site at some point.

  • Create a Visual Studio solution. Using the free Visual Studio Express is fine.
  • Download the CLI and Engine folders of the source and add their .csproj files to the solution.
    • They should both be subfolders of the same parent folder
    • You don't need the Tests folders unless you want to run the unit tests
  • Compile and run with CLI as the startup project.
    • It should automatically copy the resources it needs like the Config, Translations, and Styles folders.

@NaturalDocs NaturalDocs self-assigned this Sep 6, 2017
@Parsley-Sage
Copy link

Hi
I was trying to compile NaturalDocs on Linux with mono tools. I was able to do it with command:

xbuild /property:Configuration=Release /property:TargetDir='../../build/' /property:OperatingSystemTarget=Unix CLI/CLI.csproj

However I had to patch .targets files to make it work:
https://gist.github.com/Parsley-Sage/f797aaac222e44b23e8d1ce4cc70a43c
The problem was with 'xcopy' command which is not present in Linux.
I'm not sure if that's the correct way to do it and I have no way to try my changes with Visual Studio. If you're interested in these updates I can create a pull request.
Thanks!

@jfritsche1
Copy link

I'm having a problem getting them to compile too. I posted a question on stackoverflow: https://stackoverflow.com/questions/59828225/naturaldocs-source-code-not-building-in-vs-2015
I ensured they are in the same folder, and that they are in correct build dependency order.
Do you know what I might be missing?
Thank you!

@NaturalDocs
Copy link
Owner

NaturalDocs commented Jan 21, 2020

According to the error message on the Stack Overflow question, Visual Studio 2015 is having problems with a newer C# syntax element. It doesn't like me using:

FunctionCall(out string variableName);

instead of:

string variableName;
FunctionCall(out variableName);

VS 2017 and 2019 handle it fine. Since that's the only place that appears (I think) I changed it to the old style and pushed it. Pull the new changes and try again.

@NaturalDocs
Copy link
Owner

I realize I never responded to the xcopy comment. There was a commit in April 2019 that detects when it's not on Windows and swaps out xcopy for cp.

@jfritsche1
Copy link

jfritsche1 commented Jan 21, 2020

Oh, ok. Works great. Thank you!

@jayvdb
Copy link

jayvdb commented Aug 23, 2022

I ran

xbuild /property:Configuration=Release /property:TargetDir='../../build/' /property:OperatingSystemTarget=Unix CLI/CLI.csproj
and CLI/bin/Release/NaturalDocs.exe popped out.

Would be good to add this type of info to the README until a proper developer guide can be written.

@tymonx
Copy link

tymonx commented Feb 15, 2023

It is quiet easy to build it from container (Podman or Docker):

podman run -it --rm --workdir "$(pwd)" --volume "$(pwd):$(pwd):rw,z" --user "$(id -u):$(id -g)" --userns keep-id \
    mono msbuild /p:Configuration=Release ./CLI/CLI.csproj

And generated binary is ready to use from the ./CLI/bin/Release/ location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants