Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit c01c211

Browse files
author
N. Taylor Mullen
committed
Update nuget.exe and corresponding feeds to v3.
1 parent 30a8c5b commit c01c211

3 files changed

Lines changed: 25 additions & 12 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetlitedev/api/v2" />
4+
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetcidev/api/v3/index.json" />
55
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
66
</packageSources>
77
</configuration>

build.cmd

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
cd %~dp0
33

44
SETLOCAL
5-
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
5+
SET NUGET_VERSION=latest
6+
SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe
7+
SET BUILDCMD_KOREBUILD_VERSION=""
8+
SET BUILDCMD_DNX_VERSION=""
69

710
IF EXIST %CACHED_NUGET% goto copynuget
811
echo Downloading latest version of NuGet.exe...
912
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
10-
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
13+
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'"
1114

1215
:copynuget
1316
IF EXIST .nuget\nuget.exe goto restore
@@ -16,13 +19,21 @@ copy %CACHED_NUGET% .nuget\nuget.exe > nul
1619

1720
:restore
1821
IF EXIST packages\KoreBuild goto run
19-
.nuget\NuGet.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
20-
.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
22+
IF %BUILDCMD_KOREBUILD_VERSION%=="" (
23+
.nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
24+
) ELSE (
25+
.nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre
26+
)
27+
.nuget\nuget.exe install Sake -ExcludeVersion -Out packages
2128

2229
IF "%SKIP_DNX_INSTALL%"=="1" goto run
23-
CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
30+
IF %BUILDCMD_DNX_VERSION%=="" (
31+
CALL packages\KoreBuild\build\dnvm upgrade -runtime CLR -arch x86
32+
) ELSE (
33+
CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CLR -arch x86 -a default
34+
)
2435
CALL packages\KoreBuild\build\dnvm install default -runtime CoreCLR -arch x86
2536

2637
:run
2738
CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86
28-
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*
39+
packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*

build.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,23 @@ else
1010
fi
1111
fi
1212
mkdir -p $cachedir
13+
nugetVersion=latest
14+
cachePath=$cachedir/nuget.$nugetVersion.exe
1315

14-
url=https://www.nuget.org/nuget.exe
16+
url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe
1517

16-
if test ! -f $cachedir/nuget.exe; then
17-
wget -O $cachedir/nuget.exe $url 2>/dev/null || curl -o $cachedir/nuget.exe --location $url /dev/null
18+
if test ! -f $cachePath; then
19+
wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null
1820
fi
1921

2022
if test ! -e .nuget; then
2123
mkdir .nuget
22-
cp $cachedir/nuget.exe .nuget/nuget.exe
24+
cp $cachePath .nuget/nuget.exe
2325
fi
2426

2527
if test ! -d packages/KoreBuild; then
2628
mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre
27-
mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages
29+
mono .nuget/nuget.exe install Sake -ExcludeVersion -Out packages
2830
fi
2931

3032
if ! type dnvm > /dev/null 2>&1; then

0 commit comments

Comments
 (0)