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

.csproj files within a local UPM can't find MSBuildForUnity.Common.props #144

Open
mschofie opened this issue Oct 6, 2020 · 0 comments
Open

Comments

@mschofie
Copy link
Member

mschofie commented Oct 6, 2020

I'm attempting to follow Scenario 4: Distribute a UPM Package w/ NuGet Dependency. Based on my understanding of the documentation, I have:

  1. Added a '.csproj' file to my UPM that announces the NuGet dependencies that my UPM needs.
  2. Made com.microsoft.msbuildforunity a dependency of the UPM

When adding the UPM to an existing Unity project the com.microsoft.msbuildforunity integration kicks in, and I see the command-line invoked:

[package location]\Runtime> C:\Program Files\dotnet\dotnet.exe msbuild [packagename].csproj -restore  -v:minimal -p:NuGetInteractive=true  -t:Build -p:Configuration=Release

But since the [package location] - for local packages - is outside the scope of the Unity project, then the line:

<Import Project="$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(MSBuildForUnity.Common.props))')" />

is a no-op, since the condition evaluates to false. There doesn't appear to be a way - given the command-line invoked - to identify the Unity project folder.

Proposal

Have the com.microsoft.msbuildforunity Unity scripts pass the Application.dataPath into the dotnet msbuild invocation as an MSBuild property would make the import a lot more clear.

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

1 participant