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

Commit

Permalink
Merge pull request #68 from enricosada/rc3_cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
enricosada committed Feb 9, 2017
2 parents 7c5945c + 8857bdf commit 3d096f6
Show file tree
Hide file tree
Showing 154 changed files with 7,526 additions and 619 deletions.
File renamed without changes.
1 change: 0 additions & 1 deletion test-msbuild/NuGet.Config → NuGet.withDevFeed.Config
Expand Up @@ -3,6 +3,5 @@
<packageSources>
<clear />
<add key="nuget-org" value="https://api.nuget.org/v3/index.json" />
<add key="sdk-package" value="../src/FSharp.NET.Sdk/bin/Debug" />
</packageSources>
</configuration>
3 changes: 1 addition & 2 deletions build.cmd
@@ -1,5 +1,4 @@
@echo off

powershell -NoProfile -NoLogo -Command "%~dp0scripts\build.ps1 %*; exit $LastExitCode;"
powershell -NoProfile -NoLogo -Command "%~dp0\run-build.ps1 %*; exit $LastExitCode;"
if %errorlevel% neq 0 exit /b %errorlevel%

15 changes: 13 additions & 2 deletions build.proj
Expand Up @@ -24,9 +24,20 @@

<ExeExtension>.exe</ExeExtension>
<ExeExtension Condition=" '$(OS)' != 'Windows_NT' "></ExeExtension>

<NuGetPackageRoot>$(RepoRoot)/packages</NuGetPackageRoot>
<ArtifactsDir>$(RepoRoot)/artifacts</ArtifactsDir>
</PropertyGroup>

<Target DependsOnTargets="$(CLITargets)" Name="BuildTheWholeCli"></Target>
<PropertyGroup>
<FSharpNETSdkVersion>1.0.0-beta-060000</FSharpNETSdkVersion>
<FSharpSdkVersion>1.0.0-beta-060000</FSharpSdkVersion>
</PropertyGroup>

<Target Name="BuildTheWholeCli"
DependsOnTargets="$(CLITargets)" />

<Import Project="$(RepoRoot)/build/Build.targets" />
<Import Project="$(RepoRoot)/build/Test.targets" />

<Import Project="test-msbuild/run-tests.targets" />
</Project>
31 changes: 31 additions & 0 deletions build/Build.targets
@@ -0,0 +1,31 @@
<Project ToolsVersion="15.0">

<Target Name="Package"
DependsOnTargets="RestoreSrcPackages">

<Exec Command='dotnet pack --no-build --output "$(ArtifactsDir)/nupkgs" /p:Version=$(FSharpSdkVersion)'
WorkingDirectory="$(RepoRoot)/src/FSharp.Sdk"/>

<Exec Command='dotnet pack --no-build --output "$(ArtifactsDir)/nupkgs" /p:Version=$(FSharpNETSdkVersion)'
WorkingDirectory="$(RepoRoot)/src/FSharp.NET.Sdk"/>
</Target>

<Target Name="SetupRestoreSrcPackagesInputsOutputs">
<!-- List of test projects to restore -->

<ItemGroup>
<RestoreSrcPackagesInput Include="$(RepoRoot)/src/FSharp.NET.Sdk/FSharp.NET.Sdk.csproj" />
<RestoreSrcPackagesInput Include="$(RepoRoot)/src/FSharp.Sdk/FSharp.Sdk.csproj" />
</ItemGroup>
</Target>

<Target Name="RestoreSrcPackages"
DependsOnTargets="SetupRestoreSrcPackagesInputsOutputs"
Inputs="@(RestoreSrcPackagesInput)"
Outputs="@(RestoreSrcPackagesInput->'%(RelativeDir)/obj/project.assets.json');@(RestoreSrcPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props')">
<!-- Restore test projects, if needed (with lock files up-to-date check) -->

<Exec Command='dotnet restore "%(RestoreSrcPackagesInput.FullPath)" --packages "$(NuGetPackageRoot)" --no-cache -v n"' />
</Target>

</Project>
63 changes: 63 additions & 0 deletions build/Test.targets
@@ -0,0 +1,63 @@
<Project ToolsVersion="15.0">

<Target Name="Test"
DependsOnTargets="Package;RestoreTestPackages;PrepareTestSuite">

<PropertyGroup>
<_CommandText><![CDATA[
set TEST_SUITE_FSHARP_NET_SDK_PKG_VERSION=$(FSharpNETSdkVersionToTest)
dotnet test -c $(Configuration) --logger trx
]]></_CommandText>
</PropertyGroup>

<Exec Command="$(_CommandText)"
WorkingDirectory="$(RepoRoot)/test/dotnet-new.Tests" />

</Target>

<Target Name="PrepareTestSuite">
<!--Cleanup nuget cache, and move nupkg under test in 'packagesToTest' directory-->

<PropertyGroup>
<FSharpSdkVersionToTest>$(FSharpSdkVersion)</FSharpSdkVersionToTest>
<FSharpNETSdkVersionToTest>$(FSharpNETSdkVersion)</FSharpNETSdkVersionToTest>
</PropertyGroup>

<ItemGroup>
<_NupkgsToTest Include="$(ArtifactsDir)/nupkgs/FSharp.Sdk.$(FSharpSdkVersionToTest).nupkg" />
<_NupkgsToTest Include="$(ArtifactsDir)/nupkgs/FSharp.NET.Sdk.$(FSharpNETSdkVersionToTest).nupkg" />
</ItemGroup>

<!--Add nupkgs under test in 'packagesToTest' directory-->
<RemoveDir Directories="$(RepoRoot)/test/packagesToTest" />

<Copy SourceFiles="@(_NupkgsToTest)"
DestinationFolder="$(RepoRoot)/test/packagesToTest" />

<!--Remove nupkgs from test suite cache-->
<RemoveDir Directories="$(RepoRoot)/test/packages/fsharp.sdk" />
<RemoveDir Directories="$(RepoRoot)/test/packages/fsharp.net.sdk" />
<RemoveDir Directories="$(RepoRoot)/test/packages/dotnet-compile-fsc" />
</Target>

<Target Name="SetupRestoreTestPackagesInputsOutputs">
<!-- List of test projects to restore -->

<ItemGroup>
<RestoreTestPackagesInput Include="$(RepoRoot)/test/dotnet-new.Tests/dotnet-new.Tests.csproj" />
<RestoreTestPackagesInput Include="$(RepoRoot)/test/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj" />
<RestoreTestPackagesInput Include="$(RepoRoot)/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj" />
</ItemGroup>
</Target>

<Target Name="RestoreTestPackages"
DependsOnTargets="SetupRestoreTestPackagesInputsOutputs"
Inputs="@(RestoreTestPackagesInput)"
Outputs="@(RestoreTestPackagesInput->'%(RelativeDir)/obj/project.assets.json');@(RestoreTestPackagesInput->'%(RelativeDir)/obj/%(Filename).csproj.nuget.g.props')">
<!-- Restore test projects, if needed (with lock files up-to-date check) -->

<Exec Command='dotnet restore "%(RestoreTestPackagesInput.FullPath)" --packages "$(NuGetPackageRoot)" --no-cache -v n"' />
</Target>


</Project>
Expand Up @@ -4,5 +4,5 @@ open System

[<EntryPoint>]
let main argv =
printfn "Hello World from F#!"
printfn "Hello World!"
0 // return an integer exit code
27 changes: 27 additions & 0 deletions examples/preview2.1/console/project.json
@@ -0,0 +1,27 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Program.fs"
]
}
},
"tools": {
"dotnet-compile-fsc": "1.0.0-preview2.1-*"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
},
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160629"
}
}
}
}
File renamed without changes.
Expand Up @@ -5,25 +5,19 @@
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Helper2.fs",
"Helper.fs"
"Library.fs"
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*"
"tools": {
"dotnet-compile-fsc": "1.0.0-preview2.1-*"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
"NETStandard.Library": "1.6.1",
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160629"
}
}
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
}
}
}
34 changes: 12 additions & 22 deletions scripts/build.ps1 → run-build.ps1
Expand Up @@ -17,16 +17,18 @@ if($Help)
}

#make path absolute
$rootDir = Split-Path -parent (Split-Path -parent $PSCommandPath)
$RepoRoot = "$PSScriptRoot"

$sdkVersion = '1.0.0-rc3-004530'

function Install-DotnetSdk([string] $sdkVersion)
{
Write-Host "# Install .NET Core Sdk versione '$sdkVersion'" -foregroundcolor "magenta"
$sdkInstallScriptUrl = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview3/scripts/obtain/dotnet-install.ps1"
$sdkInstallScriptUrl = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-rc3/scripts/obtain/dotnet-install.ps1"
$sdkInstallScriptPath = ".dotnetsdk\dotnet_cli_install.ps1"
Write-Host "Downloading sdk install script '$sdkInstallScriptUrl' to '$sdkInstallScriptPath'"
New-Item "$rootDir\.dotnetsdk" -Type directory -ErrorAction Ignore
Invoke-WebRequest $sdkInstallScriptUrl -OutFile "$rootDir\$sdkInstallScriptPath"
New-Item "$RepoRoot\.dotnetsdk" -Type directory -ErrorAction Ignore
Invoke-WebRequest $sdkInstallScriptUrl -OutFile "$RepoRoot\$sdkInstallScriptPath"

Write-Host "Running sdk install script..."
./.dotnetsdk/dotnet_cli_install.ps1 -InstallDir ".dotnetsdk\sdk-$sdkVersion" -Channel "preview" -version $sdkVersion
Expand All @@ -45,28 +47,16 @@ function Run-Cmd

function Using-Sdk ([string] $sdkVersion)
{
$sdkPath = "$rootDir\.dotnetsdk\sdk-$sdkVersion"
$sdkPath = "$RepoRoot\.dotnetsdk\sdk-$sdkVersion"
Write-Host "# Using sdk '$sdkVersion'" -foregroundcolor "magenta"
$env:Path = "$sdkPath;$env:Path"
Run-Cmd "dotnet" "--version"
}

function Do-preview3
{
Install-DotnetSdk '1.0.0-preview3-004056'

Using-Sdk '1.0.0-preview3-004056'

dotnet msbuild build.proj /m /p:Architecture=$Architecture $ExtraParameters
if ($LASTEXITCODE -ne 0) { throw "Failed to build" }
}

# main
try {
Push-Location $PWD
Install-DotnetSdk $sdkVersion

Do-preview3
}
finally {
Pop-Location
}
Using-Sdk $sdkVersion

dotnet msbuild build.proj /m /v:diag /p:Architecture=$Architecture $ExtraParameters
if ($LASTEXITCODE -ne 0) { throw "Failed to build" }
6 changes: 3 additions & 3 deletions run-build.sh
Expand Up @@ -140,13 +140,13 @@ if [ ! -d ".dotnetsdk" ]; then
mkdir ".dotnetsdk"
fi

sdkInstallScriptUrl=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview3/scripts/obtain/dotnet-install.sh
sdkInstallScriptPath=$REPOROOT/.dotnetsdk/dotnet_cli_install.ps1
sdkInstallScriptUrl=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-rc3/scripts/obtain/dotnet-install.sh
sdkInstallScriptPath=$REPOROOT/.dotnetsdk/dotnet_cli_install.sh

download $sdkInstallScriptUrl $sdkInstallScriptPath
chmod u+x $sdkInstallScriptPath

sdkVersion=1.0.0-preview3-004056
sdkVersion=1.0.0-rc3-004530
sdkPath=$REPOROOT/.dotnetsdk/sdk-$sdkVersion

DOTNET_INSTALL_DIR=$sdkPath
Expand Down
4 changes: 4 additions & 0 deletions scripts/docker/centos/Dockerfile
Expand Up @@ -6,6 +6,10 @@
# Dockerfile that creates a container suitable to build dotnet-cli
FROM centos:7.1.1503

# Swap the "fakesystemd" package with the real "systemd" package, because fakesystemd conflicts with openssl-devel.
# The CentOS Docker image uses fakesystemd instead of systemd to reduce disk space.
RUN yum -q -y swap -- remove fakesystemd -- install systemd systemd-libs

RUN yum -q -y install deltarpm
RUN yum -q -y install epel-release
# RUN yum -y update
Expand Down
2 changes: 2 additions & 0 deletions scripts/dockerrun.sh
Expand Up @@ -132,5 +132,7 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
-e CHECKSUM_STORAGE_KEY \
-e CHECKSUM_STORAGE_ACCOUNT \
-e CHECKSUM_STORAGE_CONTAINER \
-e CLIBUILD_SKIP_TESTS \
-e CommitCount \
$DOTNET_BUILD_CONTAINER_TAG \
$BUILD_COMMAND "$@"

0 comments on commit 3d096f6

Please sign in to comment.