Pregunta

I'm trying to include the Nemerle compiler into my source code repository so that it can be built without Nemerle being installed in the build server. Currently my source code directory looks like this:

- [MySolutionFolder]
--- [.build]
------ [Nemerle]
--------- [net-4.0]
------------ ncc.exe
------------ ncc32.dll
------------ Nemerle.dll
------------ Nemerle.MSBuild.targets
------------ { all other Nemerle requirements }
--- [MyNemerleProjectFolder]
------ MyNemerleProject.nproj
------ { various .n files }
--- MySolution.sln
--- build.bat

The build.bat file is a simple script which calls MSBuild on the .sln file.

In my .nproj file, I changed the line

<Nemerle Condition=" '$(Nemerle)' == '' ">$(NemerleBinPathRoot)\$(NemerleVersion)</Nemerle>

to:

<Nemerle Condition=" '$(Nemerle)' == '' ">$(SolutionDir).build\Nemerle\$(NemerleVersion)</Nemerle>

After this change, I can successfully build from the command line script, however I cannot open the solution in Visual Studio. When opening the solution, VS complains that it cannot find MySolutionFolder\MyNemerleProjectFolder\.build\Nemerle\net-4.0\Nemerle.MSBuild.targets

Why is visual studio looking for a .build directory under the project folder rather than the solution folder? Is there a workaround for this?

If I change it to:

<Nemerle Condition=" '$(Nemerle)' == '' >$(ProjectDir)..\.build\Nemerle\$(NemerleVersion)</Nemerle>

Then the solution will open in visual studio, but the build fails - also the command line build fails..

¿Fue útil?

Solución

Try to use $(MSBuildProjectDirectory) instead of $(ProjectDir). For example:

<Nemerle Condition=" '$(Bootstrapping)' == 'true' ">$(MSBuildProjectDirectory)\..\Boot\$(NemerleVersion)</Nemerle>
<Nemerle Condition=" '$(Bootstrapping)' == 'false' ">$(NemerleBinPathRoot)\$(NemerleVersion)</Nemerle>

Otros consejos

Sounds like a bug in the Visual Studio.

What you can do is to specify a pre-build event, which will create a symbolic link from $(ProjectDir).build to $(SolutionDir).build.

Hackish, yes.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top