Revert "Revert "[xbuild]: Provide a real Microsoft.Portable.CSharp.targets""
authorJeffrey Stedfast <jeff@xamarin.com>
Thu, 25 Jul 2013 20:19:26 +0000 (16:19 -0400)
committerJeffrey Stedfast <jeff@xamarin.com>
Thu, 25 Jul 2013 20:19:26 +0000 (16:19 -0400)
This reverts commit a4800b96b2e1e7e897048bf1e924081cc89a4794.

mcs/tools/xbuild/Makefile
mcs/tools/xbuild/xbuild/4.0/Microsoft.Portable.CSharp.targets [new file with mode: 0644]
mcs/tools/xbuild/xbuild/4.5/Microsoft.Portable.CSharp.targets [new file with mode: 0644]
mcs/tools/xbuild/xbuild/Microsoft.Portable.CSharp.targets

index 8caaeeb0e50295759499c1cf125616c363cdd24c..7838fcdc3ed18b188e25b0d0f6411581026dd41b 100644 (file)
@@ -37,7 +37,7 @@ SILVERLIGHT_DIR = $(mono_libdir)/mono/xbuild/Microsoft/Silverlight
 PORTABLE_DIR = $(mono_libdir)/mono/xbuild/Microsoft/Portable
 EXTRAS_DIR = $(mono_libdir)/mono/$(INSTALL_FRAMEWORK_VERSION)
 install-extras: 
-       $(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR) $(DESTDIR)$(REDISTLIST_DIR) $(DESTDIR)$(XBUILD_FRAMEWORKS_DIR)/v3.0/RedistList $(DESTDIR)$(XBUILD_FRAMEWORKS_DIR)/v4.0/RedistList $(DESTDIR)$(mono_libdir)/mono/3.5
+       $(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR) $(DESTDIR)$(REDISTLIST_DIR) $(DESTDIR)$(XBUILD_FRAMEWORKS_DIR)/v3.0/RedistList $(DESTDIR)$(XBUILD_FRAMEWORKS_DIR)/v4.0/RedistList $(DESTDIR)$(mono_libdir)/mono/3.5 $(DESTDIR)$(mono_libdir)/mono/4.0
        $(INSTALL_DATA) xbuild/xbuild.rsp $(DESTDIR)$(mono_libdir)/mono/$(FRAMEWORK_VERSION)
        $(INSTALL_DATA) xbuild/$(INSTALL_FRAMEWORK_VERSION)/Microsoft.Common.tasks $(DESTDIR)$(EXTRAS_DIR)
        $(INSTALL_DATA) xbuild/$(INSTALL_FRAMEWORK_VERSION)/Microsoft.Common.targets $(DESTDIR)$(EXTRAS_DIR)
@@ -64,7 +64,10 @@ install-extras:
        sed -e 's/@SILVERLIGHT_VERSION@/2.0/g' xbuild/Microsoft.Silverlight.Common.targets > $(DESTDIR)$(SILVERLIGHT_DIR)/v2.0/Microsoft.Silverlight.Common.targets
        sed -e 's/@SILVERLIGHT_VERSION@/3.0/g' xbuild/Microsoft.Silverlight.Common.targets > $(DESTDIR)$(SILVERLIGHT_DIR)/v3.0/Microsoft.Silverlight.Common.targets
        $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_DIR)/v4.0
-       $(INSTALL_DATA) xbuild/Microsoft.Portable.CSharp.targets $(DESTDIR)$(PORTABLE_DIR)/v4.0
+       $(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_DIR)/v4.5
+       $(INSTALL_DATA) xbuild/4.0/Microsoft.Portable.CSharp.targets $(DESTDIR)$(PORTABLE_DIR)/v4.0
+       $(INSTALL_DATA) xbuild/4.5/Microsoft.Portable.CSharp.targets $(DESTDIR)$(PORTABLE_DIR)/v4.5
+       $(INSTALL_DATA) xbuild/Microsoft.Portable.CSharp.targets $(DESTDIR)$(mono_libdir)/mono/4.0
 
 EXTRA_DISTFILES = \
        xbuild/xbuild.rsp \
@@ -74,6 +77,8 @@ EXTRA_DISTFILES = \
        xbuild/2.0/Microsoft.Common.targets \
        xbuild/3.5/Microsoft.Common.targets \
        xbuild/4.0/Microsoft.Common.targets \
+       xbuild/4.0/Microsoft.Portable.CSharp.targets \
+       xbuild/4.5/Microsoft.Portable.CSharp.targets \
        xbuild/2.0/FrameworkList.xml \
        xbuild/3.5/FrameworkList.xml \
        xbuild/4.0/FrameworkList.xml \
diff --git a/mcs/tools/xbuild/xbuild/4.0/Microsoft.Portable.CSharp.targets b/mcs/tools/xbuild/xbuild/4.0/Microsoft.Portable.CSharp.targets
new file mode 100644 (file)
index 0000000..d80a9f5
--- /dev/null
@@ -0,0 +1,3 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+       <Import Project="$(MSBuildToolsPath)\Microsoft.Portable.CSharp.Targets" />    
+</Project>
diff --git a/mcs/tools/xbuild/xbuild/4.5/Microsoft.Portable.CSharp.targets b/mcs/tools/xbuild/xbuild/4.5/Microsoft.Portable.CSharp.targets
new file mode 100644 (file)
index 0000000..d80a9f5
--- /dev/null
@@ -0,0 +1,3 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+       <Import Project="$(MSBuildToolsPath)\Microsoft.Portable.CSharp.Targets" />    
+</Project>
index 3a6ca011ea2feb28bb6a7e9b524f987ca013dff2..72c20ef5c24637749fcc9d53bd9e7123391241ae 100644 (file)
@@ -1,35 +1,43 @@
-<!-- Note: This is a dummy CSharp.targets file that tries to map Portable Library Project targets to something available in Mono on Mac -->
-
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-       
+
        <PropertyGroup>
-               <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
-               <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-               <TargetFrameworkProfile></TargetFrameworkProfile>
-       </PropertyGroup>
-       
-       <PropertyGroup Condition = "Exists ('/Developer/MonoTouch/License.rtf')">
-               <TargetFrameworkIdentifier>MonoTouch</TargetFrameworkIdentifier>
-               <TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
-               <TargetFrameworkProfile></TargetFrameworkProfile>
-       </PropertyGroup>
-       
-       <PropertyGroup Condition = "Exists ('/Developer/MonoAndroid/License.rtf') And !Exists ('/Developer/MonoTouch/License.rtf')">
-               <TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
+               <AvailablePlatforms>Any CPU</AvailablePlatforms>
+
+               <TargetPlatformIdentifier>Portable</TargetPlatformIdentifier>
+               <TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
+               <TargetFrameworkMonikerDisplayName>.NET Portable Subset</TargetFrameworkMonikerDisplayName>
+
+               <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
+               <NoStdLib>true</NoStdLib>
+
+               <ImplicitlyExpandTargetFramework Condition="'$(ImplicitlyExpandTargetFramework)' == '' ">true</ImplicitlyExpandTargetFramework> 
        </PropertyGroup>
-       
-       <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" Condition = "Exists ('/Developer/MonoAndroid/License.rtf') And !Exists ('/Developer/MonoTouch/License.rtf')"/>
-       <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.Targets" Condition = "Exists ('/Developer/MonoTouch/License.rtf') Or !Exists ('/Developer/MonoAndroid/License.rtf')"/>
+
+       <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.Targets" />
        
        <PropertyGroup>
-               <BuildDependsOn>
-                       PortableCompatWarning;
-                       $(BuildDependsOn);
-               </BuildDependsOn>
+               <ResolveReferencesDependsOn>
+                       $(ResolveReferencesDependsOn);
+                       ImplicitlyExpandTargetFramework;
+               </ResolveReferencesDependsOn>
+               
+               <ImplicitlyExpandTargetFrameworkDependsOn>
+                       $(ImplicitlyExpandTargetFrameworkDependsOn);
+                       GetReferenceAssemblyPaths
+               </ImplicitlyExpandTargetFrameworkDependsOn>
        </PropertyGroup>
        
-       <Target Name="PortableCompatWarning">
-               <Warning Text="This Portable Library Project has been built against the $(TargetFrameworkIdentifier) framework."/>
+       <Target Name="ImplicitlyExpandTargetFramework"
+               DependsOnTargets="$(ImplicitlyExpandTargetFrameworkDependsOn)">
+
+               <ItemGroup>
+                       <ReferenceAssemblyPaths Include="$(_TargetFrameworkDirectories)"/>
+                       <ReferencePath Include="%(ReferenceAssemblyPaths.Identity)\*.dll">
+                               <CopyLocal>false</CopyLocal>
+                               <ResolvedFrom>ImplicitlyExpandTargetFramework</ResolvedFrom>
+                               <IsSystemReference>True</IsSystemReference>
+                       </ReferencePath>
+               </ItemGroup>
        </Target>
-       
+
 </Project>