Skip to content

Commit 1fdb96d

Browse files
authored
Merge pull request #682 from filipw/net7
Added support for net7.0
2 parents 2389f6d + 07af9cf commit 1fdb96d

File tree

14 files changed

+83
-154
lines changed

14 files changed

+83
-154
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Install .Net Core
12+
uses: actions/setup-dotnet@v2
13+
with:
14+
dotnet-version: |
15+
6.0.x
16+
7.0.x
17+
include-prerelease: true
18+
- name: Install dotnet-script
19+
run: dotnet tool install dotnet-script --global
20+
21+
- name: Run build script
22+
run: dotnet-script build/Build.csx
23+
24+
build-mac:
25+
runs-on: macos-latest
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Install .Net Core
30+
uses: actions/setup-dotnet@v2
31+
with:
32+
dotnet-version: |
33+
6.0.x
34+
7.0.x
35+
include-prerelease: true
36+
- name: Install dotnet-script
37+
run: dotnet tool install dotnet-script --global
38+
39+
- name: Run build script
40+
run: dotnet-script build/Build.csx
41+
42+
build-windows:
43+
runs-on: windows-latest
44+
45+
steps:
46+
- uses: actions/checkout@v3
47+
- name: Install .Net Core
48+
uses: actions/setup-dotnet@v2
49+
with:
50+
dotnet-version: |
51+
6.0.x
52+
7.0.x
53+
include-prerelease: true
54+
- name: Install dotnet-script
55+
run: dotnet tool install dotnet-script --global
56+
57+
- name: Run build script
58+
run: dotnet-script build/Build.csx
59+
env: # Or as an environment variable
60+
GITHUB_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
IS_SECURE_BUILDENVIRONMENT: ${{ secrets.IS_SECURE_BUILDENVIRONMENT }}
62+
NUGET_APIKEY: ${{ secrets.NUGET_APIKEY }}

azure-pipelines.yml

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

build/Build.csx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#load "Choco.csx"
55
#load "BuildContext.csx"
66

7-
using static ReleaseManagement;
7+
using System.Xml.Linq;
88
using static ChangeLog;
99
using static FileUtils;
10-
using System.Xml.Linq;
10+
using static ReleaseManagement;
1111

1212
[StepDescription("Runs all tests.")]
1313
Step test = () => RunTests();
@@ -35,7 +35,7 @@ await StepRunner.Execute(Args);
3535

3636
private void CreateGitHubReleaseAsset()
3737
{
38-
DotNet.Publish(dotnetScriptProjectFolder, publishArtifactsFolder, "netcoreapp3.1");
38+
DotNet.Publish(dotnetScriptProjectFolder, publishArtifactsFolder, "net6.0");
3939
Zip(publishArchiveFolder, pathToGitHubReleaseAsset);
4040
}
4141

build/Choco.csx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static class Choco
1313
{
1414
string pathToProjectFile = Directory.GetFiles(pathToProjectFolder, "*.csproj").Single();
1515
CreateSpecificationFromProject(pathToProjectFile, pathToBinaries);
16-
Command.Execute("choco.exe", $@"pack Chocolatey\chocolatey.nuspec --outputdirectory {outputFolder}");
16+
Command.Execute("choco.exe", $@"pack {Path.Combine(FileUtils.GetScriptFolder(), "Chocolatey", "chocolatey.nuspec")} --outputdirectory {outputFolder}");
1717
}
1818

1919
public static void Push(string packagesFolder, string apiKey, string source = "https://push.chocolatey.org/")
@@ -78,8 +78,7 @@ public static class Choco
7878
filesElement.Add(CreateFileElement(@"tools\*.*", $@"{packageId}\tools"));
7979
var srcGlobPattern = $@"{pathToBinaries}\**\*";
8080
filesElement.Add(CreateFileElement(srcGlobPattern, packageId));
81-
82-
using var fileStream = new FileStream("Chocolatey/chocolatey.nuspec", FileMode.Create);
81+
using var fileStream = new FileStream(Path.Combine(FileUtils.GetScriptFolder(), "Chocolatey", "chocolatey.nuspec"), FileMode.Create);
8382
new XDocument(packageElement).Save(fileStream);
8483
}
8584

build/omnisharp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"script": {
33
"enableScriptNuGetReferences": true,
4-
"defaultTargetFramework": "netcoreapp3.1"
4+
"defaultTargetFramework": "net6.0"
55
}
66
}

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.100",
3+
"version": "7.0.100-rc.1.22431.12",
44
"rollForward": "latestFeature"
55
}
6-
}
6+
}

src/Dotnet.Script.Core/Dotnet.Script.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<Description>A cross platform library allowing you to run C# (CSX) scripts with support for debugging and inline NuGet packages. Based on Roslyn.</Description>
5-
<VersionPrefix>1.3.1</VersionPrefix>
5+
<VersionPrefix>1.4.0</VersionPrefix>
66
<Authors>filipw</Authors>
7-
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
7+
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
88
<AssemblyName>Dotnet.Script.Core</AssemblyName>
99
<PackageId>Dotnet.Script.Core</PackageId>
1010
<PackageTags>script;csx;csharp;roslyn</PackageTags>

src/Dotnet.Script.Core/ScriptAssemblyLoadContext.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if NETCOREAPP
1+
#if NET
22

33
using System;
44
using System.Reflection;
@@ -20,7 +20,7 @@ public ScriptAssemblyLoadContext()
2020
{
2121
}
2222

23-
#if NETCOREAPP3_0_OR_GREATER
23+
#if NET5_0_OR_GREATER
2424
/// <summary>
2525
/// Initializes a new instance of the <see cref="ScriptAssemblyLoadContext"/> class
2626
/// with a name and a value that indicates whether unloading is enabled.

src/Dotnet.Script.DependencyModel.Nuget/Dotnet.Script.DependencyModel.NuGet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RepositoryUrl>https://github.com/filipw/dotnet-script.git</RepositoryUrl>
99
<RepositoryType>git</RepositoryType>
1010
<PackageTags>script;csx;csharp;roslyn;nuget</PackageTags>
11-
<Version>1.3.1</Version>
11+
<Version>1.4.0</Version>
1212
<Description>A MetadataReferenceResolver that allows inline nuget references to be specified in script(csx) files.</Description>
1313
<Authors>dotnet-script</Authors>
1414
<Company>dotnet-script</Company>

src/Dotnet.Script.DependencyModel/Compilation/CompilationDependencyResolver.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,8 @@ public IEnumerable<CompilationDependency> GetDependencies(string targetDirectory
4343
result.Add(compilationDependency);
4444
}
4545

46-
// On .Net Core, we need to fetch the compilation references for framework assemblies separately.
47-
if (defaultTargetFramework.StartsWith("netcoreapp3", StringComparison.InvariantCultureIgnoreCase) ||
48-
defaultTargetFramework.StartsWith("net5", StringComparison.InvariantCultureIgnoreCase) ||
49-
defaultTargetFramework.StartsWith("net6", StringComparison.InvariantCultureIgnoreCase))
50-
{
51-
var compilationreferences = _compilationReferenceReader.Read(projectFileInfo);
52-
result.Add(new CompilationDependency("Dotnet.Script.Default.Dependencies", "99.0", compilationreferences.Select(cr => cr.Path).ToArray(), Array.Empty<string>()));
53-
}
46+
var compilationReferences = _compilationReferenceReader.Read(projectFileInfo);
47+
result.Add(new CompilationDependency("Dotnet.Script.Default.Dependencies", "99.0", compilationReferences.Select(cr => cr.Path).ToArray(), Array.Empty<string>()));
5448

5549
return result;
5650
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy