Skip to content

Conversation

@bermo
Copy link

@bermo bermo commented Jun 10, 2021

This is a workaround that alleviates issue #274 - "spkl: PackageReference in csproj".

When adding references to spkl project using NuGet PackageReference vs. package.config, the spkl batch file folder and spkl.config file are not created due to the new design of content files being immutable.

Fortunately there is a workaround to this using a MSBuild targets file - the only difference is the content files will not appear until the project is built. As spkl still relies on the NuGet Package.json setup by copying files into particular NuGet package subfolders inside a now non-existent "Packages" folder off project root, simply adding the spkl directory and a spkl.config file is not enough.

The spkl.targets file in this pull request deals with the creation of the spkl batch folder and config file, and also does all the other heavy lifting to make the spkl batch files work too. It achieves this by copying the appropriate NuGet packages from %USERPROFILE%\.nuget\packages to the corresponding NuGet Package.json location in a packages folder off the solution root.

This now provides the ability to use spkl with the new SDK-style projects targeting net462 or net48.

@FrederikRossouw
Copy link

Found the issues with the references of the tools, but the nuget support to copy the .bat files does not work for this. might still need to do the target files to copy them.

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

Successfully merging this pull request may close these issues.

2 participants