Skip to content

Commit

Permalink
Initial migration to .NET Core 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocav committed Oct 11, 2017
1 parent c4625e1 commit 910d301
Show file tree
Hide file tree
Showing 288 changed files with 3,978 additions and 11,174 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ bin
obj
csx
.vs
.vscode
.DS_Store
edge
Publish

Expand Down
1 change: 0 additions & 1 deletion .nuget/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.SkipStrongNames" version="1.0.0" />
<package id="xunit.MSBuild" version="2.0.0" />
</packages>
9 changes: 9 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="azure_app_service" value="https://www.myget.org/F/azure-appservice/api/v2" />
<add key="buildTools" value="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
<add key="AspNetVNext" value="https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json" />
</packageSources>
</configuration>
366 changes: 0 additions & 366 deletions WebJobs.Script.proj

This file was deleted.

140 changes: 61 additions & 79 deletions WebJobs.Script.sln

Large diffs are not rendered by default.

62 changes: 43 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,62 @@
version: 1.0.{build}
version: 2.0.{build}
pull_requests:
do_not_increment_build_number: true
branches:
only:
- dev
- master
- fsharp
- next
- core
max_jobs: 1
image: Visual Studio 2017
clone_folder: c:\projects\azure-webjobs-sdk-script
init:
- ps: $env:Path = "c:\tools\php;c:\python35;C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0;" + $env:Path;
clone_folder: c:\azure-webjobs-sdk-script
install:
- ps: >-
# Download .NET Core 2.0 SDK and add to PATH
$urlCurrent = "https://download.microsoft.com/download/1/B/4/1B4DE605-8378-47A5-B01B-2C79D6C55519/dotnet-sdk-2.0.0-win-x64.zip"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true"
$env:DOTNET_CLI_TELEMETRY_OPTOUT = "true"
$env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
$tempFileCurrent = [System.IO.Path]::GetTempFileName()
(New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
$env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
$env:CommitHash = "$env:APPVEYOR_REPO_COMMIT"
mkdir c:\tools\php | out-null
Invoke-WebRequest https://azfunc.blob.core.windows.net/public/php-7.1.3-Win32-VC14-x86.zip -OutFile c:\tools\php\php.zip
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("c:\tools\php\php.zip", "c:\tools\php")
Install-Product node 6.11.2 x86
Install-Product node 6.5.0 x86
cache: '%USERPROFILE%\.nuget\packages'
build_script:
- cmd: msbuild "WebJobs.Script.proj" /target:EnableSkipStrongNames;PackageScriptHost;PackageWebHost;TestBuild /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /property:Buildnumber=%APPVEYOR_BUILD_NUMBER%;Configuration=Release
- ps: >
dotnet --version
dotnet build .\WebJobs.Script.sln -v q
dotnet pack src\WebJobs.Script\WebJobs.Script.csproj -o ..\..\buildoutput --no-build --version-suffix "-$env:APPVEYOR_BUILD_NUMBER"
dotnet pack src\WebJobs.Script.WebHost\WebJobs.Script.WebHost.csproj -o ..\..\buildoutput --no-build --version-suffix "-$env:APPVEYOR_BUILD_NUMBER"
test_script:
- cmd: runappveyortests.cmd
- ps: >-
# dotnet test .\test\WebJobs.Script.Scaling.Tests\ -v q --no-build -p:ParallelizeTestCollections=false
# dotnet test .\test\WebJobs.Script.Tests\ -v q --no-build -p:ParallelizeTestCollections=false
# Skipping integration tests for initial build
# dotnet test .\test\WebJobs.Script.Tests.Integration\ -v q --no-build
artifacts:
- path: bin\Packages\*.zip
name: Runtime
- path: bin\Packages\*.nupkg
name: NuGet
hosts:
api.nuget.org: 93.184.221.200
dist.nuget.org: 93.184.221.200
- path: buildoutput\*.nupkg
name: Binaries
23 changes: 23 additions & 0 deletions build/common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>2.0.0-beta1$(VersionSuffix)</Version>
<CommitHash Condition="$(CommitHash) == ''">N/A</CommitHash>
<InformationalVersion>$(Version) Commit hash: $(CommitHash)</InformationalVersion>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<Product>Azure WebJobs SDK Script Runtime</Product>
<PackageProjectUrl>http://go.microsoft.com/fwlink/?LinkID=320972</PackageProjectUrl>
<RepositoryUrl>https://github.com/Azure/azure-webjobs-sdk-script</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<Copyright>© .NET Foundation. All rights reserved.</Copyright>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>http://www.microsoft.com/web/webpi/eula/aspnetcomponent_rtw_enu.htm</PackageLicenseUrl>
<PackageIconUrl>https://raw.githubusercontent.com/Azure/azure-webjobs-sdk/dev/webjobs.png</PackageIconUrl>
<CodeAnalysisRuleSet>$(SolutionDir)\src\src.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(SolutionDir)\stylecop.json" Link="stylecop.json" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions sample/BlobTrigger-CSharp/run.csx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

using Microsoft.WindowsAzure.Storage.Blob;

public static void Run(CloudBlockBlob blob, CloudBlockBlob output, TraceWriter log)
public static async Task Run(CloudBlockBlob blob, CloudBlockBlob output, TraceWriter log)
{
string content = blob.DownloadText();
string content = await blob.DownloadTextAsync();
log.Info($"C# Blob trigger function processed a blob. Blob={content}");

output.UploadText(content);
await output.UploadTextAsync(content);
}
29 changes: 7 additions & 22 deletions sample/HttpTrigger-CSharp/run.csx
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
using System.Net;
using Microsoft.AspNetCore.Mvc;

public static Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
public static IActionResult Run(string req,TraceWriter log)
{
var queryParams = req.GetQueryNameValuePairs()
.ToDictionary(p => p.Key, p => p.Value, StringComparer.OrdinalIgnoreCase);
return new OkObjectResult(new Test { Name = "blah" });
}

log.Info(string.Format("C# HTTP trigger function processed a request. {0}", req.RequestUri));

HttpResponseMessage res = null;
if (queryParams.TryGetValue("name", out string name))
{
res = new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent("Hello " + name)
};
}
else
{
res = new HttpResponseMessage(HttpStatusCode.BadRequest)
{
Content = new StringContent("Please pass a name on the query string")
};
}

return Task.FromResult(res);
public class Test
{
public string Name { get; set; }
}
3 changes: 2 additions & 1 deletion sample/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"prefetchCount": 1000,
"batchCheckpointFrequency": 1
},
"functionTimeout": "00:05:00"
"functionTimeout": "00:05:00",
"functions": [ "BlobTrigger-CSharp", "HttpTrigger-CSharp" ]
}
74 changes: 0 additions & 74 deletions src/Packages/Packages.csproj

This file was deleted.

3 changes: 0 additions & 3 deletions src/Packages/app.config

This file was deleted.

5 changes: 0 additions & 5 deletions src/Packages/packages.config

This file was deleted.

26 changes: 0 additions & 26 deletions src/Packages/tools/install.ps1

This file was deleted.

3 changes: 0 additions & 3 deletions src/SiteExtension/extension.xml

This file was deleted.

4 changes: 0 additions & 4 deletions src/WebJobs.Script.Host/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.1" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
Expand Down
17 changes: 0 additions & 17 deletions src/WebJobs.Script.Host/Properties/AssemblyInfo.cs

This file was deleted.

Loading

0 comments on commit 910d301

Please sign in to comment.