blob: 0d472dea5428a09b215d9a19edee834ce2872585 [file] [log] [blame]
Steve Dower28563322015-03-04 20:27:03 -08001<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup>
4 <ProjectGuid>{2D69F2AB-D5D0-4344-84B5-EF6DB34A9BC9}</ProjectGuid>
5 <OutputName>python</OutputName>
6 <OutputSuffix></OutputSuffix>
7
8 <DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">$(TARGET)</DownloadUrlBase>
9 <DownloadUrlBase Condition="'$(DownloadUrlBase)' == ''">/srv/www.python.org/ftp/python</DownloadUrlBase>
10 <IncludeDoc Condition="'$(IncludeDoc)' == ''">true</IncludeDoc>
11 <DryRun Condition="'$(DryRun)' == ''">false</DryRun>
12 </PropertyGroup>
13
14 <Import Project="msi.props" />
15 <Import Project="bundle\bundle.targets" />
16
17 <PropertyGroup>
18 <EXETarget>$(DownloadUrlBase.TrimEnd(`/`))/$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</EXETarget>
Steve Dower21cecb92015-11-22 18:20:11 -080019 <MSITarget>$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, ``).TrimEnd(`/`))</MSITarget>
Steve Dower28563322015-03-04 20:27:03 -080020 </PropertyGroup>
21
22 <ItemGroup>
23 <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu">
24 <CopyTo>$(MSITarget)</CopyTo>
25 </File>
Steve Dower8c1cee92015-05-02 21:38:26 -070026 <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip">
Steve Dower28563322015-03-04 20:27:03 -080027 <CopyTo>$(EXETarget)</CopyTo>
28 </File>
29 <File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)">
30 <CopyTo>$(EXETarget)</CopyTo>
31 </File>
32 </ItemGroup>
33
34 <Target Name="_ValidateProperties">
35 <Error Text="No value for Host provided" Condition="'$(Host)' == ''" />
36 <Error Text="No value for User provided" Condition="'$(User)' == ''" />
37 <Error Text="No path for PSCP provided" Condition="'$(PSCP)' == ''" />
38 <Error Text="No path for PLINK provided" Condition="'$(PLINK)' == ''" />
39 </Target>
40
Steve Dower7b8c5f52015-04-05 18:42:37 -070041 <Target Name="_RunGpg" Condition="'$(GPG)' != ''" Inputs="@(File)" Outputs="$(IntermediateOutputPath)\gpg\%(FileName)%(Extension).asc">
42 <MakeDir Directories="$(IntermediateOutputPath)gpg" />
43 <Delete Files="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" Condition="Exists('$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc')" />
44 <Exec Command="&quot;$(GPG)&quot; -ba -o &quot;$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc&quot; &quot;%(File.FullPath)&quot;" />
45 <ItemGroup>
46 <File Include="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc">
47 <CopyTo>%(File.CopyTo)</CopyTo>
48 </File>
49 </ItemGroup>
50 </Target>
51
Steve Dower28563322015-03-04 20:27:03 -080052 <Target Name="_Upload" Condition="!$(DryRun)">
53 <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)
54&quot;$(PSCP)&quot; @(File,' ') $(User)@$(Host):%(File.CopyTo)
Steve Dower1872f932015-03-08 12:59:00 -070055&quot;$(PLINK)&quot; $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/*
Steve Dower28563322015-03-04 20:27:03 -080056" />
57 </Target>
58
59 <Target Name="_PrintNames" Condition="$(DryRun)">
60 <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)
61echo &quot;$(PSCP)&quot; @(File,' ') $(User)@$(Host):%(File.CopyTo)
Steve Dower1872f932015-03-08 12:59:00 -070062echo &quot;$(PLINK)&quot; $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/*
Steve Dower28563322015-03-04 20:27:03 -080063echo.
64echo." />
65 </Target>
66
Steve Dower7b8c5f52015-04-05 18:42:37 -070067 <Target Name="Upload" DependsOnTargets="_ValidateProperties;_RunGpg;_PrintNames;_Upload" />
68
69 <Target Name="ShowHashes">
70 <ItemGroup>
71 <UserFiles Include="@(File)" Condition="'%(File.CopyTo)' == '$(EXETarget)'" />
72 </ItemGroup>
73
74 <Exec Command="&quot;$(PythonExe)&quot; generate_md5.py @(UserFiles->'&quot;%(FullPath)&quot;',' ')" />
75 </Target>
Steve Dower28563322015-03-04 20:27:03 -080076
77 <Target Name="Build">
78 <Error Text="This script should be invoked using uploadrelease.bat." />
79 </Target>
80</Project>