Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/microsoft/setup-ms…
Browse files Browse the repository at this point in the history
…build-3404ff3d40458f8d1fdf55c2bcc442b970404ad7
  • Loading branch information
abhijeetnarvekar authored Nov 28, 2023
2 parents 84c6634 + 32f8486 commit f834729
Show file tree
Hide file tree
Showing 18 changed files with 248 additions and 122 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/dotnet-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:

env:
Solution_Name: Acrolinx.Demo.Sidebar.Net.sln
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -37,7 +38,7 @@ jobs:

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x

Expand All @@ -51,10 +52,11 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

- name: Set up JDK 11 - required by sonar
uses: actions/setup-java@v1
- name: Setup Java - required by sonar
uses: actions/setup-java@v3
with:
java-version: 1.11
java-version: '17'
distribution: 'temurin'

- name: Set version from tag name
if: startsWith(github.ref,'refs/tags/v')
Expand All @@ -63,7 +65,6 @@ jobs:

- name: begin sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: sonar-msbuild\SonarScanner.MSBuild.exe begin /o:"acrolinx" /k:"acrolinx_acrolinx-sidebar-demo-dotnet" /d:sonar.token=$env:SONAR_TOKEN /d:sonar.host.url="https://sonarcloud.io"

Expand All @@ -77,7 +78,6 @@ jobs:

- name: end sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
run: sonar-msbuild\SonarScanner.MSBuild.exe end /d:sonar.token=$env:SONAR_TOKEN

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ download

# Eclipse
.project
Acrolinx.Demo.Sidebar/runtimes/
6 changes: 6 additions & 0 deletions Acrolinx.Demo.Sidebar.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|x86.ActiveCfg = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Debug|x86.Build.0 = Debug|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|Any CPU.Build.0 = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|x86.ActiveCfg = Release|Any CPU
{41FA1FDD-2E94-45D4-808F-DC8E611F3DEE}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
52 changes: 39 additions & 13 deletions Acrolinx.Demo.Sidebar/Acrolinx.Demo.Sidebar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Acrolinx.Demo.Sidebar</RootNamespace>
<AssemblyName>Acrolinx.Demo.Sidebar</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<CodeContractsAssemblyMode>0</CodeContractsAssemblyMode>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -81,24 +83,39 @@
<ApplicationIcon>acrolinx.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Acrolinx.Sidebar, Version=1.1.8.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Acrolinx.Sidebar.1.1.8.1220\lib\net45\Acrolinx.Sidebar.dll</HintPath>
<Reference Include="Acrolinx.Sidebar, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Acrolinx.Sidebar.2.0.0.1380\lib\net472\Acrolinx.Sidebar.dll</HintPath>
</Reference>
<Reference Include="Diff.Match.Patch, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Diff.Match.Patch.2.1.0\lib\net45\Diff.Match.Patch.dll</HintPath>
<Reference Include="Diff.Match.Patch, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Diff.Match.Patch.3.0.1\lib\netstandard2.0\Diff.Match.Patch.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core, Version=4.7.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.4.7.2\lib\net45\FSharp.Core.dll</HintPath>
<Reference Include="FSharp.Core, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.5.0.0\lib\netstandard2.0\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.14.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.14\lib\net45\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.Core, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.WinForms, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.WinForms.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.WebView2.Wpf, Version=1.0.2151.40, Culture=neutral, PublicKeyToken=2a8ab48044d2601e, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.WebView2.1.0.2151.40\lib\net45\Microsoft.Web.WebView2.Wpf.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
Expand Down Expand Up @@ -134,6 +151,7 @@
<Compile Include="TextBoxAdapter.cs" />
<EmbeddedResource Include="MultiSample.resx">
<DependentUpon>MultiSample.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
Expand All @@ -150,6 +168,7 @@
</EmbeddedResource>
<EmbeddedResource Include="SimpleSample.resx">
<DependentUpon>SimpleSample.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="packages.config">
<SubType>Designer</SubType>
Expand All @@ -170,13 +189,20 @@
<ItemGroup>
<Content Include="acrolinx.ico" />
<Content Include="Acrolinx.Sidebar.log4net.xml" />
<Content Include="Acrolinx.Startpage.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Config.Resource.log4net.xml" />
<Content Include="runtimes\win-arm64\native\WebView2Loader.dll" />
<Content Include="runtimes\win-x64\native\WebView2Loader.dll" />
<Content Include="runtimes\win-x86\native\WebView2Loader.dll" />
<None Include="Resources\loading.bmp" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.2151.40\build\Microsoft.Web.WebView2.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
Binary file removed Acrolinx.Demo.Sidebar/Acrolinx.Startpage.dll
Binary file not shown.
12 changes: 10 additions & 2 deletions Acrolinx.Demo.Sidebar/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<applicationSettings>
<Acrolinx.Demo.Sidebar.Properties.Settings>
Expand Down Expand Up @@ -170,7 +170,15 @@ CAUTION: Don't lift the 360 chassis by the front (bezel end) and back (service e
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.14.0" newVersion="2.0.14.0" />
<bindingRedirect oldVersion="0.0.0.0-2.0.15.0" newVersion="2.0.15.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.WinForms" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2151.40" newVersion="1.0.2151.40" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Web.WebView2.Core" publicKeyToken="2a8ab48044d2601e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.0.2151.40" newVersion="1.0.2151.40" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
20 changes: 11 additions & 9 deletions Acrolinx.Demo.Sidebar/Integration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public Integration(AcrolinxSidebar sidebar)
//This allows you to talk to the server without configuring CORS.
//Ensure the SidebarSourceLocation uses the same host as ServerAddress.
//Ensure the external name of the Acrolinx Server equals the host name you are talking to.
//sidebar.SidebarSourceLocation = "http://yourlocalserver:8031/sidebar/v14/index.html";
//sidebar.ServerAddress = "http://yourlocalserver:8031";
//sidebar.ServerAddress = "https://company.acrolinx.cloud";
//sidebar.ShowServerSelector = false;
//Make sure to call sidebar.Start() instead of sidebar.Start(serverAddress), if you uncomment one of these options.

Expand All @@ -52,9 +51,12 @@ public Integration(AcrolinxSidebar sidebar)
//Set version information. This is used for support and Acrolinx Analytics.
//sidebar.RegisterClientComponent(typeof(Integration).Assembly, "Acrolinx for " + Application.ProductName, AcrolinxSidebar.SoftwareComponentCategory.MAIN);
//sidebar.RegisterClientComponent(Assembly.GetEntryAssembly(), Application.ProductName, AcrolinxSidebar.SoftwareComponentCategory.DEFAULT);
}

public async Task Start()
{
//Start the Sidebar, which connects to an Acrolinx Server.
sidebar.Start();
await sidebar.Start();
}

public void RegisterTextBox(TextBox textBox)
Expand All @@ -79,14 +81,14 @@ public void RegisterXmlTextBox(TextBox textBox)
private MultiAdapter current = new MultiAdapter("", new UniversalAdapter[0], Format.Auto);
private MultiAdapter request = new MultiAdapter("", new UniversalAdapter[0], Format.Auto);

private void RequestCheck(object sender, EventArgs e)
private async void RequestCheck(object sender, EventArgs e)
{
Logger.AcroLog.Info("RequestCheck");

request = new MultiAdapter("DotNetSampleXML", adapterList, Format.Auto);
request.DocumentReference = "dotnetSample/topspin.xml"; //Document reference should be set to path, uri or unique id of the current document

var checkId = sidebar.Check(request.Document);
var checkId = await sidebar.Check(request.Document);

Logger.AcroLog.Debug("Check submitted with id: " + checkId);
}
Expand All @@ -99,7 +101,7 @@ private void Checked(object sender, CheckedEventArgs e)
}


private void SelectRanges(object sender, MatchesEventArgs e)
private async void SelectRanges(object sender, MatchesEventArgs e)
{
Contract.Requires(e.Matches.All(m => (0 <= m.Range.Start && m.Range.End <= current.Document.Content.Length)));

Expand All @@ -112,11 +114,11 @@ private void SelectRanges(object sender, MatchesEventArgs e)
catch (Exception err)
{
Logger.AcroLog.Error(err);
sidebar.InvalidateRanges(e.CheckId, e.Matches);
await sidebar.InvalidateRanges(e.CheckId, e.Matches);
}
}

private void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
private async void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
{
Contract.Requires(e.Matches.All(m => m.Range.Start >= 0 && m.Range.End <= current.Document.Content.Length));
Logger.AcroLog.Info("ReplaceRanges: " + e.Matches);
Expand All @@ -127,7 +129,7 @@ private void ReplaceRanges(object sender, MatchesWithReplacementEventArgs e)
catch (Exception err)
{
Logger.AcroLog.Error(err);
sidebar.InvalidateRanges(e.CheckId, e.Matches);
await sidebar.InvalidateRanges(e.CheckId, e.Matches);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions Acrolinx.Demo.Sidebar/MultiSample.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Acrolinx.Demo.Sidebar/MultiSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@ public MultiSample()

integration = new Integration(acrolinxSidebar);


integration.RegisterTitleTextBox(textBoxTitle); //Deal with plain text
integration.RegisterXmlTextBox(textBoxPlainXML); //Deal with xml content

for (int i = 0; i < 3; i++)
{
addTextSnippet();
}


}

private void addTextSnippetToolStripMenuItem_Click(object sender, EventArgs e)
Expand All @@ -64,5 +61,10 @@ private void addTextSnippet()

integration.RegisterTextBox(newTextBox);
}

private async void MultiSample_Load(object sender, EventArgs e)
{
await integration.Start();
}
}
}
9 changes: 4 additions & 5 deletions Acrolinx.Demo.Sidebar/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f834729

Please sign in to comment.