tag:help.appveyor.com,2012-11-13:/discussions/suggestions/712-nuiget-with-multiple-build-configurationsAppVeyor: Discussion 2018-08-25T01:57:16Ztag:help.appveyor.com,2012-11-13:Comment/371461172015-06-17T14:11:11Z2015-06-17T14:11:11Znuiget with multiple build configurations<div><p>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.</p>
<ul>
<li>Feodor</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/371461172015-06-18T23:33:24Z2015-06-18T23:33:25Znuiget with multiple build configurations<div><p>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:</p>
<ul>
<li>What will be startup path of the scripts?</li>
<li>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?</li>
<li>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?</li>
<li>Will I be able to copy and move files from the script?</li>
<li>Once a nuget package is done will appveyor deploy it? I assume
the nuget enviroment expecta the assemblies not the nuget
package.</li>
</ul></div>theraottag:help.appveyor.com,2012-11-13:Comment/371461172015-06-19T01:04:52Z2015-06-19T01:04:52Znuiget with multiple build configurations<div><p>Sure, answering your questions:</p>
<ul>
<li>Script startup path is <code>%appveyor_build_folder%</code>
(<code>C:\projects\<project-slug></code>)</li>
<li>msbuild 12.0 is in PATH (<code>C:\Program Files
(x86)\MSBuild\12.0\Bin\MSBuild.exe</code>). 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.</li>
<li><code>nuget.exe</code> is in PATH and will be always there.
Though from time to time we upgrade it to more recent
versions.</li>
<li>you can copy/move files or whatever you need to run your tests
- you are admin on build machine</li>
<li>you can setup nuget deployment. First, <a href="http://www.appveyor.com/docs/packaging-artifacts">push nuget
package to artifacts</a> and then add nuget <a href="http://www.appveyor.com/docs/deployment/nuget">deployment
provider</a>.</li>
</ul></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/371461172015-06-23T23:02:32Z2015-06-23T23:02:34Znuiget with multiple build configurations<div><p>Ok, I have figured how to do this via script.</p>
<p>For anybody with a similar problem this is my final script:
<a href="https://github.com/theraot/Theraot/blob/master/build.bat">https://github.com/theraot/Theraot/blob/master/build.bat</a></p>
<p>[ <a href="https://github.com/theraot/Theraot/blob/6fb136c6ad939496a3463a16c32e0e1bf531c598/build.bat">
https://github.com/theraot/Theraot/blob/6fb136c6ad939496a3463a16c32...</a>
]</p>
<p>All I put in appveyor is:</p>
<pre>
<code>.\build.bat</code>
</pre>
<p>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.</p>
<p>I have made my build configuration match the names of the
folders in the nuget structure to make it easier to build the
nupkg.</p>
<p>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.</p>
<p>There is also a version autoincrement mechanism for the nuget
(because we don't want two nugets with the same version).</p>
<p>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:<br>
- appveyor: build history. - nuget: semantic versioning: <a href="http://docs.nuget.org/Create/Versioning#really-brief-introduction-to-semver">
http://docs.nuget.org/Create/Versioning#really-brief-introduction-t...</a></p>
<p>*: I tend to test to build on Develop branch - yet, it
happens.</p>
<p>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.</p>
<hr>
<p>I still think this can be supported by appveyor, if anything
take the script for guide.</p>
<p>Another suggestion is to add links to the documents contextually
(ie: in build link to <a href="http://www.appveyor.com/docs/build-configuration">http://www.appveyor.com/docs/build-configuration</a>
- in artifacts link to <a href="http://www.appveyor.com/docs/packaging-artifacts">http://www.appveyor.com/docs/packaging-artifacts</a>
and so on).</p></div>theraottag:help.appveyor.com,2012-11-13:Comment/371461172015-06-23T23:30:17Z2015-06-23T23:30:17Znuiget with multiple build configurations<div><p>Nice, thanks for sharing your solution!</p></div>Feodor Fitsner