* Makefile: Create dir for WebApplication.targets .
authorAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 15:09:45 +0000 (15:09 -0000)
committerAnkit Jain <radical@corewars.org>
Thu, 24 Sep 2009 15:09:45 +0000 (15:09 -0000)
* Microsoft.Common.targets (_ValidateEssentialProperties): New.
(BuildDependsOn): Add _ValidateEssentialProperties, temporary.
This should actually work via InitialTargets, which will be fixed
in a subsequent commit. Add PrepareForRun.
(PrepareForRun): New.
* xbuild/Microsoft.WebApplication.targets: New.

svn path=/trunk/mcs/; revision=142580

mcs/tools/xbuild/ChangeLog
mcs/tools/xbuild/Makefile
mcs/tools/xbuild/xbuild/Microsoft.Common.targets
mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets [new file with mode: 0644]

index a6e3afaa93e93fab2cd6e9018cf57f5ad9fa4043..1b0818d9b98a5609c4a6d4c96c05e7658dc3e8d7 100644 (file)
@@ -1,3 +1,13 @@
+2009-09-24  Ankit Jain  <jankit@novell.com>
+
+       * Makefile: Create dir for WebApplication.targets .
+       * Microsoft.Common.targets (_ValidateEssentialProperties): New.
+       (BuildDependsOn): Add _ValidateEssentialProperties, temporary.
+       This should actually work via InitialTargets, which will be fixed
+       in a subsequent commit. Add PrepareForRun.
+       (PrepareForRun): New.
+       * xbuild/Microsoft.WebApplication.targets: New.
+
 2009-09-23  Ankit Jain  <jankit@novell.com>
 
        * xbuild/Microsoft.Common.targets: Add 'Rebuild' target.
index ddf6942017c83cf42727f9c410f955fc747a1311..bfbb8d7a8dabb1449eb1d80bb328650c9a210ce3 100644 (file)
@@ -9,6 +9,7 @@ include ../../build/executable.make
 
 install-local: install-extras
 
+WEBAPP_DIR = Microsoft/VisualStudio/v9.0/WebApplications
 EXTRAS_DIR = $(mono_libdir)/mono/2.0
 install-extras: 
        $(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR)
@@ -22,6 +23,8 @@ install-extras:
        $(INSTALL_DATA) xbuild/MSBuild/Microsoft.Build.CommonTypes.xsd $(DESTDIR)$(EXTRAS_DIR)/MSBuild
        $(INSTALL_DATA) xbuild/MSBuild/Microsoft.Build.Core.xsd $(DESTDIR)$(EXTRAS_DIR)/MSBuild
        $(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild
+       $(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild/$(WEBAPP_DIR)
+       $(INSTALL_DATA) xbuild/Microsoft.WebApplication.targets $(DESTDIR)$(mono_libdir)/mono/xbuild/$(WEBAPP_DIR)
 
 EXTRA_DISTFILES = \
        xbuild/xbuild.rsp \
index e4489c218381216471f5d0778b5a1636c4983036..d22c9b48296548a9d3303b9f7e7c12ae12bb4bd2 100644 (file)
@@ -1,4 +1,4 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
        <PropertyGroup>
                <TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
                <TargetPath>@(_OutDirItem->'%(FullPath)\$(AssemblyName)$(TargetExt)')</TargetPath>
        </PropertyGroup>
 
+       <Target Name="_ValidateEssentialProperties">
+               <!-- If OutDir is specified via the command line, then the earlier check
+                    to add a trailing slash won't have any affect, so error here. -->
+               <Error
+                       Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')"
+                       Text="OutDir property must end with a slash."/>
+       </Target>
+
        <Target Name="PrepareForBuild">
                <Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
 
 
        <PropertyGroup>
                <BuildDependsOn>
+                       _ValidateEssentialProperties;
                        BeforeBuild;
                        CoreBuild;
                        AfterBuild
                        CopyFilesMarkedCopyLocal;
                        BuildResources;
                        Compile;
+                       PrepareForRun;
                        DeployOutputFiles;
                        _RecordCleanFile;
                        PostBuildEvent
 
        <Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/>
 
+       <PropertyGroup>
+               <PrepareForRunDependsOn>
+                       DeployOutputFiles
+               </PrepareForRunDependsOn>
+       </PropertyGroup>
+       <Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/>
+
        <Target Name="BuildResources"
                DependsOnTargets="AssignTargetPaths;SplitResourcesByCulture;CreateManifestResourceNames;CopyNonResxEmbeddedResources;GenerateResources;GenerateSatelliteAssemblies">
        </Target>
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets b/mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets
new file mode 100644 (file)
index 0000000..0f61904
--- /dev/null
@@ -0,0 +1,31 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+       <PropertyGroup>
+               <WebApplicationOutputDir Condition="'$(OutDir)' != '$(OutputPath)'">$(OutDir)_PublishedWebsites\$(MSBuildProjectName)</WebApplicationOutputDir>
+
+               <PrepareForRunDependsOn>
+                       $(PrepareForRunDependsOn);
+                       _CopyWebApplication
+               </PrepareForRunDependsOn>
+       </PropertyGroup>
+
+       <!-- OutDir has been overridden, so copy all the relevant files to that -->
+       <Target Name="_CopyWebApplication" Condition="'$(OutDir)' != '$(OutputPath)'">
+               <MakeDir Directories="$(WebApplicationOutputDir)\bin"/>
+               <Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(WebApplicationOutputDir)\bin" SkipUnchangedFiles="true"/>
+               <Copy
+                       SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
+                       Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
+                       DestinationFolder="$(WebApplicationOutputDir)\bin"
+                       SkipUnchangedFiles="true" />
+
+               <Copy
+                       SourceFiles = "@(IntermediateSatelliteAssemblies)"
+                       DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(WebApplicationOutputDir)\bin\%(Culture)\$(AssemblyName).resources.dll')"
+                       Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
+                       SkipUnchangedFiles="true" />
+
+               <!-- Copy the referenced assemblies -->
+               <Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(WebApplicationOutputDir)\bin" SkipUnchangedFiles="true" />
+               <Copy SourceFiles="@(Content)" DestinationFolder="$(WebApplicationOutputDir)\%(Content.RelativeDir)" />
+       </Target>
+</Project>