--- /dev/null
+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.
: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
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
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.
:: 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=
<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>
<!--
<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>
<!--
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"
[[ "$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=
__configuration=Debug
__linkPortable=0
__cmake_defines=
-__baseIntermediateOutputPath="$RootRepo/artifacts/obj"
-__versionSourceFile="$__baseIntermediateOutputPath/_version.c"
__cmake_bin_prefix=
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"
# 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
<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>
</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>
</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'"/>
<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>
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>
<!-- 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. -->
<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'"/>
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>
</ItemGroup>
<PropertyGroup>
- <TemplateNuGetConfigFile>$(ProjectDir)NuGet.config</TemplateNuGetConfigFile>
+ <TemplateNuGetConfigFile>$(RepoRoot)NuGet.config</TemplateNuGetConfigFile>
<RestoreTestSourceConfigLines>@(RestoreTestSource -> '<add key="%(Key)" value="%(Identity)" />', '%0A ')</RestoreTestSourceConfigLines>