提交 d1e29826 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Changes to prepare for consolidation (dotnet/core-setup#8593)

* Write an empty global.json for tests so they don't use the repo's global.json

* Create new SetupRoot variable that represents the root of core-setup. Convert usages of RepoRoot and ProjectDir to either SetupRoot or RepoRoot depending on if they need files that are at the root of the repo or are setup-specific.

* regenerate-readme-table should always target the root README.

* Make pack-managed.proj an SDK project.

* Make the root directory of the repository configurable in corehost/build.cmd and corehost/build.sh.

* Rename LICENSE.TXT to LICENSE. Set properties for the Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk so we don't need to customize them during consolidation.

* Update Microsoft.DotNet.Build.SharedFramework.Sdk version.

* Update eng/Version.Details.xml
Co-Authored-By: NDavis Goodin <dagood@users.noreply.github.com>


Commit migrated from https://github.com/dotnet/core-setup/commit/96ec25abe981ac689e260efe946db419b157f5f1
上级 c2ce4d3e
The MIT License (MIT)
Copyright (c) .NET Foundation and Contributors
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
......@@ -4,9 +4,6 @@ setlocal
:SetupArgs
:: Initialize the args that will be passed to cmake
set __nativeWindowsDir=%~dp0Windows
set __binDir=%~dp0..\..\artifacts\bin
set __objDir=%~dp0..\..\artifacts\obj
set __rootDir=%~dp0..\..
set __CMakeBinDir=""
set __IntermediatesDir=""
set __BuildArch=x64
......@@ -40,6 +37,7 @@ if /i [%1] == [policyver] (set __HostPolicyVersion=%2&&shift&&shift&goto Arg_L
if /i [%1] == [commit] (set __CommitSha=%2&&shift&&shift&goto Arg_Loop)
if /i [%1] == [incremental-native-build] ( set __IncrementalNativeBuild=1&&shift&goto Arg_Loop)
if /i [%1] == [rootDir] ( set __rootDir=%2&&shift&&shift&goto Arg_Loop)
shift
goto :Arg_Loop
......@@ -87,6 +85,15 @@ set __VSVersion=15 2017
call "%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat" %__VCBuildArch%
:SetupDirs
if %__rootDir% == "" (
echo Root directory must be provided via the rootDir parameter.
exit /b 1
)
set __binDir=%__rootDir%\artifacts\bin
set __objDir=%__rootDir%\artifacts\obj
:: Setup to cmake the native components
echo Commencing build of corehost
echo.
......@@ -137,8 +144,6 @@ goto :Failure
:: Build the project created by Cmake
set __msbuildArgs=/p:Platform=%__BuildArch% /p:PlatformToolset="%__PlatformToolset%"
cd %__rootDir%
SET __NativeBuildArgs=/t:rebuild
if /i "%__IncrementalNativeBuild%" == "1" SET __NativeBuildArgs=
......
......@@ -31,6 +31,7 @@
<BuildArgs Condition="'$(PortableBuild)' == 'true'">$(BuildArgs) -portable</BuildArgs>
<BuildArgs Condition="'$(CrossBuild)' == 'true'">$(BuildArgs) --cross</BuildArgs>
<BuildArgs Condition="'$(StripSymbols)' == 'true'">$(BuildArgs) --stripsymbols</BuildArgs>
<BuildArgs>$(BuildArgs) --rootdir $(RepoRoot)</BuildArgs>
</PropertyGroup>
<!--
......@@ -85,6 +86,7 @@
<BuildArgs>$(ConfigurationGroup) $(TargetArchitecture) apphostver $(AppHostVersion) hostver $(HostVersion) fxrver $(HostResolverVersion) policyver $(HostPolicyVersion) commit $(LatestCommit) rid $(OutputRid)</BuildArgs>
<BuildArgs Condition="'$(PortableBuild)' == 'true'">$(BuildArgs) portable</BuildArgs>
<BuildArgs Condition="'$(IncrementalNativeBuild)' == 'true'">$(BuildArgs) incremental-native-build</BuildArgs>
<BuildArgs>$(BuildArgs) rootdir $(RepoRoot)</BuildArgs>
</PropertyGroup>
<!--
......
......@@ -58,9 +58,10 @@ init_rid_plat()
usage()
{
echo "Usage: $0 --configuration <configuration> --arch <Architecture> --hostver <Dotnet exe version> --apphostver <app host exe version> --fxrver <HostFxr library version> --policyver <HostPolicy library version> --commithash <Git commit hash> [--xcompiler <Cross C++ Compiler>]"
echo "Usage: $0 --rootdir <path> --configuration <configuration> --arch <Architecture> --hostver <Dotnet exe version> --apphostver <app host exe version> --fxrver <HostFxr library version> --policyver <HostPolicy library version> --commithash <Git commit hash> [--xcompiler <Cross C++ Compiler>]"
echo ""
echo "Options:"
echo " --rootdir <path> Path to the root of the repository. Required."
echo " --configuration <configuration> Build configuration (Debug, Release)"
echo " --arch <Architecture> Target Architecture (x64, x86, arm, arm64, armel)"
echo " --hostver <Dotnet host version> Version of the dotnet executable"
......@@ -85,9 +86,6 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
RootRepo="$DIR/../.."
__bin_dir="$RootRepo/artifacts/bin"
__build_arch=
__host_ver=
__apphost_ver=
......@@ -99,8 +97,6 @@ __portableBuildArgs=
__configuration=Debug
__linkPortable=0
__cmake_defines=
__baseIntermediateOutputPath="$RootRepo/artifacts/obj"
__versionSourceFile="$__baseIntermediateOutputPath/_version.c"
__cmake_bin_prefix=
while [ "$1" != "" ]; do
......@@ -148,12 +144,26 @@ while [ "$1" != "" ]; do
--stripsymbols)
__cmake_defines="${__cmake_defines} -DSTRIP_SYMBOLS=true"
;;
--rootdir)
shift
RootRepo=$1
;;
*)
echo "Unknown argument to build.sh $1"; usage; exit 1
esac
shift
done
if [ "$RootRepo" == "" ]; then
usage
fi
SetupRoot="$RootRepo/src/setup"
__bin_dir="$RootRepo/artifacts/bin"
__baseIntermediateOutputPath="$RootRepo/artifacts/obj"
__versionSourceFile="$__baseIntermediateOutputPath/_version.c"
__cmake_defines="${__cmake_defines} -DCMAKE_BUILD_TYPE=${__configuration} ${__portableBuildArgs}"
mkdir -p "$__baseIntermediateOutputPath"
......@@ -180,7 +190,7 @@ __cmake_defines="${__cmake_defines} ${__arch_define}"
# Configure environment if we are doing a cross compile.
if [ "$__CrossBuild" == 1 ]; then
if ! [[ -n $ROOTFS_DIR ]]; then
export ROOTFS_DIR="$RootRepo/cross/rootfs/$__build_arch"
export ROOTFS_DIR="$SetupRoot/cross/rootfs/$__build_arch"
fi
fi
......
......@@ -8,7 +8,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<IncludeSymbols>true</IncludeSymbols>
<Serviceable>true</Serviceable>
<PackageLicenseFile>LICENSE.TXT</PackageLicenseFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://dot.net</PackageProjectUrl>
<Authors>Microsoft</Authors>
<NugetLicenseFile>$(RepoRoot)$(PackageLicenseFile)</NugetLicenseFile>
......
......@@ -7,9 +7,9 @@
</PropertyGroup>
<PropertyGroup>
<PackageLicenseFile>$(ProjectDir)LICENSE.TXT</PackageLicenseFile>
<PackageThirdPartyNoticesFile>$(ProjectDir)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<LicenseUrl>https://github.com/dotnet/core-setup/blob/master/LICENSE.TXT</LicenseUrl>
<PackageLicenseFile>$(RepoRoot)LICENSE</PackageLicenseFile>
<PackageThirdPartyNoticesFile>$(RepoRoot)THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<LicenseUrl>https://github.com/dotnet/core-setup/blob/master/LICENSE</LicenseUrl>
<PackageDescriptionFile>$(ProjectDir)src/pkg/projects/descriptions.json</PackageDescriptionFile>
<!-- This link should be updated for each release milestone, currently this points to 1.0.0 -->
<ReleaseNotes>https://go.microsoft.com/fwlink/?LinkID=799417</ReleaseNotes>
......
......@@ -51,19 +51,19 @@
</Target>
<Target Name="EnsureSignedBinaries" Condition="'$(OSGroup)' == 'Windows_NT'" >
<MSBuild Projects="$(RepoRoot)signing\SignBinaries.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignBinaries.proj" Targets="Build" />
</Target>
<Target Name="EnsureSignedMsiFiles" Condition="'$(OSGroup)' == 'Windows_NT'" >
<MSBuild Projects="$(RepoRoot)signing\SignMsiFiles.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignMsiFiles.proj" Targets="Build" />
</Target>
<Target Name="EnsureSignedBurnEngineFiles" Condition="'$(OSGroup)' == 'Windows_NT'" >
<MSBuild Projects="$(RepoRoot)signing\SignBurnEngineFiles.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignBurnEngineFiles.proj" Targets="Build" />
</Target>
<Target Name="EnsureSignedBurnBundleFiles" Condition="'$(OSGroup)' == 'Windows_NT'" >
<MSBuild Projects="$(RepoRoot)signing\SignBurnBundleFiles.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignBurnBundleFiles.proj" Targets="Build" />
</Target>
<Target Name="GenerateProjectInstallers" Condition="'$(GenerateProjectInstallers)' == 'true'">
......@@ -89,10 +89,10 @@
<Copy SourceFiles="$(SharedFrameworkPublishDir)dotnet$(ExeSuffix)"
DestinationFolder="$(SharedHostPublishRoot)" />
<Copy SourceFiles="$(ProjectDir)THIRD-PARTY-NOTICES.TXT"
<Copy SourceFiles="$(RepoRoot)THIRD-PARTY-NOTICES.TXT"
DestinationFiles="$(SharedHostPublishRoot)ThirdPartyNotices.txt" />
<Copy SourceFiles="$(ProjectDir)LICENSE.TXT"
<Copy SourceFiles="$(RepoRoot)LICENSE"
DestinationFiles="$(SharedHostPublishRoot)LICENSE.txt"
Condition="'$(TargetsUnix)' == 'true'"/>
......
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFramework>$(NETCoreAppFramework)</TargetFramework>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<!--
Ensure managed binaries are signed (if necessary) then call the Pack target on them. These
packages are used in other parts of the build, so this can't wait for Arcade's Pack stage.
-->
<Target Name="Build">
<MSBuild Projects="$(RepoRoot)signing\SignBinaries.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignBinaries.proj" Targets="Build" />
<ItemGroup>
<ManagedProject Include="$(RepoRoot)src\managed\**\*.csproj" />
<ManagedProject Include="$(SetupRoot)src\managed\**\*.csproj" />
</ItemGroup>
<MSBuild Projects="@(ManagedProject)" Targets="Pack" />
</Target>
<Target Name="Test" />
</Project>
......@@ -12,7 +12,7 @@
insertion NuGet packages on each project. Bundle installers aren't inserted, so this is enough.
-->
<Target Name="Build" DependsOnTargets="GetSharedFrameworkProjects">
<MSBuild Projects="$(RepoRoot)signing\SignMsiFiles.proj" Targets="Build" />
<MSBuild Projects="$(SetupRoot)signing\SignMsiFiles.proj" Targets="Build" />
<MSBuild Projects="@(PkgprojProjectToBuild);@(SharedFrameworkProject)" Targets="GenerateVSInsertionNupkg" />
</Target>
......
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
<PropertyGroup>
<SigningToolsDir>$(SetupRoot)signing\</SigningToolsDir>
<LicenseFile>$(RepoRoot)LICENSE</LicenseFile>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk" />
<PropertyGroup>
......@@ -58,7 +63,7 @@
<!-- Pkgproj requires its depproj crossgen outputs to be signed.-->
<OrderProjectReference
Condition="'$(MSBuildProjectExtension)' == '.pkgproj'"
Include="$(RepoRoot)signing\SignBinaries.proj" />
Include="$(SetupRoot)signing\SignBinaries.proj" />
</ItemGroup>
<!-- In *.builds projects, the current phase's name is the same as the project name. -->
......
......@@ -26,14 +26,14 @@
<Copy SourceFiles="$(DotNetHostBinDir)/dotnet$(ApplicationFileExtension)"
DestinationFolder="$(PublishRootDir)" />
<Copy SourceFiles="$(ProjectDir)THIRD-PARTY-NOTICES.TXT"
<Copy SourceFiles="$(RepoRoot)THIRD-PARTY-NOTICES.TXT"
DestinationFiles="$(PublishRootDir)ThirdPartyNotices.txt" />
<Copy SourceFiles="$(ProjectDir)LICENSE.TXT"
<Copy SourceFiles="$(RepoRoot)LICENSE"
DestinationFiles="$(PublishRootDir)LICENSE.txt"
Condition="'$(TargetsUnix)' == 'true'"/>
<Copy SourceFiles="$(ProjectDir)resources/LICENSE-MSFT.txt"
<Copy SourceFiles="$(SetupRoot)resources/LICENSE-MSFT.txt"
DestinationFiles="$(PublishRootDir)LICENSE.txt"
Condition="'$(TargetsUnix)' != 'true'"/>
......
......@@ -5,7 +5,7 @@
Condition="'$(SkipSigning)' != 'true' and '$(SignType)' != 'public'">
<Message Importance="High" Text="Signing final packages" />
<MSBuild
Projects="$(RepoRoot)signing\SignFinalPackages.proj"
Projects="$(SetupRoot)signing\SignFinalPackages.proj"
Targets="Build"
Properties="DownloadDirectory=$(DownloadDirectory)" />
</Target>
......
......@@ -58,7 +58,7 @@
</ItemGroup>
<PropertyGroup>
<TemplateNuGetConfigFile>$(ProjectDir)NuGet.config</TemplateNuGetConfigFile>
<TemplateNuGetConfigFile>$(RepoRoot)NuGet.config</TemplateNuGetConfigFile>
<RestoreTestSourceConfigLines>@(RestoreTestSource -> '&lt;add key="%(Key)" value="%(Identity)" /&gt;', '%0A ')</RestoreTestSourceConfigLines>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册