Tuesday, 15 February 2011

msbuild - Building a (non-PCL) Monotouch or .net dll from a single .csproj -



msbuild - Building a (non-PCL) Monotouch or .net dll from a single .csproj -

code reuse across .net , monotouch has been addressed in many ways, techniques involve parallel sets of projects/solutions.

i'd question clarify whether possible build, using single csproj file, either .net or monotouch version of same assembly, based on selected platform , configuration.

assume following:

the build machine runs windows. visual studio , msbuild available. the method not need work on monodevelop, since monodevelop not have xbuild/msbuild turned on monotouch. the monotouch binaries valid monotouch installation available. only library needs built, not total app. library: does not contain .xib's or plists. does utilize platform specific code, conditionally compiled. does reference platform specific assemblies (necessarily), , these need handled .csproj file.

question: given these assumptions, can library

compiled windows .net or compiled direct referencing monotouch app solution after binary copied mac.

based on current visual studio platform , configuration?

current research

the fact portable libraries compiled on windows can consumed monotouch solutions gives hope possible. the utilize of <nostdlib>true</nostdlib> in .csproj while building monotouch, different hintpaths system, system.core, system.xml etc seem necessary. unsure how reference right version of mscorlib while building monotouch.

technically, should possible rewrite generated assembly target different platform, using tools https://github.com/jbevain/cecil, don't think it's worth (immense) effort. dissassembling , rebuilding (expensive) option.

if question retargeting assembly provided 3rd party, , plan, create sure don't breach licensing terms.

now, if can strip of assumptions out, , utilize different build scheme (like rake or make), can accomplish code sharing without pcl @ buildfile level.

hope helps.

.net msbuild monotouch reusability mono.cecil

No comments:

Post a Comment