forked from xiaoyaocz/biliuwp-lite
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #954 from ywmoyue/dev
4.7.8
- Loading branch information
Showing
168 changed files
with
5,243 additions
and
3,885 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
param ( | ||
[string]$csprojPath | ||
) | ||
|
||
# Check if the input file exists | ||
if (-not (Test-Path $csprojPath)) { | ||
Write-Error "File not found: $csprojPath" | ||
exit 1 | ||
} | ||
|
||
# Read the content of the csproj file with UTF-8 encoding | ||
$csprojContent = Get-Content -Path $csprojPath -Raw -Encoding UTF8 | ||
|
||
# Define the target PropertyGroup condition | ||
# Use backticks to escape the $ character | ||
$targetCondition = "'`$(Configuration)|`$(Platform)' == 'Release|x64'" | ||
|
||
# Find the PropertyGroup with the target condition | ||
$propertyGroupRegex = [regex]::Escape("<PropertyGroup Condition=`"$targetCondition`">") + ".*?" + [regex]::Escape("</PropertyGroup>") | ||
$propertyGroupMatch = [regex]::Match($csprojContent, $propertyGroupRegex, [Text.RegularExpressions.RegexOptions]::Singleline) | ||
|
||
if ($propertyGroupMatch.Success) { | ||
# Extract the PropertyGroup content | ||
$propertyGroupContent = $propertyGroupMatch.Value | ||
|
||
# Check if UseDotNetNativeToolchain exists in the PropertyGroup | ||
$useDotNetNativeToolchainRegex = [regex]::Escape("<UseDotNetNativeToolchain>") + ".*?" + [regex]::Escape("</UseDotNetNativeToolchain>") | ||
$useDotNetNativeToolchainMatch = [regex]::Match($propertyGroupContent, $useDotNetNativeToolchainRegex) | ||
|
||
if ($useDotNetNativeToolchainMatch.Success) { | ||
# Replace the value of UseDotNetNativeToolchain with true | ||
$updatedPropertyGroupContent = $propertyGroupContent -replace $useDotNetNativeToolchainRegex, "<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>" | ||
} else { | ||
# If UseDotNetNativeToolchain doesn't exist, add it | ||
$updatedPropertyGroupContent = $propertyGroupContent -replace "</PropertyGroup>", "<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain></PropertyGroup>" | ||
} | ||
|
||
# Replace the original PropertyGroup with the updated one | ||
$csprojContent = $csprojContent -replace [regex]::Escape($propertyGroupContent), $updatedPropertyGroupContent | ||
|
||
# Write the updated content back to the file with UTF-8 encoding | ||
Set-Content -Path $csprojPath -Value $csprojContent -Encoding UTF8 | ||
|
||
Write-Host "Updated UseDotNetNativeToolchain to true in the PropertyGroup with condition '$targetCondition'." | ||
} else { | ||
Write-Warning "PropertyGroup with condition '$targetCondition' not found in the csproj file." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<LangVersion>latest</LangVersion> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{32288EDB-3F7F-479A-8303-7BB6705E0636}</ProjectGuid> | ||
<OutputType>winmdobj</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>BackgroundTasks</RootNamespace> | ||
<AssemblyName>BackgroundTasks</AssemblyName> | ||
<DefaultLanguage>zh-CN</DefaultLanguage> | ||
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> | ||
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.22621.0</TargetPlatformVersion> | ||
<TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion> | ||
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<AllowCrossPlatformRetargeting>false</AllowCrossPlatformRetargeting> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\x86\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>full</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<OutputPath>bin\x86\Release\</OutputPath> | ||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>pdbonly</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> | ||
<PlatformTarget>ARM</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\ARM\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>full</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'"> | ||
<PlatformTarget>ARM</PlatformTarget> | ||
<OutputPath>bin\ARM\Release\</OutputPath> | ||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>pdbonly</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'"> | ||
<PlatformTarget>ARM64</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\ARM64\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>full</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'"> | ||
<PlatformTarget>ARM64</PlatformTarget> | ||
<OutputPath>bin\ARM64\Release\</OutputPath> | ||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>pdbonly</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\x64\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>full</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
<ProduceReferenceWinmd>true</ProduceReferenceWinmd> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<OutputPath>bin\x64\Release\</OutputPath> | ||
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<NoWarn>;2008</NoWarn> | ||
<DebugType>pdbonly</DebugType> | ||
<UseVSHostingProcess>false</UseVSHostingProcess> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="TileFeedBackgroundTask.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> | ||
<Version>6.2.14</Version> | ||
</PackageReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\BiliLite.UWP\BiliLite.UWP.csproj"> | ||
<Project>{8b90b3b3-844b-4610-9dcf-c9b250182ae3}</Project> | ||
<Name>BiliLite.UWP</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> | ||
<VisualStudioVersion>14.0</VisualStudioVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<StartupObject /> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> | ||
<!-- 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"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// 有关程序集的一般信息由以下 | ||
// 控制。更改这些特性值可修改 | ||
// 与程序集关联的信息。 | ||
[assembly: AssemblyTitle("BackgroundTasks")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("BackgroundTasks")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// 程序集的版本信息由下列四个值组成: | ||
// | ||
// 主版本 | ||
// 次版本 | ||
// 生成号 | ||
// 修订号 | ||
// | ||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 | ||
//通过使用 "*",如下所示: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] | ||
[assembly: ComVisible(false)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Diagnostics; | ||
using Windows.ApplicationModel.Background; | ||
using BiliLite.Extensions.Notifications; | ||
|
||
namespace BackgroundTasks | ||
{ | ||
public sealed class TileFeedBackgroundTask : IBackgroundTask | ||
{ | ||
public void Run(IBackgroundTaskInstance taskInstance) | ||
{ | ||
Debug.WriteLine("================ debug to updating tiles ================"); | ||
|
||
// Get a deferral, to prevent the task from closing prematurely | ||
// while asynchronous code is still running. | ||
var deferral = taskInstance.GetDeferral(); | ||
|
||
NotificationShowExtensions.Tile(); | ||
|
||
// Inform the system that the task is finished. | ||
deferral.Complete(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.