diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index dfdbbed..538fc92 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -15,11 +15,12 @@ jobs:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- - run: ./WinUI3XamlPreview/scripts/ci
+ - working-directory: WinUI3XamlPreview
+ run: ./scripts/ci
build:
runs-on: windows-2022
needs: ["test"]
- if: startsWith(github.ref, 'refs/tags')
+ if: startsWith(github.ref, 'refs/tags/v')
env:
VERSION: 0.1.0
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
@@ -29,3 +30,17 @@ jobs:
run: |
./scripts/build -version $env:VERSION
./scripts/publish-nuget -version $env:VERSION
+ build-extension:
+ runs-on: windows-2022
+ needs: ["test"]
+ if: startsWith(github.ref, 'refs/tags/vs2022-v')
+ steps:
+ - uses: actions/checkout@v3
+ - uses: microsoft/setup-msbuild@v1.1
+ - working-directory: extensions/WinUI3XamlPrevieVS2022
+ run: ./scripts/build-extension -config Release
+ - uses: cezarypiatek/VsixPublisherAction@0.2
+ with:
+ extension-file: './extensions/WinUI3XamlPrevieVS2022/WinUI3XamlPrevieVS2022/bin/Release/net480/WinUI3XamlPrevieVS2022.vsix'
+ publish-manifest-file: './extension/WinUI3XamlPrevieVS2022/vs-publish.json'
+ personal-access-code: ${{ secrets.VS_MARKETPLACE_API_KEY }}
\ No newline at end of file
diff --git a/README.md b/README.md
index f10f69a..69f309a 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,21 @@
# WinUI 3 Xaml Preview (WinUI3XP)
[![nuget](https://img.shields.io/nuget/v/WinUI3XamlPreview)](https://www.nuget.org/packages/WinUI3XamlPreview/)
+[![VS2022](https://img.shields.io/visual-studio-marketplace/v/Roxk.winui3xamlpreview.svg?label=Visual%20Studio%202022%20(Preview))](https://marketplace.visualstudio.com/items?itemName=Roxk.winui3xamlpreview)
[![CI](https://github.com/roxk/WinUI3XamlPreview/actions/workflows/ci.yaml/badge.svg)](https://github.com/roxk/WinUI3XamlPreview/actions/workflows/ci.yaml)
+![Image showcasing how to use WinUI 3 Xaml Preview](hero-banner.gif)
+
WinUI3 Xaml Preview allows you to see a a live preview of your UI while authoring XAML. It is fast, reliable, and comes with basic tools like scaling and size configuration.
-Featurs:
+## Features:
- Interactive preview of your XAML code (powered by `XamlReader`)
- Integration with VS2022 17.9+
- Reload via opening/saving/switching
- Supports your own user control and custom control
- Supports controls in dependency (i.e. libraries)
-Limitation:
+## Limitation:
- Require building the project once before use
- Packaged apps require launching once after build, before use
- Require a few lines of setup
diff --git a/WinUI3XamlPreview/TestPackaged/BlankPage.xaml b/WinUI3XamlPreview/TestPackaged/BlankPage.xaml
index a8272a3..0b80398 100644
--- a/WinUI3XamlPreview/TestPackaged/BlankPage.xaml
+++ b/WinUI3XamlPreview/TestPackaged/BlankPage.xaml
@@ -11,6 +11,6 @@
-
+
diff --git a/WinUI3XamlPreview/scripts/build-nuget.ps1 b/WinUI3XamlPreview/scripts/build-nuget.ps1
index 34a6cc1..d060f4b 100644
--- a/WinUI3XamlPreview/scripts/build-nuget.ps1
+++ b/WinUI3XamlPreview/scripts/build-nuget.ps1
@@ -6,9 +6,9 @@ $template = Get-Content $PSScriptRoot\..\Nuget\WinUI3XamlPreview.nuspec.template
$nuspec = $template.Replace("VERSION", $version)
Set-Content -path $PSScriptRoot\..\Nuget\.nuspec -value $nuspec
. "$PSScriptRoot\get-msbuild"
-nuget restore $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -PackagesDirectory $PSScriptRoot\..\packages
-&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreview -p:Platform=x64,Configuration=Release
-&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreviewCs -p:Platform=x64,Configuration=Release
+nuget restore $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -PackagesDirectory $PSScriptRoot\..\packages | out-host
+&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreview -p:Platform=x64,Configuration=Release | out-host
+&$msbuild $PSScriptRoot\.. -t:WinUI3XamlPreviewCs -p:Platform=x64,Configuration=Release | out-host
# TODO: Fix ARM support. idlgen is attempting to use ARM64/idlgen.exe when the host is x64.
#&$msbuild $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -p:Platform=ARM64,Configuration=Release
-nuget pack $PSScriptRoot\..\Nuget\.nuspec -outputDirectory $PSScriptRoot\..\Nuget
+nuget pack $PSScriptRoot\..\Nuget\.nuspec -outputDirectory $PSScriptRoot\..\Nuget | out-host
diff --git a/WinUI3XamlPreview/scripts/format.ps1 b/WinUI3XamlPreview/scripts/format.ps1
index d617f81..96cc788 100644
--- a/WinUI3XamlPreview/scripts/format.ps1
+++ b/WinUI3XamlPreview/scripts/format.ps1
@@ -10,5 +10,5 @@ if ($check.IsPresent) {
}
$files = get-childitem -r $PSScriptRoot\.. | where { $_.FullName -notMatch 'Generated Files|x64|ARM64|obj|bin|packages' } | where { $_.FullName -Match '.xaml$' }
foreach ($file in $files) {
- dotnet xstyler -r -f $file.FullName $passive
+ dotnet xstyler -r -f $file.FullName $passive | out-host
}
diff --git a/WinUI3XamlPreview/scripts/publish-nuget.ps1 b/WinUI3XamlPreview/scripts/publish-nuget.ps1
index 62fa1b3..6d9224f 100644
--- a/WinUI3XamlPreview/scripts/publish-nuget.ps1
+++ b/WinUI3XamlPreview/scripts/publish-nuget.ps1
@@ -2,5 +2,5 @@ param(
[Parameter(Mandatory=$true)]
[String]$version
)
-nuget setApiKey $env:NUGET_API_KEY
-nuget push $PSScriptRoot\..\Nuget\WinUI3XamlPreview.$version.nupkg -Source https://api.nuget.org/v3/index.json
+nuget setApiKey $env:NUGET_API_KEY | out-host
+nuget push $PSScriptRoot\..\Nuget\WinUI3XamlPreview.$version.nupkg -Source https://api.nuget.org/v3/index.json | out-host
diff --git a/WinUI3XamlPreview/scripts/setup.ps1 b/WinUI3XamlPreview/scripts/setup.ps1
index c52b410..5214c99 100644
--- a/WinUI3XamlPreview/scripts/setup.ps1
+++ b/WinUI3XamlPreview/scripts/setup.ps1
@@ -1 +1 @@
-dotnet tool restore
+dotnet tool restore | out-host
diff --git a/WinUI3XamlPreview/scripts/test.ps1 b/WinUI3XamlPreview/scripts/test.ps1
index c40be21..e9e02f6 100644
--- a/WinUI3XamlPreview/scripts/test.ps1
+++ b/WinUI3XamlPreview/scripts/test.ps1
@@ -1,3 +1,5 @@
. "$PSScriptRoot\get-msbuild"
-&$msbuild $PSScriptRoot\..\TestPacakged\TestPackaged.csproj -t:Restore
-&$msbuild $PSScriptRoot\.. -t:TestPackaged -p:Platform=x64,Configuration=Debug
+&$msbuild $PSScriptRoot\..\TestDep\TestDep.vcxproj -t:Restore | out-host
+&$msbuild $PSScriptRoot\..\WinUI3XamlPreview\WinUI3XamlPreview.vcxproj -t:Restore | out-host
+&$msbuild $PSScriptRoot\..\TestPackaged\TestPackaged.vcxproj -t:Restore | out-host
+&$msbuild $PSScriptRoot\.. -t:TestPackaged -p:Platform=x64,Configuration=Debug | out-host
diff --git a/extensions/WinUI3XamlPreviewVS2022/README.md b/extensions/WinUI3XamlPreviewVS2022/README.md
new file mode 100644
index 0000000..aa6a5b1
--- /dev/null
+++ b/extensions/WinUI3XamlPreviewVS2022/README.md
@@ -0,0 +1,8 @@
+# Welcome to WinUI3 Xaml Preview Extension
+
+## Prerequisite
+- [WinUI3XamlPreview](https://www.nuget.org/packages/WinUI3XamlPreview/) nuget on nuget gallery.
+
+## Getting started
+
+Refer to the readme in https://github.com/roxk/WinUI3XamlPreview for more instructions.
\ No newline at end of file
diff --git a/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest b/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest
index 31c525a..e769afe 100644
--- a/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest
+++ b/extensions/WinUI3XamlPreviewVS2022/WinUI3XamlPreviewVS2022/source.extension.vsixmanifest
@@ -1,9 +1,10 @@
-
- WinUI3XamlPreviewVS2022
- VisualStudio.Extensibility Extension with VSSDK Compatibility.
+
+ WinUI3XamlPreview VS2022 Extension
+ This extension allows developers to see a live preview while writing XAML in WinUI 3
+ WinUI3, WinUI 3, WinUI, XAML, Preview, Live Preview
true
diff --git a/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1 b/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1
new file mode 100644
index 0000000..3d77ab0
--- /dev/null
+++ b/extensions/WinUI3XamlPreviewVS2022/scripts/build-extension.ps1
@@ -0,0 +1,14 @@
+param(
+ [boolean]$buildClang,
+ [string]$config
+)
+
+if (!($config -eq "Release" -or $config -eq "Debug")) {
+ echo "Uknown config: $config. -config [Release|Debug]"
+ exit 1
+}
+
+$srcDir = "$PSScriptRoot"
+$solutionDir = "$srcDir\.."
+msbuild "${solutionDir}WinUI3XamlPreviewVS2022\WinUI3XamlPreviewVS2022.csproj" -restore
+msbuild $solutionDir -t:WinUI3XamlPreviewVS2022 -p:Configuration=$config
diff --git a/extensions/WinUI3XamlPreviewVS2022/vs-publish.json b/extensions/WinUI3XamlPreviewVS2022/vs-publish.json
new file mode 100644
index 0000000..16f2042
--- /dev/null
+++ b/extensions/WinUI3XamlPreviewVS2022/vs-publish.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json.schemastore.org/vsix-publish",
+ "categories": [ "programming languages" ],
+ "identity": {
+ "internalName": "winui3xamlpreview",
+ "tags": [ "WinUI3", "WinUI 3", "WinUI", "XAML", "Preview", "Live Preview" ]
+ },
+ "assetFiles": [],
+ "overview": "README.md",
+ "publisher": "Roxk",
+ "repo": "https://github.com/roxk/WinUI3XamlPreview"
+}
diff --git a/hero-banner.gif b/hero-banner.gif
new file mode 100644
index 0000000..7e40a3d
Binary files /dev/null and b/hero-banner.gif differ