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> |
Steve Dower | 1aceb02 | 2017-02-23 14:11:36 -0800 | [diff] [blame^] | 12 | <Purge Condition="'$(Purge)' == ''">false</Purge> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 13 | </PropertyGroup> |
| 14 | |
| 15 | <Import Project="msi.props" /> |
| 16 | <Import Project="bundle\bundle.targets" /> |
| 17 | |
| 18 | <PropertyGroup> |
| 19 | <EXETarget>$(DownloadUrlBase.TrimEnd(`/`))/$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</EXETarget> |
Steve Dower | 21cecb9 | 2015-11-22 18:20:11 -0800 | [diff] [blame] | 20 | <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] | 21 | </PropertyGroup> |
| 22 | |
| 23 | <ItemGroup> |
| 24 | <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu"> |
| 25 | <CopyTo>$(MSITarget)</CopyTo> |
| 26 | </File> |
Steve Dower | 8c1cee9 | 2015-05-02 21:38:26 -0700 | [diff] [blame] | 27 | <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip"> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 28 | <CopyTo>$(EXETarget)</CopyTo> |
| 29 | </File> |
| 30 | <File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)"> |
| 31 | <CopyTo>$(EXETarget)</CopyTo> |
| 32 | </File> |
| 33 | </ItemGroup> |
| 34 | |
| 35 | <Target Name="_ValidateProperties"> |
| 36 | <Error Text="No value for Host provided" Condition="'$(Host)' == ''" /> |
| 37 | <Error Text="No value for User provided" Condition="'$(User)' == ''" /> |
| 38 | <Error Text="No path for PSCP provided" Condition="'$(PSCP)' == ''" /> |
| 39 | <Error Text="No path for PLINK provided" Condition="'$(PLINK)' == ''" /> |
| 40 | </Target> |
| 41 | |
Steve Dower | 7b8c5f5 | 2015-04-05 18:42:37 -0700 | [diff] [blame] | 42 | <Target Name="_RunGpg" Condition="'$(GPG)' != ''" Inputs="@(File)" Outputs="$(IntermediateOutputPath)\gpg\%(FileName)%(Extension).asc"> |
| 43 | <MakeDir Directories="$(IntermediateOutputPath)gpg" /> |
| 44 | <Delete Files="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" Condition="Exists('$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc')" /> |
| 45 | <Exec Command=""$(GPG)" -ba -o "$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc" "%(File.FullPath)"" /> |
| 46 | <ItemGroup> |
| 47 | <File Include="$(IntermediateOutputPath)\gpg\%(File.FileName)%(File.Extension).asc"> |
| 48 | <CopyTo>%(File.CopyTo)</CopyTo> |
| 49 | </File> |
| 50 | </ItemGroup> |
| 51 | </Target> |
| 52 | |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 53 | <Target Name="_Upload" Condition="!$(DryRun)"> |
| 54 | <Exec Command=""$(PLINK)" $(User)@$(Host) mkdir %(File.CopyTo) ^&^& chgrp downloads %(File.CopyTo) ^&^& chmod g-w,o+rx %(File.CopyTo) |
| 55 | "$(PSCP)" @(File,' ') $(User)@$(Host):%(File.CopyTo) |
Steve Dower | 1872f93 | 2015-03-08 12:59:00 -0700 | [diff] [blame] | 56 | "$(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] | 57 | " /> |
| 58 | </Target> |
| 59 | |
| 60 | <Target Name="_PrintNames" Condition="$(DryRun)"> |
| 61 | <Exec Command="echo "$(PLINK)" $(User)@$(Host) mkdir %(File.CopyTo) ^&^& chgrp downloads %(File.CopyTo) ^&^& chmod g-w,o+rx %(File.CopyTo) |
| 62 | echo "$(PSCP)" @(File,' ') $(User)@$(Host):%(File.CopyTo) |
Steve Dower | 1872f93 | 2015-03-08 12:59:00 -0700 | [diff] [blame] | 63 | 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] | 64 | echo. |
| 65 | echo." /> |
| 66 | </Target> |
| 67 | |
Steve Dower | 1aceb02 | 2017-02-23 14:11:36 -0800 | [diff] [blame^] | 68 | <Target Name="_Purge" Condition="$(Purge) and !$(DryRun)"> |
| 69 | <Error Condition="!Exists('$(PythonExe)')" Text="No Python executable available at $(PythonExe)" /> |
| 70 | <Exec Command=""$(PythonExe)" purge.py $(PythonVersion)" /> |
| 71 | </Target> |
| 72 | |
| 73 | <Target Name="_TestLayout"> |
| 74 | <ItemGroup> |
| 75 | <WebInstaller Include="$(OutputPath)\*-webinstall.exe" /> |
| 76 | <WebInstaller> |
| 77 | <SourceDir>$(TEMP)\%(Filename)_source</SourceDir> |
| 78 | <SourceExe>$(TEMP)\%(Filename)_source\%(Filename)%(Extension)</SourceExe> |
| 79 | <LayoutDir>$(TEMP)\%(Filename)_layout</LayoutDir> |
| 80 | <LogDir>$(OutputPath)\%(Filename)_layoutlog</LogDir> |
| 81 | <LogFile>$(OutputPath)\%(Filename)_layoutlog\%(Filename).log</LogFile> |
| 82 | </WebInstaller> |
| 83 | </ItemGroup> |
| 84 | <RemoveDir Directories="%(WebInstaller.SourceDir)" Condition="Exists('%(WebInstaller.SourceDir)')" /> |
| 85 | <RemoveDir Directories="%(WebInstaller.LayoutDir)" Condition="Exists('%(WebInstaller.LayoutDir)')" /> |
| 86 | <RemoveDir Directories="%(WebInstaller.LogDir)" Condition="Exists('%(WebInstaller.LogDir)')" /> |
| 87 | <MakeDir Directories="%(WebInstaller.SourceDir)" /> |
| 88 | <Copy SourceFiles="@(WebInstaller)" DestinationFiles="%(WebInstaller.SourceExe)" /> |
| 89 | <Exec Command="start "Install test" /wait "%(WebInstaller.SourceExe)" /layout "%(WebInstaller.LayoutDir)" /passive /log "%(WebInstaller.LogFile)"" |
| 90 | IgnoreExitCode="false" /> |
| 91 | <RemoveDir Directories="%(WebInstaller.LayoutDir)" /> |
| 92 | <RemoveDir Directories="%(WebInstaller.SourceDir)" /> |
| 93 | <RemoveDir Directories="%(WebInstaller.LogDir)" /> |
| 94 | </Target> |
| 95 | |
| 96 | <Target Name="Upload" DependsOnTargets="_ValidateProperties;_RunGpg;_PrintNames;_Upload;_Purge" /> |
| 97 | <Target Name="Test" DependsOnTargets="_TestLayout" /> |
Steve Dower | 7b8c5f5 | 2015-04-05 18:42:37 -0700 | [diff] [blame] | 98 | |
| 99 | <Target Name="ShowHashes"> |
| 100 | <ItemGroup> |
| 101 | <UserFiles Include="@(File)" Condition="'%(File.CopyTo)' == '$(EXETarget)'" /> |
| 102 | </ItemGroup> |
| 103 | |
| 104 | <Exec Command=""$(PythonExe)" generate_md5.py @(UserFiles->'"%(FullPath)"',' ')" /> |
| 105 | </Target> |
Steve Dower | 2856332 | 2015-03-04 20:27:03 -0800 | [diff] [blame] | 106 | |
| 107 | <Target Name="Build"> |
| 108 | <Error Text="This script should be invoked using uploadrelease.bat." /> |
| 109 | </Target> |
| 110 | </Project> |