Skip to content

Commit f9e0550

Browse files
authored
Feature native update (#24)
* Update to latest dotnet version * Update webview.yaml * Add CMakePreset.json * Update webview.yaml * Update webview.yaml * Change windows build * Update libraries * Update README.md * Update CHANGELOG.md
1 parent d779380 commit f9e0550

17 files changed

+23796
-34
lines changed

.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
runs-on: windows-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- name: Setup .NET Core
11+
- name: Setup .NET
1212
uses: actions/setup-dotnet@v1
1313
with:
14-
dotnet-version: 3.1.101
14+
dotnet-version: 6.0.201
1515
- name: Install dependencies
1616
run: dotnet restore src\SharpWebview\SharpWebview.csproj
1717
- name: Build

.github/workflows/webview.yaml

+19-9
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ jobs:
1010
- uses: actions/checkout@v2
1111
- name: Install dependencies
1212
run: sudo apt-get update && sudo apt-get install libwebkit2gtk-4.0-dev xvfb -y
13-
- name: Build webview native
14-
uses: ashutoshvarma/action-cmake-build@v1
13+
- name: Get CMake
14+
uses: lukka/get-cmake@latest
15+
- name: Run CMake
16+
uses: lukka/run-cmake@v10
1517
with:
16-
build-dir: ./build
18+
configurePreset: 'ninja'
19+
buildPreset: 'ninja'
1720
- name: Upload artifact
1821
uses: actions/[email protected]
1922
with:
@@ -24,10 +27,13 @@ jobs:
2427
runs-on: macos-latest
2528
steps:
2629
- uses: actions/checkout@v2
27-
- name: Build webview native
28-
uses: ashutoshvarma/action-cmake-build@v1
30+
- name: Get CMake
31+
uses: lukka/get-cmake@latest
32+
- name: Run CMake
33+
uses: lukka/run-cmake@v10
2934
with:
30-
build-dir: ./build
35+
configurePreset: 'ninja'
36+
buildPreset: 'ninja'
3137
- name: Upload artifact
3238
uses: actions/[email protected]
3339
with:
@@ -38,10 +44,14 @@ jobs:
3844
runs-on: windows-latest
3945
steps:
4046
- uses: actions/checkout@v2
41-
- name: Build webview native
42-
uses: ashutoshvarma/action-cmake-build@v1
47+
- uses: GuillaumeFalourd/[email protected]
48+
- name: Get CMake
49+
uses: lukka/get-cmake@latest
50+
- name: Run CMake
51+
uses: lukka/run-cmake@v10
4352
with:
44-
build-dir: ./build
53+
configurePreset: 'windows'
54+
buildPreset: 'windows'
4555
- name: Upload artifact
4656
uses: actions/[email protected]
4757
with:

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [0.7.0] - 2022-04-13
10+
### Fixed
11+
- Update to latest webview version
12+
913
## [0.6.1] - 2020-07-11
1014
### Fixed
1115
- Dispatch delegates pinned until execution

CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ endif()
2323
include(FetchContent)
2424
FetchContent_Declare(
2525
webviewNative
26-
GIT_REPOSITORY https://github.com/geaz/webview
27-
GIT_TAG 13a11cfee9be94608ee3add8df05d4f740a320d9
26+
GIT_REPOSITORY https://github.com/webview/webview
27+
GIT_TAG 5d72732c9f5c94241d9a983b512e5fc5698bd1e0
2828
)
2929
FetchContent_Populate(webviewNative)
3030

3131
include_directories(
3232
"${webviewnative_SOURCE_DIR}"
33-
"${webviewnative_SOURCE_DIR}/script/microsoft.web.webview2.0.9.488/build/native/include"
33+
"${CMAKE_CURRENT_SOURCE_DIR}/libs/include"
3434
)
35-
link_directories("${webviewnative_SOURCE_DIR}/script/microsoft.web.webview2.0.9.488/build/native/x64")
35+
link_directories("${CMAKE_CURRENT_SOURCE_DIR}/libs")
3636

3737
add_library(webview SHARED "${webviewnative_SOURCE_DIR}/webview.cc")
3838

3939
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
4040
target_compile_definitions(webview PRIVATE "WEBVIEW_API=__declspec(dllexport)")
4141
target_link_libraries(webview WebView2Loader.dll.lib)
42-
configure_file(${webviewnative_SOURCE_DIR}/script/microsoft.web.webview2.0.9.488/build/x64/WebView2Loader.dll WebView2Loader.dll COPYONLY)
42+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libs/WebView2Loader.dll WebView2Loader.dll COPYONLY)
4343
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
4444
target_link_libraries(webview PkgConfig::gtk3 PkgConfig::webkit2)
4545
endif()

CMakePresets.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"version": 3,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 21,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "ninja",
11+
"displayName": "Ninja Configure Settings",
12+
"description": "Sets build and install directories",
13+
"binaryDir": "${sourceDir}/build",
14+
"generator": "Ninja"
15+
},
16+
{
17+
"name": "windows",
18+
"displayName": "Windows Configure Settings",
19+
"description": "Sets build and install directories",
20+
"binaryDir": "${sourceDir}/build",
21+
"generator": "Visual Studio 17 2022"
22+
}
23+
],
24+
"buildPresets": [
25+
{
26+
"name": "ninja",
27+
"configurePreset": "ninja",
28+
"displayName": "Build with Ninja",
29+
"description": "Build with Ninja"
30+
},
31+
{
32+
"name": "windows",
33+
"configurePreset": "windows",
34+
"displayName": "Build with Visual Studio",
35+
"description": "Build with Visual Studio"
36+
}
37+
]
38+
}

README.md

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
[![ReleaseBuild](https://github.com/geaz/sharpWebview/workflows/ReleaseBuild/badge.svg)](https://github.com/geaz/sharpWebview/actions?query=workflow%3AReleaseBuild)
2-
[![WebviewNative](https://github.com/geaz/sharpWebview/workflows/WebviewNative/badge.svg)](https://github.com/geaz/sharpWebview/actions?query=workflow%3AWebviewNative)
1+
[![ReleaseBuild](https://github.com/webview/sharpWebview/workflows/ReleaseBuild/badge.svg)](https://github.com/webview/sharpWebview/actions?query=workflow%3AReleaseBuild)
2+
[![WebviewNative](https://github.com/webview/sharpWebview/workflows/WebviewNative/badge.svg)](https://github.com/webview/sharpWebview/actions?query=workflow%3AWebviewNative)
33
[![Nuget](https://img.shields.io/nuget/v/SharpWebview?color=green)](https://www.nuget.org/packages/SharpWebview/)
44
[![Webview Org Chat](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/grzBQBP)
55

66
# sharpWebview
77

8-
This repository contains battery included C# bindings for [zserge/webview](https://github.com/zserge/webview). **It only supports x64 systems.**
8+
This repository contains battery included C# bindings for [webview](https://github.com/webview/webview). **It only supports x64 systems.**
99

1010
# Webview
1111

12-
[zserge/webview](https://github.com/zserge/webview) is a small C/C++ header only library for a cross platform access of a webview control.
12+
[webview](https://github.com/webview/webview) is a small C/C++ header only library for a cross platform access of a webview control.
1313
It uses Edge Chromium, with fallback to the 'old' Edge, on Windows, GTK Webkit on Linux and Cocoa Webkit on macOS.
14-
*sharpWebview* ships precompiled libraries for each system, ready to be used in your next C# project. This repository contains a cmake file to compile webview via *Github Actions* [![WebviewNative](https://github.com/geaz/sharpWebview/workflows/WebviewNative/badge.svg)](https://github.com/geaz/sharpWebview/actions?query=workflow%3AWebviewNative).
14+
*sharpWebview* ships precompiled libraries for each system, ready to be used in your next C# project. This repository contains a cmake file to compile webview via *Github Actions* [![WebviewNative](https://github.com/webview/sharpWebview/workflows/WebviewNative/badge.svg)](https://github.com/webview/sharpWebview/actions?query=workflow%3AWebviewNative).
1515

16-
You are always able to see which webview version *sharpWebview* uses by looking into the [CMakeLists.txt](https://github.com/geaz/sharpWebview/blob/master/CMakeLists.txt) (GIT_TAG option in the *FetchContent_Declare* command). You can find all compiled libraries and used patches in the [libs](https://github.com/geaz/sharpWebview/tree/master/libs) folder of this repository.
16+
You are always able to see which webview version *sharpWebview* uses by looking into the [CMakeLists.txt](https://github.com/webview/sharpWebview/blob/master/CMakeLists.txt) (GIT_TAG option in the *FetchContent_Declare* command). You can find all compiled libraries and used patches in the [libs](https://github.com/webview/sharpWebview/tree/master/libs) folder of this repository.
1717

18-
All patches are also contributed back to [zserge/webview](https://github.com/zserge/webview).
19-
20-
*REMARK:* The nuget uses this [fork](https://github.com/geaz/webview) at the moment, because the work on upstream is stalled at the moment. Because of the many patches it was not possible to maintain it without a fork.
18+
All patches are also contributed back to [webview](https://github.com/webview/webview).
2119

2220
# Get started
2321

@@ -71,14 +69,14 @@ using(var webview = new Webview())
7169
}
7270
```
7371

74-
The [examples](https://github.com/geaz/sharpWebview/tree/master/examples) folder contains two basic projects. The [*Minimal*](https://github.com/geaz/sharpWebview/tree/master/examples/Minimal) projects shows you a basic example on how to create a cross platform webview and how to open a URL in it.
75-
Please have a look into the documented [*Program.cs*](https://github.com/geaz/sharpWebview/blob/master/examples/Minimal/Program.cs). You are also able to use the *HtmlContent* to provide some HTML which the webview will render.
72+
The [examples](https://github.com/webview/sharpWebview/tree/master/examples) folder contains two basic projects. The [*Minimal*](https://github.com/webview/sharpWebview/tree/master/examples/Minimal) projects shows you a basic example on how to create a cross platform webview and how to open a URL in it.
73+
Please have a look into the documented [*Program.cs*](https://github.com/webview/sharpWebview/blob/master/examples/Minimal/Program.cs). You are also able to use the *HtmlContent* to provide some HTML which the webview will render.
7674

7775
## Run a webserver to serve a javascript application
7876

7977
Besides the *UrlContent* and *HtmlContent*, *sharpWebview* also provides a *HostedContent*. This content type creates a webserver to which the webview will automatically navigate.
8078

81-
To use this content it is necessary to create a *app* folder in your project. Every file you put into this folder will be served by the *HostedContent*. The [*DesktopApp*](https://github.com/geaz/sharpWebview/tree/master/examples/DesktopApp) project is an example of the usage of this content type.
79+
To use this content it is necessary to create a *app* folder in your project. Every file you put into this folder will be served by the *HostedContent*. The [*DesktopApp*](https://github.com/webview/sharpWebview/tree/master/examples/DesktopApp) project is an example of the usage of this content type.
8280
Don't forget to set the files in the *app* folder to *copy always* (see project file for an example).
8381

8482
### HostedContent on Windows systems
@@ -94,12 +92,12 @@ This adds the Edge Webview Host to the exception list of this limitation. Your b
9492
# Application Distribution
9593
## Windows
9694

97-
The [*DesktopApp*](https://github.com/geaz/sharpWebview/tree/master/examples/DesktopApp) example contains a simple script to create a MSI installer. You are able to take the *wix.bat* and *DesktopApp.wix* files as a starting point for your application. To use the *wix.bat* you need to install the WIX Toolset.
95+
The [*DesktopApp*](https://github.com/webview/sharpWebview/tree/master/examples/DesktopApp) example contains a simple script to create a MSI installer. You are able to take the *wix.bat* and *DesktopApp.wix* files as a starting point for your application. To use the *wix.bat* you need to install the WIX Toolset.
9896

9997
I highly recommend to use [scoop](https://scoop.sh/) to install it. Scoop is a command line installer for easy installation of many different applications. Just run
10098

10199
```
102100
scoop install wixtoolset
103101
```
104102

105-
to install WIX. After this you should be able to execute the *wix.bat* to create a basic installer for the example [*DesktopApp*](https://github.com/geaz/sharpWebview/tree/master/examples/DesktopApp).
103+
to install WIX. After this you should be able to execute the *wix.bat* to create a basic installer for the example [*DesktopApp*](https://github.com/webview/sharpWebview/tree/master/examples/DesktopApp).

examples/DesktopApp/DesktopApp.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<ApplicationIcon>icon.ico</ApplicationIcon>
77
</PropertyGroup>
88

examples/Minimal/Minimal.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFramework>net6.0</TargetFramework>
66
<ApplicationIcon>icon.ico</ApplicationIcon>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="SharpWebview" Version="0.6.1" />
10+
<PackageReference Include="SharpWebview" Version="0.7.0" />
1111
</ItemGroup>
1212
<ItemGroup>
1313
<None Update="icon.ico">

libs/WebView2Loader.dll

-280 KB
Binary file not shown.

libs/WebView2Loader.dll.lib

1.95 KB
Binary file not shown.

libs/WebView2LoaderStatic.lib

377 KB
Binary file not shown.

0 commit comments

Comments
 (0)