Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class RemoteControlGenerator : ISourceGenerator
"SolutionDir",
"SolutionExt",
"BuildingInsideVisualStudio",
"UnoPlatformIDE",
"UnoRemoteControlPort",
"UseHostCompilerIfAvailable",
"TargetFramework",
Expand Down
20 changes: 20 additions & 0 deletions src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
<UsingTask Condition="'$(_IsUnoUISolution)'==''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.Assets.RetargetAssets_v0" />
<UsingTask Condition="'$(_IsUnoUISolution)'==''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.RuntimeAssetsSelector.RuntimeAssetsSelectorTask_v0" />
<UsingTask Condition="'$(_IsUnoUISolution)'==''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.RuntimeAssetsValidator.RuntimeAssetsValidatorTask_v0" />
<UsingTask Condition="'$(_IsUnoUISolution)'==''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.HotReloadInfo.HotReloadInfoTask_v0" />

<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.ResourcesGenerator.ResourcesGenerationTask_v0" TaskFactory="TaskHostFactory"/>
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.ResourcesGenerator.UpriFeaturesGeneratorTask_v0" TaskFactory="TaskHostFactory"/>
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.ResourcesGenerator.UpriSubstitutionsGeneratorTask_v0" TaskFactory="TaskHostFactory" />
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.Assets.RetargetAssets_v0" TaskFactory="TaskHostFactory" />
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.RuntimeAssetsSelector.RuntimeAssetsSelectorTask_v0" TaskFactory="TaskHostFactory" />
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.RuntimeAssetsValidator.RuntimeAssetsValidatorTask_v0" TaskFactory="TaskHostFactory" />
<UsingTask Condition="'$(_IsUnoUISolution)'!=''" AssemblyFile="$(UnoUIMSBuildTasksPath)\Uno.UI.Tasks.v0.dll" TaskName="Uno.UI.Tasks.HotReloadInfo.HotReloadInfoTask_v0" TaskFactory="TaskHostFactory" />

<Target Name="_UnoLangSetup">
<!-- String resources -->
Expand Down Expand Up @@ -102,7 +104,7 @@
<_ResourceStampFile>$(IntermediateOutputPath)g\uno.stamp</_ResourceStampFile>
</PropertyGroup>

<ResourcesGenerationTask_v0 Resources="@(PRIResourceWithTargetPath)"

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/PagerControl/Strings/zh-TW/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/PagerControl/Strings/zh-CN/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/PagerControl/Strings/quz-PE/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/PagerControl/Strings/pa-IN/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/PagerControl/Strings/ca-Es-VALENCIA/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/CommandBarFlyout/Strings/zh-TW/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/CommandBarFlyout/Strings/zh-CN/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/CommandBarFlyout/Strings/quz-PE/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/CommandBarFlyout/Strings/pa-IN/Resources.resw, could not determine the language

Check warning on line 107 in src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Ignoring resource UI/Xaml/Controls/CommandBarFlyout/Strings/ca-Es-VALENCIA/Resources.resw, could not determine the language
TargetProjectDirectory="$(ProjectDir)"
TargetPlatform="$(_UnoUnderlyingPlatform)"
OutputPath="$(_ResourceOutputPath)"
Expand Down Expand Up @@ -422,4 +424,22 @@
</Task>
</UsingTask>

<Target
Name="_GenerateHotReloadInfo"
BeforeTargets="BeforeCompile"
Condition="'$(Configuration)'=='Debug' OR '$(UnoForceHotReloadCodeGen)' == 'true'">

<HotReloadInfoTask_v0
IntermediateOutputPath="$(IntermediateOutputPath)">
<Output
TaskParameter="GeneratedFiles"
ItemName="_HotReloadInfoTaskGeneratedFiles" />
</HotReloadInfoTask_v0>

<ItemGroup>
<Compile Include="@(_HotReloadInfoTaskGeneratedFiles)" />
</ItemGroup>

</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
ο»Ώusing System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

namespace Uno.UI.Tasks.HotReloadInfo;

public class HotReloadInfoTask_v0 : Microsoft.Build.Utilities.Task
{
[Required]
public string IntermediateOutputPath { get; set; }

[Output]
public ITaskItem[] GeneratedFiles { get; set; }

/// <inheritdoc />
public override bool Execute()
{
var attributePath = Path.Combine(IntermediateOutputPath, "Uno.HotReloadInfo.Attribute.g.cs");
var infoPath = Path.Combine(IntermediateOutputPath, "Uno.HotReloadInfo.g.cs");

Log.LogMessage($"Generating hot-reload info to : {infoPath}");

try
{
File.WriteAllText(attributePath, HotReloadInfoHelper.GenerateAttribute(infoPath));
File.WriteAllText(infoPath, HotReloadInfoHelper.GenerateInfo());

GeneratedFiles =
[
new TaskItem(attributePath, new Dictionary<string, string>
{
{ "Generator", "Uno.UI.Tasks.HotReloadInfo" },
{ "GeneratorVersion", typeof(HotReloadInfoTask_v0).Assembly.GetName().Version.ToString() }
}),
new TaskItem(infoPath, new Dictionary<string, string>
{
{ "Generator", "Uno.UI.Tasks.HotReloadInfo" },
{ "GeneratorVersion", typeof(HotReloadInfoTask_v0).Assembly.GetName().Version.ToString() }
})
];

return true;
}
catch (Exception ex)
{
Log.LogError($"Failed to generate hot-reload info. Details: {ex.Message}");
}

return false;
}
}
2 changes: 2 additions & 0 deletions src/SourceGenerators/Uno.UI.Tasks/Uno.UI.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
<Link>Resources\AndroidResourceNameEncoder.cs</Link>
</Compile>
<Compile Include="..\Uno.UI.SourceGenerators\BindableTypeProviders\LinkerHintsHelpers.cs" Link="Helpers\LinkerHintsHelpers.cs" />
<Compile Include="..\..\Uno.UI.RemoteControl\HotReload\HotReloadInfoHelper.cs" Link="HotReloadInfo/%(Filename)%(Extension)" />

</ItemGroup>

<Target Name="_copyUnoTasksBuildTime" AfterTargets="Build">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
ο»Ώ#nullable enable
namespace Uno.UI.RemoteControl.Messaging.IdeChannel;

/// <summary>
/// Message sent to the IDE to update the status of a component within the uno development environment.
/// </summary>
/// <param name="Component">Identifier of the component to which this message refers.</param>
/// <param name="Status">The status of the component.</param>
/// <param name="Description">User-friendly description of the current status (e.g. "Searching for uno packages.").</param>
/// <param name="Description">Set of actions the user can perform regarding the current status (a good practice is to always provide at least one action)</param>
public record DevelopmentEnvironmentStatusIdeMessage(
DevelopmentEnvironmentComponent Component,
DevelopmentEnvironmentStatus Status,
string? Description,
Command[] Actions);

/// <summary>
/// Represents a component within the development environment, including its identifier and description.
/// </summary>
/// <param name="Id">
/// The unique identifier of the development environment component
/// (e.g. uno.dev_server)
/// </param>
/// <param name="Description">
/// A user-friendly description of the development environment component
/// (e.g. "The local server that allows the application to interact with the IDE and the file-system.").
/// </param>
public record DevelopmentEnvironmentComponent(string Id, string Description)
{
// Well-known components of the development environment, this is **NOT** an exhaustive list!
public static DevelopmentEnvironmentComponent Solution { get; } = new("uno.solution", "Load of the solution, resolution of nuget packages and validation of uno's SDK version.");
public static DevelopmentEnvironmentComponent UnoCheck { get; } = new("uno.check", "Validates all external dependencies has been installed on the computer.");
public static DevelopmentEnvironmentComponent DevServer { get; } = new("uno.dev_server", "The local server that allows the application to interact with the IDE and the file-system.");
}

/// <summary>
/// Possible statuses of a component within the uno development environment.
/// </summary>
public enum DevelopmentEnvironmentStatus
{
/// <summary>
/// The given component of the uno development environment is initializing.
/// </summary>
Initializing,

/// <summary>
/// The given component of the uno development environment is disabled.
/// (e.g. the solution is not a Uno solution)
/// </summary>
Disabled,

/// <summary>
/// Indicates that the given component of the uno development environment is ready for use.
/// </summary>
Ready,

/// <summary>
/// Represents an error status of a given component of the uno development environment which we are trying to recover from.
/// (e.g. dev-server crashed and is being restarted)
/// </summary>
Warning,

/// <summary>
/// Represents an error status of a given component of the uno development environment.
/// Unlike the warning state, this is a final state.
/// </summary>
Error,
}
12 changes: 11 additions & 1 deletion src/Uno.UI.RemoteControl.Messaging/IdeChannel/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ namespace Uno.UI.RemoteControl.Messaging.IdeChannel;
/// <param name="Text">Text content to display to the user.</param>
/// <param name="Name">The name/id of the command (e.g. uno.hotreload.open_hotreload_window).</param>
/// <param name="Parameter">A json serialized parameter to execute the command.</param>
public record Command(string Text, string Name, string? Parameter = null);
public record Command(string Text, string Name, string? Parameter = null)
{
/// <summary>
/// Creates a command that requests to the IDE to open a link in the browser (internal or external).
/// </summary>
/// <param name="Text">User-friendly text for the link.</param>
/// <param name="Uri">Uri to navigate to.</param>
/// <returns></returns>
public Command OpenBrowser(string Text, Uri Uri)
=> new(Text, "ide.open_browser", Uri.ToString());
}
Loading
Loading