зеркало из https://github.com/Azure/autorest.git
Added 7zip and updated build.proj to sign nupkg packages
This commit is contained in:
Родитель
d95773db14
Коммит
90c3b084cc
|
@ -175,4 +175,5 @@ AutoRest/Generators/Ruby/*/RspecTests/Generated/*
|
|||
#dnx installation
|
||||
dnx-clr-win-x86*/
|
||||
dnx-coreclr-win-x86*/
|
||||
*.lock.json
|
||||
*.lock.json
|
||||
/dnx
|
||||
|
|
|
@ -3,6 +3,5 @@
|
|||
<packageSources>
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="xunit" value="https://www.myget.org/F/xunit/api/v2" />
|
||||
<!--<add key="aspnetrc1" value="https://www.myget.org/F/aspnetrc1/api/v2" />-->
|
||||
</packageSources>
|
||||
</configuration>
|
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,56 @@
|
|||
7-Zip
|
||||
~~~~~
|
||||
License for use and distribution
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
7-Zip Copyright (C) 1999-2015 Igor Pavlov.
|
||||
|
||||
Licenses for files are:
|
||||
|
||||
1) 7z.dll: GNU LGPL + unRAR restriction
|
||||
2) All other files: GNU LGPL
|
||||
|
||||
The GNU LGPL + unRAR restriction means that you must follow both
|
||||
GNU LGPL rules and unRAR restriction rules.
|
||||
|
||||
|
||||
Note:
|
||||
You can use 7-Zip on any computer, including a computer in a commercial
|
||||
organization. You don't need to register or pay for 7-Zip.
|
||||
|
||||
|
||||
GNU LGPL information
|
||||
--------------------
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You can receive a copy of the GNU Lesser General Public License from
|
||||
http://www.gnu.org/
|
||||
|
||||
|
||||
unRAR restriction
|
||||
-----------------
|
||||
|
||||
The decompression engine for RAR archives was developed using source
|
||||
code of unRAR program.
|
||||
All copyrights to original unRAR code are owned by Alexander Roshal.
|
||||
|
||||
The license for original unRAR code has the following restriction:
|
||||
|
||||
The unRAR sources cannot be used to re-create the RAR compression algorithm,
|
||||
which is proprietary. Distribution of modified unRAR sources in separate form
|
||||
or as a part of other software is permitted, provided that it is clearly
|
||||
stated in the documentation and source comments that the code may
|
||||
not be used to develop a RAR (WinRAR) compatible archiver.
|
||||
|
||||
|
||||
--
|
||||
Igor Pavlov
|
81
build.proj
81
build.proj
|
@ -67,6 +67,7 @@
|
|||
<!-- Only set set this to true for testing the code sign workflow locally. -->
|
||||
<DelaySign Condition =" '$(DelaySign)' == '' ">false</DelaySign>
|
||||
<Scope Condition=" '$(Scope)' == '' ">all</Scope>
|
||||
<ZipExe>$(LibraryToolsFolder)\7-Zip\7z.exe</ZipExe>
|
||||
<DnxVersion>1.0.0-rc1-final</DnxVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -96,9 +97,15 @@
|
|||
<UsingTask Condition=" $(OnPremiseBuild) " TaskName="CorporateValidation" AssemblyFile="$(CIToolsPath)\Microsoft.WindowsAzure.Tools.Build.Tasks.OnPremise.dll" />
|
||||
<Import Condition=" $(OnPremiseBuild) " Project="$(CIToolsPath)\Microsoft.WindowsAzure.Build.OnPremise.msbuild" />
|
||||
|
||||
<ItemGroup>
|
||||
<DnxLibraries Include="$(LibraryRoot)/ClientRuntimes/CSharp/**/project.json" />
|
||||
<DnxLibraries Include="$(LibraryRoot)/AutoRest/Generators/**/project.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="Build" DependsOnTargets="RestoreNugetPackages">
|
||||
<CallTarget Targets="BuildMsBuildTask" />
|
||||
<CallTarget Targets="BuildServerPreparation" Condition=" '$(CodeSign)' == 'true' " />
|
||||
<Exec Command="dnvm use $(DnxVersion) -r coreclr" ContinueOnError="false"/>
|
||||
<!--
|
||||
The solution file contains configurations for each platform such as Portable-Debug, Net45-Release, etc
|
||||
When invoking msbuild, provide the right configuration name.
|
||||
|
@ -111,17 +118,24 @@
|
|||
Properties="Configuration=Net45-$(Configuration);Platform=Any CPU;CodeSign=$(CodeSign)"
|
||||
Targets="Build"
|
||||
Condition=" '$(Scope)' == 'all' or '$(Scope)' == 'CodeGenerator'" />
|
||||
<ItemGroup>
|
||||
<_OriginalDnxPackages Include="$(LibraryRoot)/ClientRuntimes/CSharp/**/bin/$(Configuration)/*.nupkg" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(_OriginalDnxPackages)" DestinationFolder="$(LibraryRoot)\dnx"
|
||||
Condition=" '$(Scope)' == 'all' or '$(Scope)' == 'ClientRuntime'"/>
|
||||
<Copy SourceFiles="@(_OriginalDnxPackages)" DestinationFolder="$(PackageOutputDir)"
|
||||
Condition=" '$(Scope)' == 'all' or '$(Scope)' == 'ClientRuntime'"/>
|
||||
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildDnxLibraries" DependsOnTargets="RestoreNugetPackages">
|
||||
<ItemGroup>
|
||||
<DnxLibraries Include="$(LibraryRoot)/ClientRuntimes/CSharp/**/project.json" />
|
||||
<DnxLibraries Include="$(LibraryRoot)/AutoRest/Generators/**/project.json" />
|
||||
</ItemGroup>
|
||||
<Exec Command="dnvm use $(DnxVersion) -r coreclr" ContinueOnError="false"/>
|
||||
<Exec Command="dnu build" WorkingDirectory="%(DnxLibraries.RootDir)%(DnxLibraries.Directory)"/>
|
||||
<Exec Command="dnu pack" WorkingDirectory="%(DnxLibraries.RootDir)%(DnxLibraries.Directory)"/>
|
||||
<ItemGroup>
|
||||
<_OriginalDnxPackages Include="%(DnxLibraries.RootDir)%(DnxLibraries.Directory)\bin\*\*.nupkg" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="@(_OriginalDnxPackages)" DestinationFolder="$(LibraryRoot)\dnx" />
|
||||
</Target>
|
||||
|
||||
<!-- Project files import some targets coming from nuget packages, so need to restore them first to avoid errors
|
||||
|
@ -164,6 +178,7 @@
|
|||
<CorporateScanPaths>$(LibrarySourceFolder)ClientRuntimes;$(LibrarySourceFolder)AutoRest</CorporateScanPaths>
|
||||
<BinscopeScanPath>$(BinariesFolder)</BinscopeScanPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="SignBinariesForAFxTarget">
|
||||
<PropertyGroup>
|
||||
<!-- Public token of MSSharedLibKey.snk. -->
|
||||
|
@ -257,4 +272,62 @@
|
|||
|
||||
<Import Project="tools\NuGet.targets"/>
|
||||
|
||||
<Target Name="SignAssembliesInDnxPackages">
|
||||
<ItemGroup>
|
||||
<_DnxPackages Include="$(LibraryRoot)\dnx\*.nupkg" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<_UnsignedFolder>$(PackageOutputDir)\unsigned</_UnsignedFolder>
|
||||
<_SignedFolder>$(PackageOutputDir)\signed</_SignedFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<Message Text="%(_DnxPackages.Identity)" Importance="low" />
|
||||
|
||||
<RemoveDir Directories="$(_UnsignedFolder);$(_SignedFolder)" ContinueOnError="false" />
|
||||
<RemoveDir Directories="@(_DnxPackages->'$(PackageOutputDir)\%(Filename)')" ContinueOnError="false" />
|
||||
|
||||
<MakeDir Directories="$(_UnsignedFolder);$(_SignedFolder)" />
|
||||
|
||||
<Exec Command="$(ZipExe) x -y -scsUTF-8 -o@(_DnxPackages->'$(PackageOutputDir)\%(Filename)') %(_DnxPackages.Identity)" />
|
||||
|
||||
<RemoveDir Directories="@(_DnxPackages->'%(RootDir)%(Directory)\%(Filename)\_rels')" />
|
||||
<Delete Files="@(_DnxPackages->'%(RootDir)%(Directory)\%(Filename)\[Content_Types].xml')" />
|
||||
|
||||
<ItemGroup>
|
||||
<_TempBinaries Include="$(PackageOutputDir)\**\*.dll"/>
|
||||
<_PackageBinaries Include="@(_TempBinaries)">
|
||||
<!-- Flattened file for signing -->
|
||||
<UnsignedFlatFileName>$(_UnsignedFolder)\$([System.String]::new('%(RecursiveDir)%(FileName)%(Extension)').Replace('\', '__'))</UnsignedFlatFileName>
|
||||
<SignedFlatFileName>$(_SignedFolder)\$([System.String]::new('%(RecursiveDir)%(FileName)%(Extension)').Replace('\', '__'))</SignedFlatFileName>
|
||||
</_PackageBinaries>
|
||||
</ItemGroup>
|
||||
|
||||
<Copy SourceFiles="@(_PackageBinaries)" DestinationFiles="@(_PackageBinaries->'%(UnsignedFlatFileName)')"></Copy>
|
||||
|
||||
<CodeSigningTask
|
||||
Description="Microsoft Azure SDK"
|
||||
Keywords="Microsoft Azure .NET SDK"
|
||||
UnsignedFiles="@(_PackageBinaries->'%(UnsignedFlatFileName)')"
|
||||
DestinationPath="$(_SignedFolder)"
|
||||
SigningLogPath="$(PackageOutputDir)\signing.log"
|
||||
ToolsPath="$(CIToolsPath)"
|
||||
Condition="!$(DelaySign)"/>
|
||||
|
||||
<!--If we are testing locally then we copy the binaries and do not submit to the code sign server-->
|
||||
<Copy SourceFiles="@(_PackageBinaries->'%(UnsignedFlatFileName)')" DestinationFolder="$(_SignedFolder)" Condition="$(DelaySign)" />
|
||||
|
||||
<GetFrameworkSdkPath>
|
||||
<Output TaskParameter="Path" PropertyName="WindowsSdkPath"/>
|
||||
</GetFrameworkSdkPath>
|
||||
<ValidateStrongNameSignatureTask
|
||||
WindowsSdkPath="$(WindowsSdkPath)"
|
||||
Assembly="%(_PackageBinaries.SignedFlatFileName)"
|
||||
ExpectedTokenSignature="$(StrongNameToken)"
|
||||
ExpectedDelaySigned="false"
|
||||
ContinueOnError="false"
|
||||
Condition="!$(DelaySign)"/>
|
||||
|
||||
<Copy SourceFiles="@(_PackageBinaries->'%(SignedFlatFileName)')" DestinationFiles="@(_PackageBinaries->'%(FullPath)')"></Copy>
|
||||
<Exec Command="$(ZipExe) a -tzip -mx9 -r -y $(PackageOutputDir)\%(_DnxPackages.Filename).nupkg" WorkingDirectory="$(PackageOutputDir)\%(_DnxPackages.Filename)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче