[question] How to copy files to the publish directory post-publish?
See original GitHub issueHi everyone, I have the latest version of dotnet
from the README page (rc2/preview1) and I’m wondering how to copy files to the publish directory post-build. The reason is I’m looking to change the version of mscorlib that’s used with my app (see dotnet/coreclr#4678) by overwriting the files included with Microsoft.NETCore.App
with my copy, as I am contributing to coreclr/corefx.
Anyway, here is my project.json file thus far:
{
"buildOptions": {
"copyToOutput": {
"include": "../../git/coreclr/bin/Product/Windows_NT.x64.Release/**"
},
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-*"
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"System.Linq": "4.1.0-rc3-*",
"System.Runtime": "4.1.0-rc3-*",
"System.Threading.Tasks": "4.0.11-rc3-*"
},
"imports": [
"portable-net45+win8",
"dnxcore50"
]
}
},
"runtimes": {
"win7-x64": {}
}
}
copyToOutput
doesn’t seem to be working here; instead, it seems to be reproducing the files in <app>/bin/Release/git/coreclr/...
, which is not the effect I intended.
I also know you can do something like have "scripts": { "postpublish": {
and run shell commands from there, but I’m planning to build this app on another machine, so doing something like
"scripts": {
"postpublish": [
"xcopy ../../git/coreclr/bin/Product/Windows_NT.x64.Release/* %publish:OutputPath%"
]
}
would work on Windows but not on Linux, if I understand correctly. (It would be nice if we were able to run different shell commands depending on the host OS, e.g. xcopy
on Windows and cp
on the latter.)
So basically, is there any way to get this done from the project.json
and have it work on any OS? Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (8 by maintainers)
include
can no longer copy directories with the new.csproj
MSBuild project format. What can I do instead?@initiative Copy over the contents of the publish folder.