tag:help.appveyor.com,2012-11-13:/discussions/questions/833-target-multiple-solution-filesAppVeyor: Discussion 2018-08-25T01:53:18Ztag:help.appveyor.com,2012-11-13:Comment/357083732015-01-06T19:46:08Z2015-01-06T19:46:08ZTarget multiple solution files<div><p>Hi,</p>
<p>There are at least two ways of doing that:</p>
<p>1) Create a new AppVeyor project for every solution. All these
projects will be cloning from the same repo but building different
solutions.</p>
<p>2) Use your own build script (commands) and call
<code>msbuild</code> for every solution from there.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/357083732015-01-06T19:52:37Z2015-01-06T19:52:37ZTarget multiple solution files<div><p>Thanks for the quick feedback! :)</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T17:57:47Z2015-01-07T17:57:47ZTarget multiple solution files<div><p>In an attempt to keep the CI build process simple for my project
(and by simple, I mean having just one build process), I started by
implementing Option #2 (using custom build script commands in my
appveyor.yml file). This worked great for building the project;
however, when running the unit tests for each solution it required
that each built unit test assembly have a different name. Also, the
build output doesn't make it clear when running unit tests what
assembly the unit test is being run from. It looks like the unit
test runner is first discovering the tests from all the assemblies
and then running all of them in one go. Is there any way to run all
tests from each assembly one assembly at a time?</p>
<p>Also, between Option #1 and #2, are either of those recommended
or preferred among other users? While I did get Option #2 working,
I'm considering going with Option #1 (separate AppVeyor projects
for each solution) as it provides more clarity into the status of
each solution.</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T18:41:19Z2015-01-07T18:42:41ZTarget multiple solution files<div><p>...or you can try using <a href=
"http://www.appveyor.com/docs/build-configuration#build-matrix">build
matrix</a> to have a multi-job build for various
configurations/platforms.</p>
<p>UPDATE: You can use environment variable groups to specify build
job details. Let me know what's the structure of your solution and
I'd be able to advise something.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T18:49:16Z2015-01-07T18:49:16ZTarget multiple solution files<div><p>The configuration/platforms are identical between each solution.
It's just the target .NET framework that differs. Build matrix
doesn't seem to address this, unless I'm missing something.</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T18:56:14Z2015-01-07T18:56:14ZTarget multiple solution files<div><p>You can put solution name into environment variables and then
use the same build script. See attached screenshot.</p>
<p>Or in <code>appveyor.yml</code>:</p>
<pre>
<code>environment:
matrix:
- solution_name: solution1.sln
- solution_name: solution2.sln</code>
</pre>
<p>Then you can have:</p>
<pre>
<code>build_script:
- msbuild %solution_name%</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T18:59:11Z2015-01-07T18:59:11ZTarget multiple solution files<div><p>I guess it would help if I provided context for the project. :)
I'm trying to get this setup for the <a href=
"https://github.com/paypal/PayPal-NET-SDK">PayPal .NET SDK</a>. The
SDK builds assemblies targeting the .NET 4.0, 4.5, and 4.5.1
frameworks. Currently, each solution builds with the same files and
same unit tests, but that is going to change soon as I add more
Async support to the 4.5.1 build and accompanying unit/functional
tests.</p>
<p>I'd like to use AppVeyor to build the following solutions:<br>
* <a href=
"https://github.com/paypal/PayPal-NET-SDK/blob/master/Source/PayPal.SDK.NET40.sln">
PayPal.SDK.NET40.sln</a> * <a href=
"https://github.com/paypal/PayPal-NET-SDK/blob/master/Source/PayPal.SDK.NET45.sln">
PayPal.SDK.NET45.sln</a> * <a href=
"https://github.com/paypal/PayPal-NET-SDK/blob/master/Source/PayPal.SDK.NET451.sln">
PayPal.SDK.NET451.sln</a></p>
<p>Each solution currently builds both the SDK and accompanying
unit tests for its specific framework. If I try to have one
AppVeyor project that builds everything, I'd need to update each
unit test project to build with a different name so all tests get
loaded correctly. Alternatively, I'm considering having separate
AppVeyor projects for each solution; however, I'm not sure if that
would add any maintenance burden for my team in keeping up with all
three AppVeyor projects.</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T19:02:32Z2015-01-07T19:02:32ZTarget multiple solution files<div><p>Thanks for the clarification, Feodor! I'll give the build matrix
a try then. :)</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T19:13:48Z2015-01-07T19:13:48ZTarget multiple solution files<div><p>Oh, nice, the project is open source :) Will play with it as
well.</p>
<p>-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T20:38:12Z2015-01-07T20:38:12ZTarget multiple solution files<div><p>I created a <a href=
"https://github.com/paypal/PayPal-NET-SDK/tree/ci-support">ci-support
branch</a> where I'm testing out the build matrix solution. Really
loving how each solution & configuration is listed as a
separate job in the <a href=
"https://ci.appveyor.com/project/PayPal/paypal-net-sdk"><strong>LATEST
BUILD</strong> project view</a>. This is exactly what I was looking
for. :)</p></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T20:50:36Z2015-01-07T20:50:36ZTarget multiple solution files<div><p>Yeah, looks nice.</p>
<p>I've noticed you are running on a free plan. Would you like to
test it on Pro to feel the difference (2-3x times faster builds and
almost instant build start)?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T21:38:36Z2015-01-07T21:38:36ZTarget multiple solution files<div><p>I appreciate the offer, but for now we're going to stick with
the free plan as the build times are sufficient and it's not overly
imperative (yet) that builds get kicked off instantly. If that does
change, I'll definitely let you know. :)</p>
<p>Thanks again for all your help!</p>
<ul>
<li>Jason</li>
</ul></div>jziajatag:help.appveyor.com,2012-11-13:Comment/357083732015-01-07T21:51:36Z2015-01-07T21:51:36ZTarget multiple solution files<div><p>Sure!</p></div>Feodor Fitsner