Browse Source

Update SDK to RC 1.

pull/9700/head
maliming 5 years ago
parent
commit
d49c21c0fc
  1. 2
      .github/workflows/build-and-test.yml
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs
  3. 2
      framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj
  4. 86
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs
  5. 2
      framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs
  6. 2
      framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs
  7. 2
      framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj
  8. 2
      global.json
  9. 6
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj
  10. 6
      modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj
  11. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.js
  12. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html
  13. 4
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/global.css
  14. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/global.js
  15. 4
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/index.html

2
.github/workflows/build-and-test.yml

@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-dotnet@master - uses: actions/setup-dotnet@master
with: with:
dotnet-version: 6.0.100-preview.7.21379.14 dotnet-version: 6.0.100-rc.1.21458.32
- name: Build All - name: Build All
run: .\build-all.ps1 run: .\build-all.ps1

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Json/AbpJsonOptionsSetup.cs

@ -32,7 +32,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Json
options.JsonSerializerOptions.Converters.Add(new AbpHasExtraPropertiesJsonConverterFactory()); options.JsonSerializerOptions.Converters.Add(new AbpHasExtraPropertiesJsonConverterFactory());
// Remove after this PR. // Remove after this PR.
// https://github.com/dotnet/runtime/pull/51739 // https://github.com/dotnet/runtime/pull/57525
options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict;
} }
} }

2
framework/src/Volo.Abp.Cli.Core/Volo.Abp.Cli.Core.csproj

@ -19,7 +19,7 @@
<PackageReference Include="NuGet.Versioning" Version="5.9.0" /> <PackageReference Include="NuGet.Versioning" Version="5.9.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="$(MicrosoftPackageVersion)" />
<PackageReference Include="System.Security.Permissions" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="System.Security.Permissions" Version="$(MicrosoftPackageVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.0-4.final" />
<PackageReference Include="Polly" Version="7.2.1" /> <PackageReference Include="Polly" Version="7.2.1" />
<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" /> <PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageReference Include="LibGit2Sharp" Version="0.26.2" /> <PackageReference Include="LibGit2Sharp" Version="0.26.2" />

86
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlerBase.cs

@ -4,7 +4,8 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Xml; using System.Text.Json;
using System.Text.Json.Nodes;
using Volo.Abp.Bundling; using Volo.Abp.Bundling;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Minify; using Volo.Abp.Minify;
@ -33,7 +34,7 @@ namespace Volo.Abp.Cli.Bundling
$"{options.BundleName}{FileExtension}"); $"{options.BundleName}{FileExtension}");
var bundleFileDefinitions = context.BundleDefinitions.Where(t => t.ExcludeFromBundle == false).ToList(); var bundleFileDefinitions = context.BundleDefinitions.Where(t => t.ExcludeFromBundle == false).ToList();
var fileDefinitionsExcludingFromBundle = context.BundleDefinitions.Where(t => t.ExcludeFromBundle).ToList(); var fileDefinitionsExcludingFromBundle = context.BundleDefinitions.Where(t => t.ExcludeFromBundle).ToList();
var bundledContent = BundleFiles(options, bundleFileDefinitions); var bundledContent = BundleFiles(options, bundleFileDefinitions);
File.WriteAllText(bundleFilePath, bundledContent); File.WriteAllText(bundleFilePath, bundledContent);
@ -56,56 +57,61 @@ namespace Volo.Abp.Cli.Bundling
private string BundleFiles(BundleOptions options, List<BundleDefinition> bundleDefinitions) private string BundleFiles(BundleOptions options, List<BundleDefinition> bundleDefinitions)
{ {
var staticAssetsFilePath = Path.Combine(options.Directory, "bin", "Debug", options.FrameworkVersion, var staticAssetsFilePath = Path.Combine(options.Directory, "bin", "Debug", options.FrameworkVersion,
$"{options.ProjectFileName}.StaticWebAssets.xml"); $"{options.ProjectFileName}.staticwebassets.runtime.json");
if (!File.Exists(staticAssetsFilePath)) if (!File.Exists(staticAssetsFilePath))
{ {
throw new BundlingException( throw new BundlingException(
"Unable to find static web assets file. You need to build the project to generate static web assets file."); "Unable to find static web assets file. You need to build the project to generate static web assets file.");
} }
var staticAssetsDefinitions = new XmlDocument(); using (var file = File.OpenRead(staticAssetsFilePath))
staticAssetsDefinitions.Load(staticAssetsFilePath);
var builder = new StringBuilder();
foreach (var definition in bundleDefinitions)
{ {
string content; var jsonDocument = JsonDocument.Parse(file);
if (definition.Source.StartsWith("_content")) var contentRoots = jsonDocument.RootElement.GetProperty("ContentRoots").EnumerateArray()
.Select(x => x.GetString())
.ToList();
var builder = new StringBuilder();
foreach (var definition in bundleDefinitions)
{ {
var pathFragments = definition.Source.Split('/').ToList(); string content;
var basePath = $"{pathFragments[0]}/{pathFragments[1]}"; if (definition.Source.StartsWith("_content"))
var node = staticAssetsDefinitions.SelectSingleNode($"//ContentRoot[@BasePath='{basePath}']");
if (node?.Attributes == null)
{ {
throw new AbpException("Not found: " + definition.Source); var pathFragments = definition.Source.Split('/').ToList();
var basePath = $"{pathFragments[0]}/{pathFragments[1]}";
var path = contentRoots.FirstOrDefault(x => x.IndexOf($"\\{pathFragments[1]}\\", StringComparison.OrdinalIgnoreCase) > 0);
if (path == null)
{
throw new AbpException("Not found: " + definition.Source);
}
var absolutePath = definition.Source.Replace(basePath, path);
content = GetFileContent(absolutePath, options.Minify);
} }
else if (definition.Source.StartsWith("_framework"))
var path = node.Attributes["Path"].Value; {
var absolutePath = definition.Source.Replace(basePath, path); var slashIndex = definition.Source.IndexOf('/');
content = GetFileContent(absolutePath, options.Minify); var fileName =
} definition.Source.Substring(slashIndex + 1, definition.Source.Length - slashIndex - 1);
else if (definition.Source.StartsWith("_framework")) var filePath =
{ Path.Combine(PathHelper.GetFrameworkFolderPath(options.Directory, options.FrameworkVersion),
var slashIndex = definition.Source.IndexOf('/'); fileName);
var fileName = content = GetFileContent(filePath, false);
definition.Source.Substring(slashIndex + 1, definition.Source.Length - slashIndex - 1); }
var filePath = else
Path.Combine(PathHelper.GetFrameworkFolderPath(options.Directory, options.FrameworkVersion), {
fileName); var filePath = Path.Combine(PathHelper.GetWwwRootPath(options.Directory), definition.Source);
content = GetFileContent(filePath, false); content = GetFileContent(filePath, options.Minify);
} }
else
{ content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"),
var filePath = Path.Combine(PathHelper.GetWwwRootPath(options.Directory), definition.Source); content);
content = GetFileContent(filePath, options.Minify);
builder.AppendLine(content);
} }
content = ProcessBeforeAddingToTheBundle(definition.Source, Path.Combine(options.Directory, "wwwroot"), return builder.ToString();
content);
builder.AppendLine(content);
} }
return builder.ToString();
} }
private string GetFileContent(string filePath, bool minify) private string GetFileContent(string filePath, bool minify)
@ -134,4 +140,4 @@ namespace Volo.Abp.Cli.Bundling
return fileContent; return fileContent;
} }
} }
} }

2
framework/src/Volo.Abp.EntityFrameworkCore/Volo/Abp/EntityFrameworkCore/ValueConverters/ExtraPropertiesValueConverter.cs

@ -52,7 +52,7 @@ namespace Volo.Abp.EntityFrameworkCore.ValueConverters
deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter()); deserializeOptions.Converters.Add(new ObjectToInferredTypesConverter());
// Remove after this PR. // Remove after this PR.
// https://github.com/dotnet/runtime/pull/51739 // https://github.com/dotnet/runtime/pull/57525
deserializeOptions.NumberHandling = JsonNumberHandling.Strict; deserializeOptions.NumberHandling = JsonNumberHandling.Strict;
var dictionary = JsonSerializer.Deserialize<ExtraPropertyDictionary>(extraPropertiesAsJson, deserializeOptions) ?? var dictionary = JsonSerializer.Deserialize<ExtraPropertyDictionary>(extraPropertiesAsJson, deserializeOptions) ??

2
framework/src/Volo.Abp.Json/Volo/Abp/Json/SystemTextJson/AbpSystemTextJsonSerializerOptionsSetup.cs

@ -31,7 +31,7 @@ namespace Volo.Abp.Json.SystemTextJson
options.JsonSerializerOptions.Encoder ??= JavaScriptEncoder.UnsafeRelaxedJsonEscaping; options.JsonSerializerOptions.Encoder ??= JavaScriptEncoder.UnsafeRelaxedJsonEscaping;
// Remove after this PR. // Remove after this PR.
// https://github.com/dotnet/runtime/pull/51739 // https://github.com/dotnet/runtime/pull/57525
options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict; options.JsonSerializerOptions.NumberHandling = JsonNumberHandling.Strict;
} }
} }

2
framework/src/Volo.Abp.TextTemplating.Razor/Volo.Abp.TextTemplating.Razor.csproj

@ -13,7 +13,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.9.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.0-4.final" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="$(MicrosoftPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftPackageVersion)" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="$(MicrosoftPackageVersion)" />
</ItemGroup> </ItemGroup>

2
global.json

@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "6.0.100-preview.7.21379.14", "version": "6.0.100-rc.1.21458.32",
"rollForward": "latestFeature" "rollForward": "latestFeature"
} }
} }

6
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo.csproj

@ -8,11 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(MicrosoftPackageVersion)" />
Check this in net 6 RC
Unable to find package Microsoft.CodeAnalysis.CSharp.Workspaces with version (>= 4.0.0-3.21370.20)
Unable to find package Microsoft.CodeAnalysis.CSharp with version (>= 4.0.0-3.21370.20) -->
<!-- <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(MicrosoftPackageVersion)" /> -->
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
</ItemGroup> </ItemGroup>

6
modules/basic-theme/test/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Demo.csproj

@ -16,11 +16,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<!-- <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(MicrosoftPackageVersion)" />
Check this in net 6 RC
Unable to find package Microsoft.CodeAnalysis.CSharp.Workspaces with version (>= 4.0.0-3.21370.20)
Unable to find package Microsoft.CodeAnalysis.CSharp with version (>= 4.0.0-3.21370.20) -->
<!-- <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(MicrosoftPackageVersion)" /> -->
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
</ItemGroup> </ItemGroup>

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.js

File diff suppressed because one or more lines are too long

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/index.html

@ -8,7 +8,7 @@
<base href="/" /> <base href="/" />
<!--ABP:Styles--> <!--ABP:Styles-->
<link href="global.css?_v=637637739759705423" rel="stylesheet"/> <link href="global.css?_v=637673028804524981" rel="stylesheet"/>
<link href="main.css" rel="stylesheet"/> <link href="main.css" rel="stylesheet"/>
<!--/ABP:Styles--> <!--/ABP:Styles-->
<link href="MyCompanyName.MyProjectName.Blazor.styles.css" rel="stylesheet"/> <link href="MyCompanyName.MyProjectName.Blazor.styles.css" rel="stylesheet"/>
@ -23,7 +23,7 @@
</div> </div>
<!--ABP:Scripts--> <!--ABP:Scripts-->
<script src="global.js?_v=637637739764630998"></script> <script src="global.js?_v=637673028807465034"></script>
<!--/ABP:Scripts--> <!--/ABP:Scripts-->
</body> </body>

4
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/global.css

File diff suppressed because one or more lines are too long

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/global.js

File diff suppressed because one or more lines are too long

4
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/wwwroot/index.html

@ -8,7 +8,7 @@
<base href="/" /> <base href="/" />
<!--ABP:Styles--> <!--ABP:Styles-->
<link href="global.css?_v=637637742146900469" rel="stylesheet"/> <link href="global.css?_v=637673053316366502" rel="stylesheet"/>
<link href="main.css" rel="stylesheet"/> <link href="main.css" rel="stylesheet"/>
<!--/ABP:Styles--> <!--/ABP:Styles-->
</head> </head>
@ -22,7 +22,7 @@
</div> </div>
<!--ABP:Scripts--> <!--ABP:Scripts-->
<script src="global.js?_v=637637742151617810"></script> <script src="global.js?_v=637673053319400165"></script>
<!--/ABP:Scripts--> <!--/ABP:Scripts-->
</body> </body>

Loading…
Cancel
Save