Skip to content

Commit

Permalink
v7.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zijianhuang committed Jun 12, 2024
1 parent d378dc6 commit c305dd8
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 31 deletions.
3 changes: 2 additions & 1 deletion BuildRelease.ps1
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dotnet build webapiclientgen.sln --configuration Release --no-incremental
cd $PSScriptRoot
dotnet build webapiclientgen.sln --configuration Release --no-incremental
3 changes: 2 additions & 1 deletion DotNetPack.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# pack existing release build
$packCmd = 'dotnet pack $Name --no-build --output C:/NugetLocalFeeds --configuration Release'
cd $PSScriptRoot
$packCmd = 'dotnet pack $Name --no-build --output Release --configuration Release'
$projList = 'Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj', 'Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj', 'Fonlow.Web.MetaCore/Fonlow.Web.MetaCore.csproj', 'WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj', 'WebApiClientGenCore/WebApiClientGenCore.csproj', 'WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj', 'WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj', 'WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj', 'WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj', 'WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj', 'WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj', 'Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj', 'Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj', 'Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj', 'Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj'
foreach($name in $projList){
Invoke-Expression $ExecutionContext.InvokeCommand.ExpandString($packCmd)
Expand Down
2 changes: 1 addition & 1 deletion Fonlow.DocCommentCore/DocCommentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Fonlow.DocComment
/// </summary>
public static class DocCommentHelper
{
const string newLine="\r\n";
static readonly string newLine=Environment.NewLine;

public static string GetSummary(docMember m)
{
Expand Down
2 changes: 1 addition & 1 deletion Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version>1.6.5</Version>
<Version>1.6.6</Version>
<Description>Basic functions of accessing XML Doc Comments.</Description>
<PackageReleaseNotes>Build for .NET 7</PackageReleaseNotes>
<Copyright>Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year)</Copyright>
Expand Down
2 changes: 1 addition & 1 deletion Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>3.8</Version>
<Version>3.8.1</Version>
<Authors>Zijian Huang</Authors>
<Company />
<Copyright>Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year)</Copyright>
Expand Down
2 changes: 2 additions & 0 deletions TestReleaseAll.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd $PSScriptRoot
dotnet test --verbosity normal --configuration Release --no-build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Copyright>Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year)</Copyright>
<Authors>Zijian Huang</Authors>
<PackageProjectUrl>https://github.com/zijianhuang/webapiclientgen</PackageProjectUrl>
<Version>3.3</Version>
<Version>3.3.1</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReleaseNotes>For god assembly.</PackageReleaseNotes>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.Aurelia</AssemblyName>
<Version>3.9.3</Version>
<Version>3.9.4</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
<AnalysisLevel>latest-all</AnalysisLevel>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.Axios</AssemblyName>
<Version>3.10.3</Version>
<Version>3.10.4</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
<AnalysisLevel>latest-all</AnalysisLevel>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Authors>Zijian Huang</Authors>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Version>3.11.3</Version>
<Version>3.11.4</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
<AnalysisLevel>latest-all</AnalysisLevel>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.NG2</AssemblyName>
<Version>3.10.3</Version>
<Version>3.10.4</Version>
<PackageTags>Angular</PackageTags>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.NG2FormGroup</AssemblyName>
<Version>1.6.5</Version>
<Version>1.6.6</Version>
<PackageTags>Angular</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<AssemblyName>Fonlow.WebApiClientGenCore.jQuery</AssemblyName>
<Version>3.7.3</Version>
<Version>3.7.4</Version>
<PackageTags>jQuery</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/zijianhuang/webapiclientgen</RepositoryUrl>
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore/ClientApiFunctionGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void AddRequestUriWithQueryAssignmentStatement()
else
{
clientMethod.Statements.Add(new CodeSnippetStatement(
"\t\t\tusing var requestWriter = new System.IO.StringWriter();\r\n\t\t\tvar requestSerializer = JsonSerializer.Create(jsonSerializerSettings);"
$"\t\t\tusing var requestWriter = new System.IO.StringWriter();{Environment.NewLine}t\t\tvar requestSerializer = JsonSerializer.Create(jsonSerializerSettings);"
));
clientMethod.Statements.Add(new CodeMethodInvokeExpression(new CodeSnippetExpression("requestSerializer"), "Serialize",
new CodeSnippetExpression("requestWriter"),
Expand Down
34 changes: 17 additions & 17 deletions WebApiClientGenCore/ControllersClientApiGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void Save(string fileName)
string s = stringReader.ReadToEnd();
if (codeGenSettings.ClientApiOutputs.UseEnsureSuccessStatusCodeEx && codeGenSettings.ClientApiOutputs.IncludeEnsureSuccessStatusCodeExBlock)
{
fileWriter.Write(s.Replace("//;", "").Replace(dummyBlock, blockOfEnsureSuccessStatusCodeEx));
fileWriter.Write(s.Replace("//;", "").Replace(dummyBlock, System.OperatingSystem.IsWindows() ? blockOfEnsureSuccessStatusCodeEx : GetBlockOfEnsureSuccessStatusCodeExForLinux()));
}
else
{
Expand Down Expand Up @@ -341,12 +341,16 @@ void CreateDummyOfEnsureSuccessStatusCodeEx()
targetUnit.Namespaces.InsertToSortedCollection("ZZZzzzEnsureSuccessStatusCodeExDummy", false); // ZZZ to ensure this block is the last one, hopefully.
}

/// <summary>
///
/// </summary>
/// <remarks>In .NEt 6, StatusCode of HttpRequestException is not there anymore.</remarks>
const string blockOfEnsureSuccessStatusCodeEx =
@"
static string GetBlockOfEnsureSuccessStatusCodeExForLinux()
{
return blockOfEnsureSuccessStatusCodeEx.ReplaceLineEndings();
}

/// <summary>
/// Code block for Windows with \r\n
/// </summary>
const string blockOfEnsureSuccessStatusCodeEx =
@"
namespace Fonlow.Net.Http
{
Expand Down Expand Up @@ -384,17 +388,13 @@ public static void EnsureSuccessStatusCodeEx(this HttpResponseMessage responseMe
}
}
}";
/// <summary>
/// The block must be with CRLF (\r\n) for lline break, and tab between {}.
/// </summary>
const string dummyBlock =
@"
namespace ZZZzzzEnsureSuccessStatusCodeExDummy
{
}";
/// <summary>
/// Block also working well in Linux while C# CodeDOM outputs with \n
/// </summary>
string dummyBlock =
$"{Environment.NewLine}namespace ZZZzzzEnsureSuccessStatusCodeExDummy{Environment.NewLine}{{{Environment.NewLine}\t{Environment.NewLine}}}";

protected virtual void Dispose(bool disposing)
protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
Expand Down
2 changes: 1 addition & 1 deletion WebApiClientGenCore/WebApiClientGenCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RootNamespace>Fonlow.CodeDom.Web</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>Fonlow.WebApiClientGenCore</PackageId>
<Version>7.7</Version>
<Version>7.7.1</Version>
<Description>Generate strongly typed client API in C# or TypeScript for .NET Core Web API. Strongly Typed Client API Generator generates C# and TypeScript codes of strongly typed client API similar to what generated by SvcUtil.exe of WCF, provided you have access to the ASP.NET Web API source codes or assemblies. Then you may provide or publish either the source codes in C# and TypeScript or the compiled client API library to other developers who are developing client programs of your Web API. The TypeScript outputs support jQuery, Angular 2+, AXIOS and Aurelia.</Description>
<Copyright>Copyright © Zijian Huang 2015-$([System.DateTime]::Now.Year)</Copyright>
<PackageLicenseUrl></PackageLicenseUrl>
Expand Down

0 comments on commit c305dd8

Please sign in to comment.