dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.73k stars 1.07k forks source link

dotnet publish multiple -r options #6490

Open AndriySvyryd opened 8 years ago

AndriySvyryd commented 8 years ago

Steps to reproduce

Run dotnet publish -r win7-x86 -r win7-x64

Expected behavior

Publish to run for each of the specified RIDs

Actual behavior

dotnet : Unexpected value 'win7-x64' for option 'runtime'

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-preview2-003118)

Product Information:
 Version:            1.0.0-preview2-003118
 Commit SHA-1 hash:  7ada53d523

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.10586
 OS Platform: Windows
 RID:         win10-x64
blackdwarf commented 8 years ago

@AndriySvyryd can you share your project.json? I assume you have the runtimes node in it?

AndriySvyryd commented 8 years ago

Sure

{
  "version": "1.0.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0"
    }
  },

  "frameworks": {
    "netcoreapp1.0": {}
  },

  "runtimes": {
    "win7-x86": {},
    "win7-x64": {}
  }
}
blackdwarf commented 8 years ago

@AndriySvyryd thanks, that looks good. What about if you run them one after another, that is, if you run them with one -r per invocation? Does it all work then?

AndriySvyryd commented 8 years ago

@blackdwarf Yes, it works fine one-by-one

TheRealPiotrP commented 8 years ago

@blackdwarf I'm going to put this in the backlog or the moment. multi-rid behaviors don't exist in the product to date. If we decide to pursue that, we'll need to take a wholesale look across the verbs.

VAllens commented 7 years ago

Now, is this enhancement available? I strongly advise we to implement this feature, thank you !!! :)

dasMulli commented 7 years ago

as temporary solution, I've created custom targets that allow doing this in one invocation: https://gist.github.com/dasMulli/b14026437468ce4b56ef93e010f24a36 (drop the file in your project / solution directory or add the contents to the project).

Can be used by calling dotnet msbuild /m /t:PublishAll /p:Configuration=Release

VAllens commented 7 years ago

@dasMulli Oh !!! It‘s works, thank you. :) I saw your post on stackoverflow before. I implemented the publish using the bash script. Publish.sh

kuskmen commented 7 years ago

Do we have any progress in this? It seems a bit cumbersome to publish each time for different RID?

Thanks, YV

livarcocc commented 7 years ago

No progress and it is currently in our backlog, which means we will not get to it by our next release. Please try @dasMulli 's workaround.

Webreaper commented 3 years ago

Bit sad that 3 years later this still isn't something that can be done easily from the command-line....

mot256 commented 1 year ago

Well... add another 3 years...

rubo commented 1 year ago

What a pity. I'd like to have the possibility to build for multiple platforms at once. For now, running with a single -r one by one results in dotnet restore and dotnet build for each platform. Would be way better to have this process optimized somehow. Even when I call dotnet restore and then dotnet publish --no-restore -r <rid> it ends with an error.