Skip to content

Commit

Permalink
现在可以在 cpp/winrt 上调用了
Browse files Browse the repository at this point in the history
  • Loading branch information
wherewhere committed Jul 18, 2023
1 parent 339d49f commit 662fa5b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Decode the pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
$certificatePath = Join-Path -Path $env:Project_Directory -ChildPath TextReader_TemporaryKey.pfx
$certificatePath = Join-Path -Path $env:Project_Directory -ChildPath MicaDemo_TemporaryKey.pfx
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
Expand All @@ -45,7 +45,7 @@ jobs:

# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Solution_Name /p:AppxBundlePlatforms="$env:Appx_Bundle_Platforms" /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:AppxPackageDir="$env:Appx_Package_Dir" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="0CDF4A03E9BE9DD789894BB3C7AD3DEDECD9AB25" /p:PackageCertificateKeyFile=TextReader_TemporaryKey.pfx /p:PackageCertificatePassword="$env:Password"
run: msbuild $env:Solution_Name /p:AppxBundlePlatforms="$env:Appx_Bundle_Platforms" /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:AppxPackageDir="$env:Appx_Package_Dir" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="0CDF4A03E9BE9DD789894BB3C7AD3DEDECD9AB25" /p:PackageCertificateKeyFile=MicaDemo_TemporaryKey.pfx /p:PackageCertificatePassword="$env:Password"
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64|ARM
Expand Down
5 changes: 1 addition & 4 deletions MicaForUWP/Media/BackdropBlurBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,11 @@ protected override void OnConnected()
backdrop = Compositor.CreateHostBackdropBrush();
break;
case BackgroundSource.WallpaperBackdrop:
#if !NET
if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "TryCreateBlurredWallpaperBackdropBrush"))
{
backdrop = Compositor.TryCreateBlurredWallpaperBackdropBrush();
}
else
#endif
if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateHostBackdropBrush"))
else if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateHostBackdropBrush"))
{
backdrop = Compositor.CreateHostBackdropBrush();
}
Expand Down
5 changes: 1 addition & 4 deletions MicaForUWP/Media/BackdropMicaBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,14 +387,11 @@ protected override void OnConnected()
backdrop = Compositor.CreateHostBackdropBrush();
break;
case BackgroundSource.WallpaperBackdrop:
#if !NET
if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "TryCreateBlurredWallpaperBackdropBrush"))
{
backdrop = Compositor.TryCreateBlurredWallpaperBackdropBrush();
}
else
#endif
if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateHostBackdropBrush"))
else if (ApiInformation.IsMethodPresent("Windows.UI.Composition.Compositor", "CreateHostBackdropBrush"))
{
backdrop = Compositor.CreateHostBackdropBrush();
}
Expand Down
9 changes: 5 additions & 4 deletions MicaForUWP/MicaForUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<NuspecFile Condition="'$(FullTargets)' == 'true'">MicaForUWP.nuspec</NuspecFile>
<PackageIcon>Icon.png</PackageIcon>
<PackageIconUrl>https://raw.githubusercontent.com/wherewhere/Mica-For-UWP/main/logo.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand All @@ -33,7 +32,8 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
<PropertyGroup Condition="'$(FullTargets)' == 'true'">
<NuspecFile>MicaForUWP.nuspec</NuspecFile>
<NuspecProperties>id=$(AssemblyName);version=$(VersionPrefix);title=$(Title);authors=$(Authors);requireLicenseAcceptance=$(PackageRequireLicenseAcceptance);license=$(PackageLicenseExpression);icon=$(PackageIcon);projectUrl=$(PackageProjectUrl);iconUrl=$(PackageIconUrl);description=$(Description);releaseNotes=$(PackageReleaseNotes);copyright=$(Copyright);repositoryType=$(RepositoryType);repositoryUrl=$(PackageProjectUrl);repositoryCommit=$(RepositoryCommit);buildOutput=bin\$(Configuration)</NuspecProperties>
</PropertyGroup>

Expand All @@ -55,8 +55,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows10.0.22621.0'">
<PackageReference Include="Dongle.WindowsSDK.NET" Version="10.0.22621.755" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.2" />
<PackageReference Include="Dongle.WindowsSDK.NET" Version="10.0.22621.756" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.3" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
Expand All @@ -72,6 +72,7 @@
<ItemGroup>
<None Include="..\logo.png" Pack="true" PackagePath="\Icon.png" />
<None Remove="MicaForUWP.nuspec" />
<None Remove="MicaForUWP.targets" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions MicaForUWP/MicaForUWP.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<version>$version$</version>
<title>$title$</title>
<authors>$authors$</authors>
<owners></owners>
<requireLicenseAcceptance>$requireLicenseAcceptance$</requireLicenseAcceptance>
<license type="expression">$license$</license>
<icon>$icon$</icon>
Expand All @@ -29,8 +28,8 @@
</group>
<!--
<group targetFramework="net6.0-windows10.0.22621">
<dependency id="Dongle.WindowsSDK.NET" version="10.0.22621.755" exclude="Build,Analyzers" />
<dependency id="Microsoft.Windows.CsWinRT" version="2.0.2" exclude="Build,Analyzers" />
<dependency id="Dongle.WindowsSDK.NET" version="10.0.22621.756" exclude="Build,Analyzers" />
<dependency id="Microsoft.Windows.CsWinRT" version="2.0.3" exclude="Build,Analyzers" />
<dependency id="Win2D.uwp" version="1.26.0" exclude="Build,Analyzers" />
</group>
-->
Expand All @@ -41,6 +40,7 @@
</metadata>
<files>
<file src="..\logo.png" target="Icon.png" />
<file src="MicaForUWP.targets" target="build\native\MicaForUWP.targets" />
<file src="$buildOutput$\native\MicaForUWP.*" target="lib\native\" />
<!--
<file src="$buildOutput$\net6.0-windows10.0.22621.0\MicaForUWP.*" target="lib\net6.0-windows10.0.22621.0\" />
Expand Down
10 changes: 10 additions & 0 deletions MicaForUWP/MicaForUWP.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<Reference Include="MicaForUWP">
<HintPath>$(MSBuildThisFileDirectory)..\..\lib\native\MicaForUWP.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>

</Project>

0 comments on commit 662fa5b

Please sign in to comment.