cpython/Tools/msi/uploadrelease.proj

81 lines
4.2 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{2D69F2AB-D5D0-4344-84B5-EF6DB34A9BC9}</ProjectGuid>
<OutputName>python</OutputName>
<OutputSuffix></OutputSuffix>
<DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">$(TARGET)</DownloadUrlBase>
<DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">/srv/www.python.org/ftp/python</DownloadUrlBase>
<IncludeDoc Condition="'$(IncludeDoc)' == ''">true</IncludeDoc>
<DryRun Condition="'$(DryRun)' == ''">false</DryRun>
</PropertyGroup>
<Import Project="msi.props" />
<Import Project="bundle\bundle.targets" />
<PropertyGroup>
<EXETarget>$(DownloadUrlBase.TrimEnd(`/`))/$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</EXETarget>
<MSITarget>$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, ``).TrimEnd(`/`))</MSITarget>
</PropertyGroup>
<ItemGroup>
<File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu">
<CopyTo>$(MSITarget)</CopyTo>
</File>
<File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip">
<CopyTo>$(EXETarget)</CopyTo>
</File>
<File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)">
<CopyTo>$(EXETarget)</CopyTo>
</File>
</ItemGroup>
<Target Name="_ValidateProperties">
<Error Text="No value for Host provided" Condition="'$(Host)' == ''" />
<Error Text="No value for User provided" Condition="'$(User)' == ''" />
<Error Text="No path for PSCP provided" Condition="'$(PSCP)' == ''" />
<Error Text="No path for PLINK provided" Condition="'$(PLINK)' == ''" />
</Target>
<Target Name="_RunGpg" Condition="'$(GPG)' != ''" Inputs="@(File)" Outputs="$(IntermediateOutputPath)\gpg\%(FileName)%(Extension).asc">
<MakeDir Directories="$(IntermediateOutputPath)gpg" />
<Delete Files="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" Condition="Exists('$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc')" />
<Exec Command="&quot;$(GPG)&quot; -ba -o &quot;$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc&quot; &quot;%(File.FullPath)&quot;" />
<ItemGroup>
<File Include="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc">
<CopyTo>%(File.CopyTo)</CopyTo>
</File>
</ItemGroup>
</Target>
<Target Name="_Upload" Condition="!$(DryRun)">
<Exec Command="&quot;$(PLINK)&quot; $(User)@$(Host) mkdir %(File.CopyTo) ^&amp;^&amp; chgrp downloads %(File.CopyTo) ^&amp;^&amp; chmod g-w,o+rx %(File.CopyTo)
&quot;$(PSCP)&quot; @(File,' ') $(User)@$(Host):%(File.CopyTo)
&quot;$(PLINK)&quot; $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/*
" />
</Target>
<Target Name="_PrintNames" Condition="$(DryRun)">
<Exec Command="echo &quot;$(PLINK)&quot; $(User)@$(Host) mkdir %(File.CopyTo) ^&amp;^&amp; chgrp downloads %(File.CopyTo) ^&amp;^&amp; chmod g-w,o+rx %(File.CopyTo)
echo &quot;$(PSCP)&quot; @(File,' ') $(User)@$(Host):%(File.CopyTo)
echo &quot;$(PLINK)&quot; $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/*
echo.
echo." />
</Target>
<Target Name="Upload" DependsOnTargets="_ValidateProperties;_RunGpg;_PrintNames;_Upload" />
<Target Name="ShowHashes">
<ItemGroup>
<UserFiles Include="@(File)" Condition="'%(File.CopyTo)' == '$(EXETarget)'" />
</ItemGroup>
<Exec Command="&quot;$(PythonExe)&quot; generate_md5.py @(UserFiles->'&quot;%(FullPath)&quot;',' ')" />
</Target>
<Target Name="Build">
<Error Text="This script should be invoked using uploadrelease.bat." />
</Target>
</Project>