Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Build script #64

Merged
merged 17 commits into from
May 2, 2014
Merged

Build script #64

merged 17 commits into from
May 2, 2014

Conversation

damianh
Copy link
Contributor

@damianh damianh commented Apr 23, 2014

❗ This is a work in progress, please do not pull / merged yet. Opening it now so you can see and comment on progress :) ❗

Ready to go!

Fixes #60

  • Clean up references
  • Initial build script to clean and compile solution
  • SharedAssemblyInfo and update version
  • ILRepack and internalize references
  • Create nuget packages

Run tests lets skip this for now, can introduce to the build script in a separate bit of work.

@damianh
Copy link
Contributor Author

damianh commented Apr 23, 2014

@leastprivilege @brockallen MSTest is tightly coupled with Visual Studio and makes things akward from a single click build and in CI scenarios. The problem is, instead of being able to use the test runner via nuget solution package it requires Visual Studio to be installed (and it's a disaster!). This is sort-of when run on dev computers but wont work at all on build servers, i.e. teamcity.codebetter etc. Would it be possible to convert the tests to xunit? The xunit runner integrates will with the VS Testrunner so your experience will be practically similar... Please research / chew on it before rejection this :)

(I can do this conversion and send as separate PR)

@leastprivilege
Copy link
Member

I have no objections - next week I have more time. Maybe you need to give me some intro to all that via skype.

@damianh
Copy link
Contributor Author

damianh commented Apr 25, 2014

Sure np. Am away this weekend. Hit me up on skype next week when you have a moment.

@damianh
Copy link
Contributor Author

damianh commented Apr 30, 2014

@leastprivilege Am getting some help with this from @mauricedb . It appears we're having some issues with ILRepack and internalizing the Autofac dependency (@mauricedb - please shed some light here). Do you have any strong opinions regarding Autofac or if we find an equally competent container that is internalizable, would you be open to that?

@mauricedb
Copy link
Contributor

Running ILRepack with Autofac.dll results in an exception:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

Autofac actually refers to System.Core 2.0.5.0 which is the result of it being a Portable Class Library. See: https://github.com/autofac/Autofac/wiki/Frequently-Asked-Questions

@leastprivilege
Copy link
Member

I'd rather add Alex to this thread than moving away from autofac.

@leastprivilege
Copy link
Member

i pinged him.

@damianh
Copy link
Contributor Author

damianh commented Apr 30, 2014

@mauricedb Is there a changeset / branch one can checkout and easily reproduce the problem?

@mauricedb
Copy link
Contributor

@damian Use the ILRepack branch and remove the exclusion of Autofac.dll from the ILRepack task in default.ps1. I also have a real simple repro using a console app on disk. I can push that to GitHub if needed.

@alexmg
Copy link

alexmg commented Apr 30, 2014

I tested ILMerge and was able to internalize Autofac.dll into a test assembly.

@damianh
Copy link
Contributor Author

damianh commented Apr 30, 2014

Thanks @alexmg! @mauricedb Switch to ILMerge then I guess.

@mauricedb
Copy link
Contributor

@damianh I reported this for IL-Repack. Maybe wait a bit for a response there first?

@mauricedb
Copy link
Contributor

It looks like it. The exception is a Mono.Cecil.AssemblyResolutionException.

@damianh
Copy link
Contributor Author

damianh commented Apr 30, 2014

Looks like a known problem with with Mono.Cecil. jbevain/cecil#152 No clue as to if / when it will be addressed. I suggest go with ILMerge if it is known to definitely work.

@mauricedb
Copy link
Contributor

Already on it. Seems like a pretty trivial task so far.

IlMerge instead of ILRepack
@damianh
Copy link
Contributor Author

damianh commented May 2, 2014

image

Getting close! Just a nuget package to go...

@damianh
Copy link
Contributor Author

damianh commented May 2, 2014

@leastprivilege Now fully embeddable and dependency free. Ready for a look.

To build, open powershell prompt: .\build.ps1.
To build with a build number: .\build.ps1 -buildNumber X

You will probably need to tweak the nuspec details
The only package dependency is on Owin.dll

What it looks like in a sample project:

image

Note No WebAPI references here!

Typical packages.config of a consumer:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Owin" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Host.HttpListener" version="2.1.0" targetFramework="net45" />
  <package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net45" />
  <package id="Owin" version="1.0" targetFramework="net45" />
  <package id="Thinktecture.IdentityServer" version="3.0.0" targetFramework="net45" />
</packages>

image

@damianh
Copy link
Contributor Author

damianh commented May 2, 2014

Thanks to @mauricedb for helping out 😄

@leastprivilege
Copy link
Member

good job! thanks to you both! Will have a look later/tomorrow!

leastprivilege added a commit that referenced this pull request May 2, 2014
Build script / nuget package
@leastprivilege leastprivilege merged commit fa698b7 into IdentityServer:master May 2, 2014
@gregpakes
Copy link
Contributor

Hi guys,

I would be interested to know why the ILMerge is internalising so many assemblies.

Microsoft.Owin.*
Newtonsoft.Json.*
System.Web.Http.*
etc, etc

thanks

@brockallen
Copy link
Member

@gregpakes it's to make idsvr completely self-contained

@gregpakes
Copy link
Contributor

Thanks @brockallen

How does this work with embedded scenarios? I am embedding and I am concerned about potential clashes between the embedded and the actual versions of the assemblies.

I haven't had any issues yet, i'm just thinking aloud.

@damianh
Copy link
Contributor Author

damianh commented Jun 18, 2014

That's the point, ilmerging prevents any clashes.
On 18 Jun 2014 04:11, "Greg Pakes" [email protected] wrote:

Thanks @brockallen https://github.com/brockallen

How does this work with embedded scenarios? I am embedding and I am
concerned about potential clashes between the embedded and the actual
versions of the assemblies.

I haven't had any issues yet, i'm just thinking aloud.


Reply to this email directly or view it on GitHub
#64 (comment)
.

@damianh damianh deleted the build branch February 13, 2015 14:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add build script and nuspec
6 participants