Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf2491bd

Browse files
authored
Build proto using dotnet cli (#3232)
* Add dotnetcli20* Update dotnet cli* Build proto using dotnet cli as lkg* Remove lkg
1 parent82c9492 commitf2491bd

File tree

11 files changed

+466
-348
lines changed

11 files changed

+466
-348
lines changed

‎DotnetCLIToolsVersion.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.0.0-preview2-006494

‎build.cmd‎

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,6 @@ goto :eof
493493
:havemsbuild
494494
set_nrswitch=/nr:false
495495

496-
rem uncomment to use coreclr msbuild not ready yet!!!!
497-
rem set _msbuildexe=%~dp0Tools\CoreRun.exe %~dp0Tools\MSBuild.exe
498-
rem set _nrswitch=
499-
500496
:: See <http://www.appveyor.com/docs/environment-variables>
501497
ifdefined APPVEYOR (
502498
rem See<http://www.appveyor.com/docs/build-phase>
@@ -543,7 +539,8 @@ if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" (
543539
call%~dp0init-tools.cmd
544540
)
545541

546-
set_dotnetexe=%~dp0Tools\dotnetcli\dotnet.exe
542+
set_dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe
543+
set_dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe
547544
setNUGET_PACKAGES=%~dp0Packages
548545

549546
set_fsiexe="packages\FSharp.Compiler.Tools.4.1.5\tools\fsi.exe"
@@ -569,19 +566,9 @@ if "%BUILD_PROTO%" == "1" (
569566

570567
if"%BUILD_PROTO_WITH_CORECLR_LKG%"=="1" (
571568

572-
pushd .\lkg\fsc&%_dotnetexe% restore&popd&ifERRORLEVEL1echo Error:%errorlevel% dotnet restore failed&goto :failure
573-
pushd .\lkg\fsi&%_dotnetexe% restore&popd&ifERRORLEVEL1echo Error:%errorlevel% dotnet restore failed&goto :failure
574-
pushd .\lkg\fsc&%_dotnetexe% publish project.json --no-build -o%~dp0Tools\lkg -r!_architecture!&popd&ifERRORLEVEL1echo Error: dotnet publish failed&goto :failure
575-
pushd .\lkg\fsi&%_dotnetexe% publish project.json --no-build -o%~dp0Tools\lkg -r!_architecture!&popd&ifERRORLEVEL1echo Error: dotnet publish failed&goto :failure
576-
577569
echo%_msbuildexe%%msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto
578570
%_msbuildexe%%msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto
579571
@if ERRORLEVEL1echo Error: compiler proto build failed&&goto :failure
580-
581-
echo%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
582-
%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
583-
@if ERRORLEVEL1echo Error: NGen of proto failed&&goto :failure
584-
585572
)
586573

587574
if"%BUILD_PROTO_WITH_CORECLR_LKG%"=="0" (
@@ -592,12 +579,11 @@ if "%BUILD_PROTO%" == "1" (
592579
echo%_msbuildexe%%msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto
593580
%_msbuildexe%%msbuildflags% src\fsharp-proto-build.proj /p:BUILD_PROTO_WITH_CORECLR_LKG=%BUILD_PROTO_WITH_CORECLR_LKG% /p:Configuration=Proto
594581
@if ERRORLEVEL1echo Error: compiler proto build failed&&goto :failure
595-
596-
echo%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
597-
%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
598-
@if ERRORLEVEL1echo Error: NGen of proto failed&&goto :failure
599-
600582
)
583+
584+
echo%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
585+
%_ngenexe% install Proto\net40\bin\fsc-proto.exe /nologo
586+
@if ERRORLEVEL1echo Error: NGen of proto failed&&goto :failure
601587
)
602588

603589
echo ---------------- Done with proto, starting build ------------------------
@@ -829,8 +815,8 @@ if "%TEST_CORECLR_COREUNIT_SUITE%" == "1" (
829815
setOUTPUTFILE=!RESULTSDIR!\test-coreclr-coreunit-output.log
830816
setERRORFILE=!RESULTSDIR!\test-coreclr-coreunit-errors.log
831817

832-
echo"%_dotnetexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
833-
"%_dotnetexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
818+
echo"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
819+
"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
834820

835821
ifERRORLEVEL1 (
836822
echo -----------------------------------------------------------------
@@ -852,8 +838,8 @@ if "%TEST_CORECLR_FSHARP_SUITE%" == "1" (
852838
setOUTPUTFILE=
853839
setERRORFILE=
854840
setXMLFILE=!RESULTSDIR!\test-coreclr-fsharp-results.xml
855-
echo"%_dotnetexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
856-
"%_dotnetexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Tests.FSharpSuite.DrivingCoreCLR\FSharp.Tests.FSharpSuite.DrivingCoreCLR.dll"!WHERE_ARG_NUNIT!
841+
echo"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Core.Unittests\FSharp.Core.Unittests.dll"!WHERE_ARG_NUNIT!
842+
"%_dotnetcliexe%""%~dp0tests\testbin\!BUILD_CONFIG!\coreclr\FSharp.Tests.FSharpSuite.DrivingCoreCLR\FSharp.Tests.FSharpSuite.DrivingCoreCLR.dll"!WHERE_ARG_NUNIT!
857843

858844
iferrorlevel1 (
859845
echo -----------------------------------------------------------------

‎init-tools.cmd‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ setlocal
44
setINIT_TOOLS_LOG=%~dp0init-tools.log
55
setPACKAGES_DIR=%~dp0packages\
66
setTOOLRUNTIME_DIR=%~dp0Tools
7+
78
setDOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
89
setDOTNET_CMD=%DOTNET_PATH%dotnet.exe
10+
11+
setDOTNET_TOOLS_PATH=%TOOLRUNTIME_DIR%\dotnet20\
12+
setDOTNET_TOOLS_CMD=%DOTNET_TOOLS_PATH%dotnet.exe
13+
914
if [%BUILDTOOLS_SOURCE%]==[]setBUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
1015
set /PBUILDTOOLS_VERSION=<"%~dp0BuildToolsVersion.txt"
1116
setBUILD_TOOLS_PATH=%PACKAGES_DIR%microsoft.dotnet.buildtools\%BUILDTOOLS_VERSION%\lib\
@@ -39,13 +44,29 @@ if NOT exist "%PROJECT_JSON_PATH%" mkdir "%PROJECT_JSON_PATH%"
3944
echo%PROJECT_JSON_CONTENTS%>"%PROJECT_JSON_FILE%"
4045
echo Running%0>"%INIT_TOOLS_LOG%"
4146

47+
set /pDOTNET_TOOLS_VERSION=<"%~dp0DotnetCLIToolsVersion.txt"
48+
ifexist"%DOTNET_TOOLS_PATH%"goto :afterdotnettoolsrestore
49+
50+
echo Installing dotnet OLD VERSION OF THE cli...
51+
echo ==========================================
52+
echo This is temporary until we build using the new dotnetcli
53+
echo The dotnet cli is a large file it may take a few minutes ...
54+
echo powershell -ExecutionPolicy unrestricted -NoProfile -Command".\scripts\dotnet-install.ps1 -InstallDir%DOTNET_TOOLS_PATH% -Architecture x64 -Version%DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;"
55+
powershell -ExecutionPolicy unrestricted -NoProfile -Command".\scripts\dotnet-install.ps1 -InstallDir%DOTNET_TOOLS_PATH% -Architecture x64 -Version%DOTNET_TOOLS_VERSION% -NoPath true; exit $LastExitCode;"
56+
iferrorlevel1 (
57+
echo ERROR: Could not install dotnet cli correctly.
58+
setTOOLS_INIT_RETURN_CODE=1
59+
goto :DONE
60+
)
61+
:afterdotnettoolsrestore
62+
4263
set /pDOTNET_VERSION=<"%~dp0DotnetCLIVersion.txt"
4364
ifexist"%DOTNET_CMD%"goto :afterdotnetrestore
4465

4566
echo Installing dotnet cli...
4667
echo The dotnet cli is a large file it may take a few minutes ...
47-
echo powershell -ExecutionPolicy unrestricted -NoProfile -Command".\dotnet-install.ps1 -InstallDir%DOTNET_PATH% -Architecture x64 -Version%DOTNET_VERSION% -NoPath true; exit $LastExitCode;"
48-
powershell -ExecutionPolicy unrestricted -NoProfile -Command".\dotnet-install.ps1 -InstallDir%DOTNET_PATH% -Architecture x64 -Version%DOTNET_VERSION% -NoPath true; exit $LastExitCode;"
68+
echo powershell -ExecutionPolicy unrestricted -NoProfile -Command".\scripts\dotnet-install.ps1 -InstallDir%DOTNET_PATH% -Architecture x64 -Version%DOTNET_VERSION% -NoPath true; exit $LastExitCode;"
69+
powershell -ExecutionPolicy unrestricted -NoProfile -Command".\scripts\dotnet-install.ps1 -InstallDir%DOTNET_PATH% -Architecture x64 -Version%DOTNET_VERSION% -NoPath true; exit $LastExitCode;"
4970
iferrorlevel1 (
5071
echo ERROR: Could not install dotnet cli correctly.
5172
setTOOLS_INIT_RETURN_CODE=1
@@ -70,7 +91,7 @@ echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRU
7091
call"%BUILD_TOOLS_PATH%init-tools.cmd""%~dp0""%DOTNET_CMD%""%TOOLRUNTIME_DIR%">>"%INIT_TOOLS_LOG%"
7192

7293
echo Updating CLI NuGet Frameworks map...
73-
robocopy"%TOOLRUNTIME_DIR%""%TOOLRUNTIME_DIR%\dotnetcli\sdk\%DOTNET_VERSION%" NuGet.Frameworks.dll /XO>>"%INIT_TOOLS_LOG%"
94+
robocopy"%TOOLRUNTIME_DIR%""%DOTNET_PATH%\sdk\%DOTNET_VERSION%" NuGet.Frameworks.dll /XO>>"%INIT_TOOLS_LOG%"
7495
setUPDATE_CLI_ERRORLEVEL=%ERRORLEVEL%
7596
if%UPDATE_CLI_ERRORLEVEL%GTR1 (
7697
echo ERROR: Failed to update Nuget for CLI {Error level%UPDATE_CLI_ERRORLEVEL%}. Please check '%INIT_TOOLS_LOG%' for more details.1>&2

‎init-tools.sh‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ __scriptpath=$(cd "$(dirname "$0")"; pwd -P)
44
__init_tools_log=$__scriptpath/init-tools.log
55
__PACKAGES_DIR=$__scriptpath/packages
66
__TOOLRUNTIME_DIR=$__scriptpath/Tools
7+
78
__DOTNET_PATH=$__TOOLRUNTIME_DIR/dotnetcli
89
__DOTNET_CMD=$__DOTNET_PATH/dotnet
10+
__DOTNET_VERSION=$(cat$__scriptpath/DotnetCLIVersion.txt)
11+
912
if [-z"$__BUILDTOOLS_SOURCE" ];then __BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json;fi
1013
__BUILD_TOOLS_PACKAGE_VERSION=$(cat$__scriptpath/BuildToolsVersion.txt)
11-
__DOTNET_TOOLS_VERSION=$(cat$__scriptpath/DotnetCLIVersion.txt)
14+
15+
1216
__BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
1317
__PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION
1418
__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json
@@ -99,32 +103,35 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
99103

100104
mkdir -p"$__DOTNET_PATH"
101105

102-
if [-n"$DOTNET_TOOLSET_DIR" ]&& [-d"$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION" ];then
103-
echo"Copying$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION to$__DOTNET_PATH">>$__init_tools_log
104-
cp -r$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION/*$__DOTNET_PATH
106+
if [-n"$DOTNET_TOOLSET_DIR" ]&& [-d"$DOTNET_TOOLSET_DIR/$__DOTNET_VERSION" ];then
107+
echo"Copying$DOTNET_TOOLSET_DIR/$__DOTNET_VERSION to$__DOTNET_PATH">>$__init_tools_log
108+
cp -r$DOTNET_TOOLSET_DIR/$__DOTNET_VERSION/*$__DOTNET_PATH
105109
elif [-n"$DOTNET_TOOL_DIR" ]&& [-d"$DOTNET_TOOL_DIR" ];then
106110
echo"Copying$DOTNET_TOOL_DIR to$__DOTNET_PATH">>$__init_tools_log
107111
cp -r$DOTNET_TOOL_DIR/*$__DOTNET_PATH
108112
else
109113
echo"Installing dotnet cli..."
110-
__DOTNET_LOCATION="https://dotnetcli.blob.core.windows.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
111-
# curl has HTTPS CA trust-issues less often than wget, so lets try that first.
112-
echo"Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'">>$__init_tools_log
113-
which curl> /dev/null2> /dev/null
114-
if [$?-ne 0 ];then
115-
wget -q -O$__DOTNET_PATH/dotnet.tar${__DOTNET_LOCATION}
116-
else
117-
curl --retry 10 -sSL --create-dirs -o$__DOTNET_PATH/dotnet.tar${__DOTNET_LOCATION}
118-
fi
119-
cd$__DOTNET_PATH
120-
tar -xf$__DOTNET_PATH/dotnet.tar
121-
122-
cd$__scriptpath
123-
124-
__PATCH_CLI_NUGET_FRAMEWORKS=1
114+
echo"The dotnet cli is a large file it may take a few minutes ..."
115+
./scripts/dotnet-install.sh --install-dir"$__DOTNET_PATH" --architecture"x64" --runtime-id"linux-x64" --version"$__DOTNET_VERSION"
125116
fi
126117
fi
127118

119+
if [!-e$__DOTNET_TOOLS_PATH ];then
120+
121+
mkdir -p"$__DOTNET_PATH"
122+
123+
if [-n"$DOTNET_TOOLSET_DIR" ]&& [-d"$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION" ];then
124+
echo"Copying$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION to$__DOTNET_TOOLS_PATH">>$__init_tools_log
125+
cp -r$DOTNET_TOOLSET_DIR/$__DOTNET_VERSION/*$__DOTNET_PATH
126+
elif [-n"$DOTNET_TOOL_DIR" ]&& [-d"$DOTNET_TOOL_DIR" ];then
127+
echo"Copying$DOTNET_TOOL_DIR to$__DOTNET_TOOLS_PATH">>$__init_tools_log
128+
cp -r$DOTNET_TOOL_DIR/*$__DOTNET_PATH
129+
else
130+
echo"Installing dotnet cli..."
131+
echo"The dotnet cli is a large file it may take a few minutes ..."
132+
./scripts/dotnet-install.sh --channel"release/2.0.0" --install-dir"$__DOTNET_PATH" --architecture"x64" --runtime-id"linux-x64" --version"$__DOTNET_VERSION"
133+
fi
134+
fi
128135

129136
if [-n"$BUILD_TOOLS_TOOLSET_DIR" ]&& [-d"$BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION" ];then
130137
echo"Copying$BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION to$__TOOLRUNTIME_DIR">>$__init_tools_log
@@ -154,7 +161,7 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
154161

155162
if [$__PATCH_CLI_NUGET_FRAMEWORKS-eq 1 ];then
156163
echo"Updating CLI NuGet Frameworks map..."
157-
cp$__TOOLRUNTIME_DIR/NuGet.Frameworks.dll$__TOOLRUNTIME_DIR/dotnetcli/sdk/$__DOTNET_TOOLS_VERSION>>$__init_tools_log
164+
cp$__TOOLRUNTIME_DIR/NuGet.Frameworks.dll$__TOOLRUNTIME_DIR/dotnetcli/sdk/$__DOTNET_VERSION>>$__init_tools_log
158165
if ["$?"!="0" ];then
159166
echo"ERROR: An error occured when updating Nuget for CLI . Please check '$__init_tools_log' for more details."1>&2
160167
exit 1

‎lkg/cg.bat‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎lkg/fsc/project.json‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎lkg/fsi/project.json‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎lkg/sentinel‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp