Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
113 lines (89 sloc) 5.54 KB
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)Versioning.targets" />
<PropertyGroup>
<BaseConfiguration Condition=" '$(BaseConfiguration)' == '' ">Debug</BaseConfiguration>
<Solution>IronLua.sln</Solution>
<PackageName>IronLua-$(DisplayVersion)</PackageName>
<BaseDir>$(MSBuildProjectDirectory)</BaseDir>
<BuildDir>$(BaseDir)\bin\$(BaseConfiguration)</BuildDir>
<StageDir>$(BaseDir)\Stage\$(BaseConfiguration)\$(PackageName)</StageDir>
<PackageDir>$(BaseDir)\Package\$(BaseConfiguration)\$(PackageName)</PackageDir>
<!-- Using tools from IronLanguages project (see http://github.com/IronLanguages/main) -->
<UtilDir>F:\workspace\DLR\IronLanguages\Util</UtilDir>
<NuGetTool>$(UtilDir)\Misc\NuGet.exe</NuGetTool>
<ZipTool>$(UtilDir)\Misc\zip.exe</ZipTool>
<!-- Using custom task from IronLanguages project -->
<CustomTasksDll>F:\workspace\DLR\IronLanguages\Solutions\CustomTasks\CustomTasks.dll</CustomTasksDll>
</PropertyGroup>
<UsingTask AssemblyFile="$(CustomTasksDll)" TaskName="CustomTasks.FormatTemplate" />
<ItemGroup>
<CurrentVersionFile Include="$(MSBuildThisFileDirectory)IronLua\CurrentVersion.cs" />
</ItemGroup>
<Target Name="GenerateCurrentVersion"
Inputs="$(MSBuildThisFileDirectory\CurrentVersion.props;@(CurrentVersionFile -> '%(rootdir)%(directory)%(filename).Template%(extension)');$(MSBuildThisFile)"
Outputs="@(CurrentVersionFile -> '%(rootdir)%(directory)%(filename).Generated%(extension)')">
<FormatTemplate TemplateFile="@(CurrentVersionFile -> '%(rootdir)%(directory)%(filename).Template%(extension)')"
OutputFile="@(CurrentVersionFile -> '%(rootdir)%(directory)%(filename).Generated%(extension)')"
Parameters="$(MajorVersion);$(MinorVersion);$(MicroVersion);$(ReleaseLevel);$(ReleaseSerial);$(ShortReleaseLevel);$(DisplayVersion);$(AssemblyRevision);$(AssemblyFileRevision)" />
</Target>
<ItemGroup>
<BuildProject Include="$(Solution)">
<Properties>Configuration=$(BaseConfiguration);OutputPath=$(BuildDir)</Properties>
</BuildProject>
<InstallerProject Include="$(BaseDir)\IronLua.Installer\IronLua.Installer.wixproj">
<Properties>Configuration=$(BaseConfiguration);BindInputPaths=$(StageDir);$(StageDir)/Platforms/Net40;OutputPath=$(PackageDir)</Properties>
</InstallerProject>
</ItemGroup>
<ItemGroup>
<IronLuaBins Include="ilua.exe" />
<IronLuaBins Include="iluaw.exe" />
<IronLuaLibs Include="IronLua.dll" />
<IronLuaLibs Include="IronLua.xml" />
<DlrLibs Include="Microsoft.Dynamic.dll" />
<DlrLibs Include="Microsoft.Dynamic.xml" />
<DlrLibs Include="Microsoft.Scripting.dll" />
<DlrLibs Include="Microsoft.Scripting.xml" />
</ItemGroup>
<Target Name="Build" DependsOnTargets="GenerateCurrentVersion">
<MSBuild Projects="@(BuildProject)" Targets="Build" Properties="%(BuildProject.Properties)" />
</Target>
<Target Name="Rebuild">
<MSBuild Projects="@(BuildProject)" Targets="Rebuild" Properties="%(BuildProject.Properties)" />
</Target>
<Target Name="Clean">
<MSBuild Projects="@(BuildProject)" Targets="Clean" Properties="%(BuildProject.Properties)" />
<MSBuild Projects="@(InstallerProject)" Targets="Clean" Condition=" '$(OS)' == 'Windows_NT'" />
</Target>
<Target Name="DistClean" DependsOnTargets="Clean">
<RemoveDir Directories="$(BaseDir)\Stage;$(BaseDir)\Package;$(BaseDir)\bin" />
</Target>
<Target Name="StageClean">
<RemoveDir Directories="$(StageDir)" Condition="Exists('$(StageDir)')" />
</Target>
<Target Name="Stage" DependsOnTargets="StageClean;Build">
<MakeDir Directories="$(StageDir)" Condition="!Exists('$(StageDir)')" />
<!--<Copy SourceFiles="@(DlrLibs->'$(BuildDir)\%(Identity)')" DestinationFolder="$(StageDir)" />-->
<!--<Copy SourceFiles="@(IronLuaLibs->'$(BuildDir)\%(Identity)')" DestinationFolder="$(StageDir)" />-->
<Copy SourceFiles="@(IronLuaBins->'$(BuildDir)\%(Identity)')" DestinationFolder="$(StageDir)" />
<!-- .NET 4 -->
<Copy SourceFiles="@(DlrLibs->'$(BuildDir)\%(Identity)')" DestinationFolder="$(StageDir)\Platforms\Net40" />
<Copy SourceFiles="@(IronLuaLibs->'$(BuildDir)\%(Identity)')" DestinationFolder="$(StageDir)\Platforms\Net40" />
</Target>
<Target Name="MsiPackage" DependsOnTargets="Stage" Condition="'$(OS)' == 'Windows_NT'">
<MSBuild Projects="@(InstallerProject)" Targets="Rebuild" />
</Target>
<Target Name="NuGetPackage" DependsOnTargets="Stage" Condition="'$(OS)' == 'Windows_NT'">
<!-- FIXME: This poke does not work. Something to do with namespaces?! More research needed. -->
<XmlPoke XmlInputPath="IronLua.nuspec"
Query="/package/metadata/value"
Value="$(MajorVersion).$(MinorVersion).$(MicroVersion)" />
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')" />
<Exec Command="$(NuGetTool) pack &quot;$(BaseDir)\IronLua.nuspec&quot; -BasePath &quot;$(StageDir)&quot; -OutputDirectory &quot;$(PackageDir)&quot;" />
</Target>
<Target Name="ZipPackage" DependsOnTargets="Stage" Condition="'$(OS)' == 'Windows_NT'">
<MakeDir Directories="$(PackageDir)" Condition="!Exists('$(PackageDir)')" />
<Exec Command="$(ZipTool) -9 -r &quot;$(PackageDir)\$(PackageName).zip&quot; &quot;$(PackageName)&quot;" WorkingDirectory="$(StageDir)\.." />
</Target>
<Target Name="Packages" DependsOnTargets="ZipPackage;NuGetPackage;MsiPackage" />
</Project>