]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44479: Simplified LICENSE.txt regeneration in Windows build (GH-27056)
authorSteve Dower <steve.dower@python.org>
Wed, 7 Jul 2021 17:21:54 +0000 (18:21 +0100)
committerGitHub <noreply@github.com>
Wed, 7 Jul 2021 17:21:54 +0000 (18:21 +0100)
PCbuild/regen.targets

index 22667d02aaa2c157849c760c9b9b817b279f1b8f..38f82d1b31a7f3d936b433a00f456f81d996e885 100644 (file)
@@ -96,7 +96,6 @@
     <_LicenseSources Include="$(tcltkDir)tcllicense.terms;
                               $(tcltkDir)tklicense.terms;
                               $(tcltkDir)tixlicense.terms" Condition="$(IncludeTkinter)" />
-    <_LicenseOutputs Include="$(OutDir)LICENSE.txt" />
   </ItemGroup>
 
   <Target Name="_RegenTestFrozenmain" Inputs="@(_TestFrozenSources)" Outputs="@(_TestFrozenOutputs)"
           WorkingDirectory="$(PySourcePath)" />
   </Target>
 
-  <Target Name="_RegenLicense" Inputs="@(_LicenseSources)" Outputs="@(_LicenseOutputs)">
-    <Message Text="Regenerate @(_LicenseOutputs->'%(Filename)%(Extension)', ' ')" Importance="high" />
+  <Target Name="_RegenLicense">
     <ItemGroup>
-      <_Text Include="@(_LicenseFiles)">
+      <_Text1 Include="@(_LicenseSources)">
         <Content Condition="Exists(%(FullPath))">$([System.IO.File]::ReadAllText(%(FullPath)))</Content>
-      </_Text>
+      </_Text1>
+      <_Text Include="@(_Text1->'%(Content)')" />
     </ItemGroup>
 
-    <WriteLinesToFile File="@(_LicenseOutputs)" Overwrite="true" Lines="@(_Text->'%(Content)')" />
+    <WriteLinesToFile File="$(OutDir)LICENSE.txt" Overwrite="true" Lines="@(_Text)" />
+    <Warning Text="License file %(_LicenseSources.FullPath) is missing"
+             Condition="!Exists(@(_LicenseSources))" />
+    <Message Text="Wrote $(OutDir)LICENSE.txt" Importance="high" />
   </Target>
 
-  <Target Name="PostBuildRegen" DependsOnTargets="_RegenTestFrozenmain;_RegenLicense">
-    <Message Text="Other generated files are up to date" Importance="high" />
-  </Target>
+  <Target Name="PostBuildRegen" DependsOnTargets="_RegenTestFrozenmain;_RegenLicense" />
 </Project>