Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 1 | <?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 Dower | 21cecb9 | 2015-11-22 18:20:11 -0800 | [diff] [blame] | 19 | <MSITarget>$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, ``).TrimEnd(`/`))</MSITarget> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 20 | </PropertyGroup> |
| 21 | |
| 22 | <ItemGroup> |
| 23 | <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu"> |
| 24 | <CopyTo>$(MSITarget)</CopyTo> |
| 25 | </File> |
Steve Dower | 8c1cee9 | 2015-05-02 21:38:26 -0700 | [diff] [blame] | 26 | <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip"> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 27 | <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 Dower | 7b8c5f5 | 2015-04-05 18:42:37 -0700 | [diff] [blame] | 41 | <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=""$(GPG)" -ba -o "$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" "%(File.FullPath)"" /> |
| 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 Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 52 | <Target Name="_Upload" Condition="!$(DryRun)"> |
| 53 | <Exec Command=""$(PLINK)" $(User)@$(Host) mkdir %(File.CopyTo) ^&^& chgrp downloads %(File.CopyTo) ^&^& chmod g-w,o+rx %(File.CopyTo) |
| 54 | "$(PSCP)" @(File,' ') $(User)@$(Host):%(File.CopyTo) |
Steve Dower | 1872f93 | 2015-03-08 12:59:00 -0700 | [diff] [blame] | 55 | "$(PLINK)" $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/* |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 56 | " /> |
| 57 | </Target> |
| 58 | |
| 59 | <Target Name="_PrintNames" Condition="$(DryRun)"> |
| 60 | <Exec Command="echo "$(PLINK)" $(User)@$(Host) mkdir %(File.CopyTo) ^&^& chgrp downloads %(File.CopyTo) ^&^& chmod g-w,o+rx %(File.CopyTo) |
| 61 | echo "$(PSCP)" @(File,' ') $(User)@$(Host):%(File.CopyTo) |
Steve Dower | 1872f93 | 2015-03-08 12:59:00 -0700 | [diff] [blame] | 62 | echo "$(PLINK)" $(User)@$(Host) chgrp downloads %(File.CopyTo)/*; chmod g-w,o+r %(File.CopyTo)/* |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 63 | echo. |
| 64 | echo." /> |
| 65 | </Target> |
| 66 | |
Steve Dower | 7b8c5f5 | 2015-04-05 18:42:37 -0700 | [diff] [blame] | 67 | <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=""$(PythonExe)" generate_md5.py @(UserFiles->'"%(FullPath)"',' ')" /> |
| 75 | </Target> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 76 | |
| 77 | <Target Name="Build"> |
| 78 | <Error Text="This script should be invoked using uploadrelease.bat." /> |
| 79 | </Target> |
| 80 | </Project> |