Changes to prepare for consolidation (dotnet/core-setup#8593)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Fri, 18 Oct 2019 22:21:23 +0000 (15:21 -0700)
committerGitHub <noreply@github.com>
Fri, 18 Oct 2019 22:21:23 +0000 (15:21 -0700)
* 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: Davis Goodin <dagood@users.noreply.github.com>
Commit migrated from https://github.com/dotnet/core-setup/commit/96ec25abe981ac689e260efe946db419b157f5f1

13 files changed:
src/installer/LICENSE [new file with mode: 0644]
src/installer/corehost/build.cmd
src/installer/corehost/build.proj
src/installer/corehost/build.sh
src/installer/managed/CommonManaged.props
src/installer/pkg/Directory.Build.props
src/installer/pkg/packaging/installers.proj
src/installer/pkg/packaging/pack-managed.proj
src/installer/pkg/packaging/vs-insertion-packages.proj
src/installer/pkg/projects/Directory.Build.props
src/installer/pkg/projects/Microsoft.NETCore.DotNetHost/Microsoft.NETCore.DotNetHost.pkgproj
src/installer/publish/prepare-artifacts.proj
src/installer/test/PrepareTestAssets/PrepareTestAssets.proj

diff --git a/src/installer/LICENSE b/src/installer/LICENSE
new file mode 100644 (file)
index 0000000..984713a
--- /dev/null
@@ -0,0 +1,23 @@
+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.
index 7983568..b22f254 100644 (file)
@@ -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=
 
index 78a7f20..a666f70 100644 (file)
@@ -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>
 
     <!--
index 05c6d79..79fcf5b 100755 (executable)
@@ -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
 
index 5195cc2..81c9099 100644 (file)
@@ -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>
index 0eb250a..909afc6 100644 (file)
@@ -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>
index 2f50326..a8b7a2b 100644 (file)
   </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'">
     <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'"/>
 
index 7c7c791..3b19cdf 100644 (file)
@@ -1,19 +1,24 @@
 <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>
index 86af084..657e560 100644 (file)
@@ -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>
 
index ce3b150..d67f23b 100644 (file)
@@ -1,6 +1,11 @@
 <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. -->
index d4c5824..4d58474 100644 (file)
     <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'"/>
 
index 4d66ad7..219866c 100644 (file)
@@ -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>
index c4aa79d..caaa386 100644 (file)
@@ -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>