nuiget with multiple build configurations
I have a project with build configurations for each framework version, I want to create a nuget from it using appveyor... but appbeyor only allows me to specify one build configuration for the nuget.
What I want is to be able to select a build configuration for each framework version for a single nuget*. As I understand nuget supports this: http://docs.nuget.org/Create/Enforced-Package-Conventions
I don't want to mess a nuget - because nuget.org won't make it easy to delete nugets made for experimentation (see: http://docs.nuget.org/create/deleting-packages ). For instance I had deleting my project from appveyor multiple times in order to get the build configuration right and still have the first build be 1.0.1 - similar experimentation won't be viable with nuget.org.
Note: notifying the user that a build has no artifacts configured would have saved some time, also noting that the path to the artifacts is relative to the solution folder in the settings form. What is deployment name for?
Alternatively - is there a way to execute all the builds in a single configuration so I can build the nuget structure? - I would prefer if this could be automated since scripting it sound error prone [and you know... nuget.org].
Comments are currently closed for this discussion. You can start a new one.
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Feodor Fitsner on 17 Jun, 2015 02:11 PM
Well, not everything is supported out of the box. I think for your case the best way to go is to use your own build commands/script without automatic packaging.
2 Posted by theraot on 18 Jun, 2015 11:33 PM
I'm guessing I'll have to call MSBuild from the script to do the build, and maybe I'll have to call nuget.exe. If this script will run in appveyor... that brings some questions:
- What will be startup path of the scripts?
- Will msbuild be in PATH enviroment variable?
-- If not, will I have to fully specify the path? if so... may it change in the future?
- Will nuget.exe be in PATH envirment variable?
-- if not, will I have to fully specify the path? if so... may it change in the future?
- Will I be able to copy and move files from the script?
- Once a nuget package is done will appveyor deploy it? I assume the nuget enviroment expecta the assemblies not the nuget package.
Support Staff 3 Posted by Feodor Fitsner on 19 Jun, 2015 01:04 AM
Sure, answering your questions:
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe). I don't expect changing that to msbuild 14.0 soon. Other than that all msbuilds (4.0, 12.0, 14.0) are installed in their standard locations.
nuget.exeis in PATH and will be always there. Though from time to time we upgrade it to more recent versions.
4 Posted by theraot on 23 Jun, 2015 11:02 PM
Ok, I have figured how to do this via script.
For anybody with a similar problem this is my final script: https://github.com/theraot/Theraot/blob/master/build.bat
[ https://github.com/theraot/Theraot/blob/6fb136c6ad939496a3463a16c32e0e1bf531c598/build.bat ]
All I put in appveyor is:
I want it in source control because it helps to change it as needed. Otherwise I would have to change it manually in appveyor and the only way to test it would be to have some builds fails. And if I'm having the script on the repository it makes sense to make it useful to anybody who may want to download the source. So I want it to work without appveyor.
I have made my build configuration match the names of the folders in the nuget structure to make it easier to build the nupkg.
The script will read PATH or fallback to default locations for MSBuild.exe and NuGet.exe if they are not available there. For the later, the nuget NuGet.CommandLine was added to the project so NuGet.exe is in the repository.
There is also a version autoincrement mechanism for the nuget (because we don't want two nugets with the same version).
Appveyor will start building automatically and some builds will - probably* - fail. I have to choose between maually setting the version in appveyor before I push to master to make it sync with nuget (which complicates my life) or consider that the version numbers have different meaning. I opted for different meanings:
- appveyor: build history.
- nuget: semantic versioning: http://docs.nuget.org/Create/Versioning#really-brief-introduction-to-semver
*: I tend to test to build on Develop branch - yet, it happens.
I know I could have my script read the version from appveyor and have the nuget use that version... but that means that the script wont work without appveyor - unless some other trickery is involved -. And as I said, I don't want that.
I still think this can be supported by appveyor, if anything take the script for guide.
Another suggestion is to add links to the documents contextually (ie: in build link to http://www.appveyor.com/docs/build-configuration - in artifacts link to http://www.appveyor.com/docs/packaging-artifacts and so on).
Support Staff 5 Posted by Feodor Fitsner on 23 Jun, 2015 11:30 PM
Nice, thanks for sharing your solution!
Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.