nirin / msbuild-sdks

MSBuild project SDKs
https://nirin.dev/projects/msbuild-sdks
Other
18 stars 2 forks source link

Setting up the development environment #7

Closed mkaring closed 6 years ago

mkaring commented 6 years ago

Hello,

I tried setting up my local development environment to handle this repository. How ever it fails when trying to load the projects, because it can't resolve the SDKs. Is there anything special that needs to be done to get this working?

Also your command line tools fail to resolve the vsdev command.

I need some hints on how to get this working and how to setup my environment to do more extensive tests and send some contributions your way.

Nirmal4G commented 6 years ago

My Way:

That's because I'm using custom scripts and SDKs to build them. I don't know if it'll work for you. But here are the scripts:

vsbuild.cmd vsdev.cmd

Put them in your PATH and set env var MSBuildSDKsPathNew point to the custom SDKs directory you've created somewhere (e.g.: D:\Projects\Packages\Sdks).

Nirmal4G commented 6 years ago

global.json way:

mkaring commented 6 years ago

For local testing I found it very helpful to alter the test projects a bit.

Currently they look like this:

<Project Sdk="MSBuild.NET.Extras.Sdk">

…

</Project>

The following alteration causes them to still work, with the added advantage that they directly reference the current development state of the package:

<Project>
    <Import Project="$(MSBuildThisFileDirectory)..\..\..\Source\MSBuild.NET.Extras.Sdk\Sdk\Sdk.props" />

…

    <Import Project="$(MSBuildThisFileDirectory)..\..\..\Source\MSBuild.NET.Extras.Sdk\Sdk\Sdk.targets" />
</Project>

Note that the $(RepoRootDir) property cannot be used, because Visual Studio does not resolve the Directory.Build.* files while loading the project.

If you like that change, I'll send you a PR within a could of minutes. This change also uncovered some additional problems.

Nirmal4G commented 6 years ago

We need to test them as SDK Reference, so this is not an ideal solution for dev/test cycle. I was not expecting anyone to contributing back to this, as these are used internally for our projects. I already have a solution that I've been working on. I'll commit them soon as soon as I complete my pending work.

Nirmal4G commented 6 years ago

This change also uncovered some additional problems.

If you can, please test with the latest develop commit, any issues stand out?