Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Cleanup workarounds (#233)
Browse files Browse the repository at this point in the history
- No longer download NuGet.exe. Fixes #214
- Don't generate global.json
- Add comments to template file. Fixes #222
  • Loading branch information
natemcmaster authored May 1, 2017
1 parent 2a3e285 commit d36635a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ PublishProfiles/
*.cache
*.docstates
_ReSharper.*
nuget.exe
*.exe
*.dll
*net45.csproj
*net451.csproj
*k10.csproj
Expand Down
13 changes: 0 additions & 13 deletions build/KoreBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ if (!($env:Path.Split(';') -icontains $dotnetLocalInstallFolder))
$env:Path = "$newPath"
}

# wokaround for CLI issue: https://github.com/dotnet/cli/issues/2143
$sharedPath = (Join-Path (Split-Path ((get-command dotnet.exe).Path) -Parent) "shared");
(Get-ChildItem $sharedPath -Recurse *dotnet.exe) | %{ $_.FullName } | Remove-Item;

# We still nuget because dotnet doesn't have support for pushing packages
$nugetExePath = Join-Path $PSScriptRoot 'nuget.exe'
if (!(Test-Path $nugetExePath))
{
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v4.0.0-rc4/NuGet.exe" -OutFile "$PSScriptRoot/nuget.exe"
}

$makeFileProj = "$PSScriptRoot/KoreBuild.proj"
$msbuildArtifactsDir = "$repoFolder/artifacts/msbuild"
$msbuildLogFilePath = "$msbuildArtifactsDir/msbuild.log"
Expand Down Expand Up @@ -142,7 +131,5 @@ if (!(Test-Path $msbuildArtifactsDir))

$msBuildArguments | Out-File -Encoding ASCII -FilePath $msBuildResponseFile

# workaround https://github.com/dotnet/core-setup/issues/1664
"{ `"sdk`": { `"version`": `"$dotnetVersion`" } }" | Out-File "$repoFolder/global.json" -Encoding ascii
exec dotnet msbuild /nologo $preflightClpOption /t:Restore /p:PreflightRestore=true "$makeFileProj"
exec dotnet msbuild `@"$msBuildResponseFile"
17 changes: 0 additions & 17 deletions build/KoreBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,12 @@ else
fi
fi

# workaround for CLI issue: https://github.com/dotnet/cli/issues/2143
DOTNET_PATH=`which dotnet | head -n 1`
ROOT_PATH=`dirname $DOTNET_PATH`
FOUND=`find $ROOT_PATH/shared -name dotnet`
if [ ! -z "$FOUND" ]; then
echo $FOUND | xargs rm
fi

netfxversion='4.6.1'
if [ "$NUGET_PACKAGES" == "" ]; then
NUGET_PACKAGES="$HOME/.nuget/packages"
fi
export ReferenceAssemblyRoot=$NUGET_PACKAGES/netframeworkreferenceassemblies/$netfxversion/content

nugetPath="$scriptRoot/nuget.exe"
if [ ! -f $nugetPath ]; then
nugetUrl="https://dist.nuget.org/win-x86-commandline/v4.0.0-rc4/NuGet.exe"
wget -O $nugetPath $nugetUrl 2>/dev/null || curl -o $nugetPath --location $nugetUrl 2>/dev/null
fi

makeFileProj="$scriptRoot/KoreBuild.proj"
msbuildArtifactsDir="$repoFolder/artifacts/msbuild"
msbuildPreflightResponseFile="$msbuildArtifactsDir/msbuild.preflight.rsp"
Expand Down Expand Up @@ -181,9 +167,6 @@ $preflightClpOption
"$makeFileProj"
ENDMSBUILDPREFLIGHT

# workaround https://github.com/dotnet/core-setup/issues/1664
echo "{\"sdk\":{\"version\":\"$KOREBUILD_DOTNET_VERSION\"}}" > "$repoFolder/global.json"

__exec dotnet msbuild @"$msbuildPreflightResponseFile"

cat > $msbuildResponseFile <<ENDMSBUILDARGS
Expand Down
1 change: 1 addition & 0 deletions template/version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
<Project>
<PropertyGroup>
<!-- These values are just an example and not used in build. -->
<VersionPrefix>1.2.0</VersionPrefix>
<VersionSuffix>preview1</VersionSuffix>
</PropertyGroup>
Expand Down

0 comments on commit d36635a

Please sign in to comment.