deyiyangyang / mybatisnet

Automatically exported from code.google.com/p/mybatisnet
0 stars 0 forks source link

Update the Nant build files #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We need to update the Nant build files for Data Mapper & Dao to use the latest 
version of nant and document the build targets.  We need build targets for .net 
framework versions 2, 3.5, and 4

Original issue reported on code.google.com by mmccur...@gmail.com on 20 Dec 2010 at 3:34

GoogleCodeExporter commented 9 years ago
Michael:

IBatisNet.Common use specific 3.0 and 3.5 framework classes. 

In the case of 2.0 it fails because of Linq (3.5) and System.ServiceModel 
(3.0). In 3.0 the problem is Linq.

The affected classes are:

2.0:

WcfSessionItemsInstanceExtension: System.ServiceModel
HybridWebThreadSessionStore: System.ServiceModel
InstanceItems: Linq
WcfSessionStore: requires WcfSessionItemsInstanceExtension

In 3.0:
InstanceItems: Linq
WcfSessionItemsInstanceExtension: requires InstanceItems
WcfSessionStore: requires WcfSessionItemsInstanceExtension
HybridWebThreadSessionStore: requires WcfSessionItemsInstanceExtension

The solution I suspect we can adopt is:

For 2.0:

- Exclude SessionStore classes: it's impossible to use a 3.0 implementation. 
All the threads for WCF has to be droped.

WcfSessionItemsInstanceExtension
HybridWebThreadSessionStore
WcfSessionStore

In the case of Linq we can use LinqBridge. The effect is in the 
InstanceItems.cs class. Another solution is to change the InstanceItems.CleanUp 
method (it's the only one that uses Linq)

For 3.0:

In the case of Linq we can use LinqBridge. The effect is in the 
InstanceItems.cs class. Another solution is to change the InstanceItems.CleanUp 
method (it's the only one that uses Linq)

----------------------

Please, I need your confirmation on the way I should take in order to build for 
2.0, 3.0, 3.5, 4.

Greetings and sorry for my poor english!

Original comment by juanpabl...@gmail.com on 6 Jan 2011 at 4:09

GoogleCodeExporter commented 9 years ago
Juan,

We'll need to do in and add a compiler directive to exclude those features for 
a build less than .net 3.0 and have the .nant files supply that directive

Original comment by mmccur...@gmail.com on 10 Jan 2011 at 3:46

GoogleCodeExporter commented 9 years ago
Michael:

I Already have done this. Today I commited the build files.

In the IBatisNet.DataMapper.build file you can see the validation for 2.0:

if target = net-2.0:

Exclude: { WcfSessionStore.cs, InstanceItems.cs, 
WcfSessionItemsInstanceExtension.cs, HybridWebThreadSessionStore.cs }

Else:

Exclude: { InstanceItems-net20.cs }

InstanceItems-net20.cs is a copy & paste of InstanceItems.cs. The only 
difference is that it does not have the Hook method (event triggered in 
WcfSessionItemsInstanceExtension.GetCollectionFrom). 

Now you can build nant for .Net-2.0 and .Net-3.5. I have to install the 3.0 
version to test on it, besides the 4.0.

Todo: add the ndoc target. Today or tomorrow i'll wait to have it.

Greetings and sorry for my poor english!

---- Nant options: ----
nant clean
nant clean-zip
nant debug
nant release
nant package

example: nant release -t:net-2.0

The output files are in the "Nant" directory.

Original comment by juanpabl...@gmail.com on 10 Jan 2011 at 5:39