NConstraints Version 1.0.0 Released

A common unit test assert I need to do is compare all the property values of one object to another.  For example:

[Test]
public void TestSaveWorks()
{
  // Create a value to save.
  var expectedDto = new SomeDto() {ValueOne = 1, ValueTwo = "Blah"};

  // Save the value.
  _someDbService.Save(dtoToSave);

  // Load the value from the database.  The DTO ID
  // should have been set by the save.
  var actualDto = _someDbService.Find(expectedDto.Id);
  
  Assert.That(expectedDto.ValueOne, Is.EqualTo(actualDto.ValueOne));
  Assert.That(expectedDto.ValueTwo, Is.EqualTo(actualDto.ValueTwo));
}

In this test we only have two properties to test but if the object has 10 plus properties to test that would be quite onerous.   I often forget to update the tests after I add a new property to the object.

To fix this problem I created a custom constraint for NUnit called EquivalentProperyWiseTo that compares all the property values of two objects.   Now the above tests looks like:

[Test]
public void TestSaveWorks()
{
 // Create a value to save.
 var expectedDto = new SomeDto() {ValueOne = 1, ValueTwo = "Blah"};

 // Save the value.
 _someDbService.Save(dtoToSave);

 // Load the value from the database. The DTO ID
 // should have been set by the save.
 var actualDto = _someDbService.Find(expectedDto.Id);
 
 Assert.That(expectedDto, Is.EquivalentPropertyWiseTo(actualDto));
}

Notice you don’t need to test each property value independently.  Just pass in the two objects you want to test and you are done.  High Five!

The EquivalentPropertyWiseTo custom constraint can be found in the just released NConstraints.  You can find the latest stable version of the NConstraints on NuGet.  If you like living on the edge you can find the developer builds on MyGet.

If you have any questions, spot an bug, or have an enchantment for NConstraints let me know by:

  • opening an issue or pull request GitHub.
  • asking a question on StackOverlow with the tag nconstraints.
  • send me an e-mail to support@saturdaymp.com.

Finally thank you to the NUnit team for creating NUnit and continue to support it.  I’ve used NUnit for most of my career to properly test and improve my code.

Posted in Code Examples | Tagged , | Comments Off on NConstraints Version 1.0.0 Released

Today I Learned How to Run NUnit Tests for a .NET Core Project in TeamCity

In TeamCity you can’t use the usual NUnit Runner to run .NET Core unit tests.  At least I couldn’t get it to work.  I’m sure this will be fixed in the future but for now the below works for me.  I got lots of inspiration from this TeamCity blog post.

For this example I’ll use the NConstraints project.  It contains a .NET Standard project (SaturdayMP.Constraints) that we want to test and two .NET Core Test projects (SaturdayMP.Constratints.Test and TestClient).

NConstraint Solution Explorer

In TeamCity I created a project with the usual first two steps of NuGet Install and Compile.

TeamCity Project Before Adding Test Step

If you read the TeamCity blog post, the one I got my inspiration from, then you probably noticed it used the .NET Core Runner to compile the project.  You might have had to do this when the TeamCity blog post was first written but now using the Visual Studio Runner will compile .NET Core projects.

Before we can add the .NET Core unit test build step we need to install the TeamCity .NET CLI Plugin.  Do this by downloading the plugin zip file from here.

TeamCity .Net Plugin Download

Then install the plugin by clicking on Administration in the top right then Plugins List on the bottom left.

TeamCity Navigate To Plugins List

Then click Upload Plugin Zip link and choose the plugin zip file you just downloaded.

TeamCity Upload Plugin Zip

 

TeamCity Upload .Net Core Plugin

Once the upload is complete you should see something similar to the screen shot below.

TeamCity Upload Successful

The plugin is uploaded but before it’s active you need to reboot TeamCity.  In my case I just rebooted the server.

Once the reboot is complete you can check that the plugin installed correctly by going to an agent with Visual Studio 2017 installed.

TeamCity Navigate To Agent Parameters

Once on the agent navigate to the parameters page and you should see something similar to the below screen shot.

TeamCity Check .Net CLI Plugin Installed

If you don’t see the DotNetCli listed then you either forgot to reboot TeamCity, the plugin didn’t install correctly, or you don’t have .NET Core installed on you build agent.

Now that the plugin is installed we can go back to our project and add the unit test build step.  Add a new build step and in the runner type pick .NET CLI (dotnet).  Then in the command drop down pick test and finally enter the paths to your projects.  If you have several projects you can use wildcards.

TeamCity .Net CLI Build Step

If you don’t see all the options in the screen shot above them make sure to click Show Advanced Options.  In my case I also enabled code coverage at the bottom of the list.

TeamCity .Net CLI Build Step Enable Code Coverage

 

Now when we build the tests should get executed.  You can see the results of the tests in the build log or the tests tab of the build results.

TeamCity Test Results

As I said at the beginning I’m sure the NUnit Runner will be updated to handle .NET Core but use the above for now.

P.S. – R.I.P. Tom Petty.

Posted in Code Examples, Software Development, Today I Learned | Tagged , , , | Comments Off on Today I Learned How to Run NUnit Tests for a .NET Core Project in TeamCity

Odds Are you Work for a Small Business

If I was a betting man I would bet you work for a small company (99employees or less).  Odds are I would be right half the time.  How did I come up with those numbers?  Using some math and stats I found on the Internet.

About 24% of the working population are public employees (i.e. employed by government).  The remaining 76% are employed by private companies with just a hair under 70% working for a company of less then 100 employees.

Share Of Total Private Employment by Size of Business - 2015

Share of Total Private Employment by Size of Business, 2015

That means if 100 employed people are reading this blog post at the same time then:

  • 24 are Public Employees
  • 7 work at Large Companies (500+)
  • 15 work at Medium Companies (100 – 499)
  • 54 work at Small Companies (1-99)

Pro tip for job seekers: don’t just apply to large companies.  Apply to small companies you never heard of because they hire a lot more people.

 

Posted in Business Side | Tagged | Comments Off on Odds Are you Work for a Small Business

Importance of Spouses in Small Businesses

Starting a new business is hard.  In 2010 study just over half of new business in Canada survive 5 years or more and only 30% survive 10 years.  Similar statics for our neighbours in the south.

Canada's Performance from 2001 to 2006 on Key Indicators of Entrepreneurial Performance

Saturday Morning Productions has been around for 7 1/2 years, if my maths are correct.  Our odds of surviving this long are about 45%.  Another way to look at it is if 100 business opened in 2009 then only 45 are still around today.

Why has Saturday MP survived when others business have faltered?  I think an important but often overlooked reason is my supportive spouse and business partner, Ada.  I know there are other reasons (i.e. hard work, grit, frugality, luck, etc) but when you start a business later in life when you are married with a young daughter then a supportive spouse is a requirement.  Well, I guess you could start a new business without the support of your spouse but I wanted to stay married and run a business.

I couldn’t find any data but my guess is that most small business that survive for more then 5 years have a supportive spouse.  That or the owners are unmarried or divorced.  The closest data I could find was from Thomas Stanley’s Millionaire Mind book and quoted on his blog:

The typical millionaire couple has been together for nearly thirty years and their bond tends to be permanent as well as economically productive. . . . ask the husband or wife to explain their household’s productivity . . . . Each gives substantial credit to the other.

For every 100 millionaires who say that having a supportive spouse was not important in explaining their economic success, there are 1,317 who indicate their spouse was important. Of the 100 who did not give credit to their spouse, 22 were never married and 23 were either divorced or separated. That leaves only 55 in 1,317 [4.2%] who believed that their spouse did not play an important role in their economic success.

So before I thank my wife for her support I would like to thank the spouses of all the small business and hope you will join me.  Think of all the small business you have either worked for, I’ve worked for 5 and counting, or done business with.

Thank you to the spouse that looked after the home and kids while the small business owner was working 60+ hours a week.  The spouse that was willing to give up the security of regular pay checks, benefits, and pension for someone else’s dream.  The spouse that became the companies first book keeper, janitor, and/or secretary.  The spouse that worked overtime or a 2nd job to help fund the new business.  The spouse that became a partner in the business.    The spouse that believed in their wife/husband and loved them through all the ups and downs.

AdaSpecial thanks to my wife for helping me start Saturday Morning Productions.  Thank you for being a business partner and a great consultant.  Thank you for looking after our home and daughter when you weren’t consulting.  Thank you for continuing to the book keeping while working a full time job at the university.  Thank you for supporting me during my summer sabbatical.  Finally thank you for continuing to support and believe in me.  Love you lots.

P.S. – Happy Anniversary.

I’m falling even more in love with you
Letting go of all I’ve held on to
I’m standing here until you make me move
I’m hanging by a moment here with you

 

 

Posted in Business Side | Tagged , , | Comments Off on Importance of Spouses in Small Businesses

My Takeaway from Reading Meatball Sundae

Meatball Sundae CoverBook: Meatball Sundae: Is Your Marketing out of Sync?
Author: Seth Godin

My takeaway from Meatball Sundae is don’t use a new marketing trend because it’s the hip new thing to do.  Make sure the marketing you do aligns with your business.  If the new marketing you does not align either change your business or don’t bother with the new marketing.

The book was written in 2007 and focuses mostly on marketing using the web but the basic idea applies to any new marketing technology.  Just because others companies use dream ads doesn’t mean you need too.

For me personally it means I should understand the social media platforms I use.  My Twitter, Facebook, and LinkedIn post mostly links back to this blog.  Is that the best way to use these platforms?  Probably not.

For October I’ll focus on Twitter and see if I can figure out if it aligns with my basement based business.  Do I need to change my business, change how I use Twitter, or give up on Twitter?

 

Posted in Takeaways | Tagged , , | Comments Off on My Takeaway from Reading Meatball Sundae

Today I Learned How to Lock a Dependency to a Specific Version in Project JSON

While upgrading the NUnitXmarin project the project maintainers asked me lock the version of NUnit to a specific version.  They where also kind enough to provided a link to a possible solution.  Lets test if it works.

First lets review how NuGet resolves dependencies.  If you specify a dependency version the standard way, i.e. just listing the version number with not brackets, NuGet tries to find the version you specified of the next highest version.

For example the NuGet feed for NUnit has the following versions in it’s feed:

3.6.1
3.7.0
3.7.1
3.8.0
3.8.1

If you list version 3.7.1 in project.json file, as shown below, then NuGet uses version 3.7.1.  Duh.

"dependencies": {
  "NUnit": "3.7.1"
}

Now say you list version 3.7.99 as shown below.  Now 3.7.99 does not exist so NuGet find the next highest version, which is 3.8.0, and uses that version.

"dependencies": {
 "NUnit": "3.7.99"
}

When you compile you will see a message similar to the below.

Dependency specified was NUnit (>= 3.7.99) but ended up with NUnit 3.8.0.

NuGet Dependency Resolution Message

To tell NuGet to only use the version you specified you need to put square brackets around the version number.  This changes the logic from “>= Version#” to “= Version#”.

"dependencies": {
 "NUnit": "[3.7.99]" 
} 

Now when you try to build you will get an error because version 3.7.99 does not exist and NuGet will not try to find a newer version.

NuGet Package restore failed for project Runner\nunit.runner.Droid for 'NUnit (= 3.7.99)'.

NuGet Dependency Error Message

That’s great you say, but why would you link to a version that does not exist?  That is stupid.

Let’s try something that might actually happen.  Your project references a project but another package links to a different version.  Say you have the following in your JSON file:

"dependencies": {
  "NUnit": "[3.6.1]",
  "NUnitLite": "3.8.1" 
} 

NUnitLite 3.8.1 references to NUnit 3.8.1.  If you compile you get the following warning:

Detected package downgrade: NUnit from 3.8.1 to 3.6.1  
ClassLibrary1 (>= 1.0.0) -> NUnitLite (>= 3.8.1) -> NUnit (= 3.8.1)  
ClassLibrary1 (>= 1.0.0) -> NUnit (= 3.6.1)

NuGet Dependency Warning Message

That’s good.  It’s what we wanted.  Now what happens if we remove the square brackets from the NUnit dependency so our JSON file looks like:

"dependencies": {
 "NUnit": "3.6.1",
 "NUnitLite": "3.8.1" 
} 

Will it use NUnit 3.6.1 that we reference in the project or NUnit 3.8.1 referenced by NUnitLite?

Detected package downgrade: NUnit from 3.8.1 to 3.6.1  
ClassLibrary1 (>= 1.0.0) -> NUnitLite (>= 3.8.1) -> NUnit (= 3.8.1)  
ClassLibrary1 (>= 1.0.0) -> NUnit (= 3.6.1)

NuGet Dependency Warning Message

Wait, that is exactly the same message we got last time.  What is going on?  It turns NuGet prefers the version of a package directly referenced by your project then one referenced by another package.  This is all explained in the How NuGet resolves package dependencies article but in summary NuGet tries to use the lowest version it can get away with with direct references overriding sub-references.

P.S. – I’m glad Barenaked Ladies (it’s a Canadian band, link is SFW) where able to continue without Steven Page but I miss his melancholy.  Plus him and Ed harmonized really well together.  This is one of my favorite melancholy BNL songs.  Yes I like it more then Brian Wilson.  Just ignore the cheesy video.

I couldn’t tell you
That I was wrong
I chickened out grabbed a pen and a paper
Sat down and I wrote this song

I couldn’t tell you
That you were right
So instead I looked in the mirror
Watched TV, laid awake all night

Posted in Uncategorized | Comments Off on Today I Learned How to Lock a Dependency to a Specific Version in Project JSON

My Takeaway from Reading Option B

Option B Book Cover

Book: Option B: Facing Adversity, Building Resilience, and Finding Joy
Author: Sheryl Sandberg, Adam Grant

Option B is not what I thought it would be about.  I thought it would be about what to do when your first plan fails for some reason.  Like plans you consciously made, such as a business plan, trip, etc.

Turns out the book is coming up with an option B for plans you didn’t even think you where making.  Such as assuming your family won’t die or won’t get seriously ill.  It is Sheryl Sandberg’s account of her husbands unexpected passing how she dealt with it.  She talks to others who dealt with death of loved ones and also what research says about dealing with death.  It does focus on other issues such as illness and other major life tragedies but mostly about death.

I have two takeaways from this book.  The first is that we have plans that we don’t even know about.  I dubbed them default plans but they are still plans.  That same way not making a choice is still a choice.

The second is that you should acknowledge and talk to the survivor about the death of their loved one.  We are often afraid of hurting the survivor by bringing up the subject.  That and hurting ourselves by bring up the topic.  The takeaway is to talk to your friends and family about the traumatic events.  They will appreciate it more then ignoring the elephant in the room.

 

Posted in Takeaways | Tagged , | Comments Off on My Takeaway from Reading Option B

Notes: Upgrade NUnit.Xamarin to NUnit 3.8.1

The notes I took when trying to upgrade the NUnit Xamarin project to NUnit 3.8.1.  The reason I did this was to fix issue #87.  When I try to us NUnit Xamarin on another project it fails with the following error:

 
D/Mono ( 2233): Assembly Loader probing location: 'System.Runtime.Loader'. 
F/monodroid-assembly( 2233): Could not load assembly 'System.Runtime.Loader' during startup registration. 
F/monodroid-assembly( 2233): This might be due to an invalid debug installation. 

Remember these are just notes and lack the polish [what polish? –Ed] of my other technical articles.

Compile

First I forked the project to my personal GitHub account then I cloned the repo to my local machine.

Open and compile the application.  No errors on the first try, that is a good sign.

NUnit Xamarin Compile Successful

For some reason ReSharper says there are 796 errors in 31 files.  The ReSharper “errors” are mostly in the shared projects.  I don’t think ReSharper knows how to deal with Shared projects correctly.  I’ll just ignore these errors for now.

Run iOS Project

Try to run it on iOS.  Can’t start the nunit.runner.iOS project because of the following error:

NUnit Xamarin Error Running NUnit.Runner.iOS Project

Changed it to nunit.runner.tests.iOS and it ran with the following results:

NUnit Xamarin iOS Test Result Summary

NUnit Xamarin iOS Test Result Failed Tests

Some of the tests failed.  Are they supposed to fail?  One second while I take a look at the tests.  I see some of them are supposed fail.  Thanks deliberate failure comment.

NUnit Xamarin Deliberate Failure Comment

Run Droid Project

I assume everything works on iOS.  Lets try running the Droid project.  Bummer, it no work.

NUnit Xamarin Droid Version Error

It appears that the Droid project file was updated to Android 7.1 but the json file still points to 6.0.  Why did VS auto update the project file to 7.1?  It appears that the project is set to use the latest Android version platform, which is currently 7.1 (Nougat).

NUnit Xamarin Droid Project Uses Default Android Version

Lets try switching it to 6.0 and see what happens.  It sill no work but I have seen this error message before.  It’s the initial bug I experienced in another project.

 
D/Mono ( 2233): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 2233): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 2233): This might be due to an invalid debug installation.

Oh wait, there is a 3.8.1 branch in the repo that has already updated to Android 7.1.  At least there was an attempt but it looked like it failed.  Do I stay with master or switch to the branch?

Upgrade to NUnit 3.8.1

Lets stay on the master branch and work out a fix.  I’ll then ask if it should be merged to master or the branch.  First things first lets updated to Android 7.1 and see what happens.  First in the project properties switch back to Use the Lastest Platform setting and then updated the json file.  I currently looks like:

 
{
 "dependencies": {
 "NUnit": "3.6.1",
 "Xamarin.Forms": "1.5.0.6447"
 },
 "frameworks": {
 "monoandroid60": {}
 },
 "runtimes": {
 "win": {}
 }
}

It links to an old Xamarin.Forms but lets leave that for now.  Hopefully upgrading to Android 7.1 will work with old version of Xamarin.  Lets upgrade the framework then run it.

 "frameworks": { 
   "monoandroid71": {} },

Well, got the same “Could not load assembly ‘System.Runtime.Loader'” error.

NUnit Xamarin Cannot Load Assembly System Runtime Loader

Lets see how NUnit.Xamarin links to NUnit.  How hard is it to upgrade to NUnit 3.8.1?

NUnit Xamarin NUnit Nuget

Notice that the packages come from NUnit AppVeyor CI.  I know AppVeyor is a continuous build system but not much else about it.  Do we have to use the packages only from AppVeyor?  I’ll have to ask.

It appears that NUnit is linked to via Nuget package.  I heard that it might NUnit.Xamarin might be compiled against NUnit but it appears to just use the Nuget package.  That is promising.  Lets try upgrading it to 3.8.1 and see what happens.

NUnit Xamarin Nuget Upgrade To 3.8.1

NUnit Xamarin Nuget Upgrade To 3.8.1 Changes

After the upgrade everything seems to work.  That is good news.

NUnit Xamarin Droid Success

Now I just need to check with the NUnit.Xamarin team what branch they would like this pull request put into.  I wonder if it will pass automated build tests?

 

Posted in Code Examples, Notes, Software Development | Tagged , , | Comments Off on Notes: Upgrade NUnit.Xamarin to NUnit 3.8.1

PSA: Arduino H Bridge is Sharp and Pointy

Just a quick public service announcement (PSA) that the Arduino H Bridge is sharp and pointy.  Both my daughter and myself hurt our fingers but only I was lucky enough to draw blood when one of the H Bridge pins got stuck under my finger nail.  I mean look at this insect looking pointy bastard.

H Bridge Top

H Bridge Bottom

All that pain and blood was worth it as we did finally get the lesson 10 (Zoetrope) from the Arduino Start Kit working.  We couldn’t get the example as shown in the book to work because we didn’t understand how the H Bridge worked.

Lesson 10 Zeotrope

With help from this article (with a handy diagram) we figured out the H Bridge and got the motor to spin.

Special thanks to Startup Edmonton for hosting us on their Monthly Hack Day.

Posted in Fun, Hardware | Tagged , , , | Comments Off on PSA: Arduino H Bridge is Sharp and Pointy

Today I Learned How to Automate Objective-c Builds in TeamCity

Several months ago I discussed how to manually build an objective-c project so it can be consumed by a Xamarin Binding Project.  In this post I show how to automate the building of the objective-c project.  In my case I need to automate the building of the BEMCheckBox project but hopefully you can generalize this specific example for your own needs.

For this post I’ll assume you have a TeamCity server setup along with a TeamCity build agent on a Mac.  For help installing a TeamCity server see the official documentation.  For help installing a Mac build agent please see my previous post and/or the official documentation.

Create the Project and Build in TeamCity

In my TeamCity setup I have a  Plugins project and under that a Native Libraries project.  Then under that I created the BEMCheckBox build as shown in the screen shot below.

BEMCheckBox Project Layout

As you can see above the build already exists but I’ll walk through creating it from scratch.  First choose the project you want the build to be in and choose Edit.

TeamCity Edit Project

On this screen choose Create build configuration.  In the screen shot below I already have a build but you might not have any builds yet.

TeamCity Create Build

The BEMCheckBox exists on GitHub but not under my GitHub account so I have to link to the URL manually.  Copy the link to the BEMCheckBox in step 3.

TeamCity Create Build From Url

Then set the name for your build.

TeamCity Set Build Config Name

Next I setup the build steps.  TeamCity might try to figure out the default build steps but you can ignore them and setup your own.

TeamCity Configure Build Steps Manually

Build Steps

We will need to compile the BEMCheckBox twice.  Once to build for the ARM architectures and once for the i386 architectures.  The ARM architecture lets the checkbox run on physical devices and  i386 for simulators.

Build Step 1 – Compile to Device

Update (Dec 5, 2017): Please see this post for updated build settings.  In summary you need to use the archive build step instead of build.

First up compiling for the iphone.  In my example we want a target based build to compile the BEMCheckBox framework, not the example program.  Make sure the platform is iOS (ARM).  You might have to click the Check/Reparse Project button to get the settings to show up correctly.

TeamCity Compile For Device

To test this step run your build then look for a BEMCheckBox.framework folder in the build/Release-iphoneos folder on you Mac build machine.  The full path on my build machine is:

 
/Users/username/BuildAgent/work/GUID/Sample Project/build/Release-iphoneos/BEMCheckBox.framework

Build Step 2 – Compile to Simulator

Now create another build step for the simulator build.  It will be similar to the previous build step.

TeamCity Compile For Simulator

Again you can test this build step by looking for the BEMCheckBox.framework folder in the Release-iphonesimulator.

/Users/username/BuildAgent/work/GUID/Sample Project/build/Release-iphonesimulator/BEMCheckBox.framework

Build Step 3 – Combine Frameworks

Update (Dec 5, 2017): Please see this post for updated build settings.  In summary some of the paths have changed because the Compile to Device step changed.

The final step is to combine the two builds into one so the framework can be consumed by Xamarin.  To do this use the lipo command.  The manual steps are outlined in my previous post.  To automate this step create a command line build process as shown below:

TeamCity Combine Frameworks Build Step

The full command line looks like:

 
cp -r Sample\ Project/build/Release-iphoneos/BEMCheckBox.framework .
lipo -create -output BEMCheckBox.framework/BEMCheckBox Sample\ Project/build/Release-iphoneos/BEMCheckBox.framework/BEMCheckBox Sample\ Project/build/Release-iphonesimulator/BEMCheckBox.framework/BEMCheckBox

To test this step run the build and look a BEMCheckBox.framework folder in root of the work/GUID folder.  In my case the folder can be found at:

/Users/username/BuildAgent/work/GUID/BEMCheckBox.framework

Then run a file command to make sure all 4 architectures are supported.

 
file BEMCheckBox.framework/BEMCheckBox

You should get the following output or something similar:

BEMCheckBox.framework/BEMCheckBox: Mach-0 universal binary with 4 architectures: [i386: Mach-0 dynamically lined shared library i386] [x86_x64: Mach-0 dynamically lined shared library x86_x64] [arm_v7: Mach-0 dynamically lined shared library arm_v7] [arm64: Mach-0 dynamically lined shared library arm64]
BEMCheckBox.framework/BEMCheckBox (for architecture i386): Mach-0 dynamically linked shared library i386
BEMCheckBox.framework/BEMCheckBox (for architecture x86_x64): Mach-0 dynamically linked shared library x86_x64
BEMCheckBox.framework/BEMCheckBox (for architecture arm_v7): Mach-0 dynamically linked shared library arm_v7
BEMCheckBox.framework/BEMCheckBox (for architecture arm64): Mach-0 dynamically linked shared library arm64

You can also use the lipo command tool to check the library.

lipo -info BEMCheckBox.framework/BEMCheckBox

You should see something like:

Architectures in the fat file: BEMCheckBox.framework/BEMCheckBox are: i386, x86_x64, arm7, arm64

In both cases you should see 4 architectures listed.  If you only see two then there is something with this build step.

Artifact

The end goal of all this work is to get a BEMCheckBox.framework that can be consumed by Xamarin.  Set this up as an artifact of the build by navigating the General Settings page.  Then click on the Artifacts Path directory icon and choose the BEMCheckBox.framework folder.

TeamCity Choose Artifact

 

Run the build one more time and you should see the BEMCheckBox.framework as a artifact.

TeamCity BEMCheckBox Artifact

That’s it.  You are done.  You are a hero for automating a manual process.

Of course you can tweak the build triggers and other settings as needed but the core part of building a Xcode library using TeamCity is done.

You can read how to manually use BEMCheckBox in Xamarin in part 3 and part 4 of the Today I Learned How to Create a Xamarin iOS Binding for Objective-C Libraries post series.  Maybe one day I’ll do a post on how to automate consuming the BEMCheckBox framework in Xamarin.

P.S. – I’m re-watching Stranger Things Season 1 in anticipation of season 2.  One of the more memorable scenes is the end of episode 3 (spoilers) when the Heroes song plays.  In the show the song is preformed by Peter Gabriel but below is the original extended version sung by David Bowie.

https://www.youtube.com/watch?v=jBuwC4VJi50

 

Posted in Today I Learned | Tagged , , , , | Comments Off on Today I Learned How to Automate Objective-c Builds in TeamCity