Skip to content

Commit

Permalink
Merge branch 'main' into housekeeping/fix-codeformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Mar 11, 2021
2 parents 11a95bd + 37a3743 commit 869737d
Show file tree
Hide file tree
Showing 48 changed files with 509 additions and 286 deletions.
6 changes: 5 additions & 1 deletion eng/pipelines/common/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ steps:
provisioning_script: $(provisionator.path)
provisioning_extra_args: $(provisionator.extraArguments)

- template: dotnet-install.yml

- powershell: |
$(System.DefaultWorkingDirectory)/build.ps1 --target provision --TeamProject="$(System.TeamProject)"
displayName: 'Cake Provision'
Expand All @@ -38,7 +40,6 @@ steps:

- task: VSTest@2
displayName: 'XAML Unit Tests'
continueOnError: true
inputs:
testAssemblyVer2: |
**/bin/$(BuildConfiguration)/**/Microsoft.Maui.Controls.Xaml.UnitTests.dll
Expand All @@ -47,6 +48,9 @@ steps:
testRunTitle: '$(BuildConfiguration)_UnitTests'
configuration: '$(BuildConfiguration)'
diagnosticsEnabled: true
# Disable code coverage in child processes
# See: https://github.com/Microsoft/vstest/issues/1263
otherConsoleOptions: -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.CodeCoverage.CollectFromChildProcesses=False

- task: DotNetCoreCLI@2
displayName: 'Unit Tests'
Expand Down
27 changes: 27 additions & 0 deletions eng/pipelines/common/dotnet-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This template enables installation of stable and main/nightly builds of .NET.

parameters:
version: $(DotNetVersion)
root: $(DotNet.Root)
tools: $(DotNet.Tools)

steps:

# Use dotnet-install.ps1 on Windows
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version ${{ parameters.version }} -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
& dotnet --list-sdks
displayName: install .NET ${{ parameters.version }}
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Use dotnet-install.sh on macOS
- bash: >
export PATH="${{ parameters.root }}:${{ parameters.tools }}:$PATH" &&
curl -L https://dot.net/v1/dotnet-install.sh > dotnet-install.sh &&
sh dotnet-install.sh --version ${{ parameters.version }} --install-dir "${{ parameters.root }}" --verbose &&
dotnet --list-sdks &&
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: install .NET ${{ parameters.version }}
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
34 changes: 6 additions & 28 deletions eng/pipelines/handlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,8 @@ stages:
pool:
vmImage: windows-latest
steps:
- pwsh: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version $(DotNetVersion) -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
& dotnet --list-sdks
displayName: install .NET $(DotNetVersion)
errorActionPreference: stop

- template: common/dotnet-install.yml

- pwsh: |
& dotnet tool install --global boots
Expand Down Expand Up @@ -193,13 +188,7 @@ stages:
version: 3.1.x
installationPath: $(DotNet.Root)

- bash: >
export PATH="$(DotNet.Root):$(DotNet.Tools):$PATH" &&
curl -L https://dot.net/v1/dotnet-install.sh > dotnet-install.sh &&
sh dotnet-install.sh --version $(DotNetVersion) --install-dir $DOTNET_ROOT --verbose &&
dotnet --list-sdks &&
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: install .NET $(DotNetVersion)
- template: common/dotnet-install.yml

- bash: |
dotnet tool install --global boots
Expand Down Expand Up @@ -254,13 +243,8 @@ stages:
release:
BuildConfiguration: 'Release'
steps:
- powershell: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile dotnet-install.ps1
& .\dotnet-install.ps1 -Version $(DotNetVersion) -InstallDir "$env:ProgramFiles\dotnet\" -Verbose
& dotnet --list-sdks
displayName: install .NET $(DotNetVersion)
errorActionPreference: stop

- template: common/dotnet-install.yml

- powershell: |
& dotnet tool install --global boots
Expand Down Expand Up @@ -306,13 +290,7 @@ stages:
version: 3.1.x
installationPath: $(DotNet.Root)

- bash: >
export PATH="$(DotNet.Root):$(DotNet.Tools):$PATH" &&
curl -L https://dot.net/v1/dotnet-install.sh > dotnet-install.sh &&
sh dotnet-install.sh --version $(DotNetVersion) --install-dir $DOTNET_ROOT --verbose &&
dotnet --list-sdks &&
echo "##vso[task.setvariable variable=PATH]$PATH"
displayName: install .NET $(DotNetVersion)
- template: common/dotnet-install.yml

- bash: |
dotnet tool install --global boots
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ void UpdateGravity()
_lastSizeRequest = null;
}

[PortHandler]
void UpdateCharacterSpacing()
{
if (Forms.IsLollipopOrNewer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public ProgressBarRenderer(Context context) : base(context)
AutoPackage = false;
}

[PortHandler]
protected override AProgressBar CreateNativeControl()
{
return new AProgressBar(Context, null, global::Android.Resource.Attribute.ProgressBarStyleHorizontal) { Indeterminate = false, Max = 10000 };
Expand Down Expand Up @@ -81,6 +82,7 @@ internal virtual protected void UpdateProgressColor()
}
}

[PortHandler]
void UpdateProgress()
{
Control.Progress = (int)(Element.Progress * 10000);
Expand Down
3 changes: 3 additions & 0 deletions src/Compatibility/Core/src/iOS/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ internal static DeviceOrientation ToDeviceOrientation(this UIDeviceOrientation o
}
}

[PortHandler]
internal static NSMutableAttributedString AddCharacterSpacing(this NSAttributedString attributedString, string text, double characterSpacing)
{
if (attributedString == null && characterSpacing == 0)
Expand All @@ -174,6 +175,7 @@ internal static NSMutableAttributedString AddCharacterSpacing(this NSAttributedS
return mutableAttributedString;
}

[PortHandler]
internal static bool HasCharacterAdjustment(this NSMutableAttributedString mutableAttributedString)
{
if (mutableAttributedString == null)
Expand All @@ -189,6 +191,7 @@ internal static bool HasCharacterAdjustment(this NSMutableAttributedString mutab
return false;
}

[PortHandler]
internal static void AddKerningAdjustment(NSMutableAttributedString mutableAttributedString, string text, double characterSpacing)
{
if (!string.IsNullOrEmpty(text))
Expand Down
1 change: 1 addition & 0 deletions src/Compatibility/Core/src/iOS/Renderers/LabelRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ void UpdateLineBreakMode()
#endif
}

[PortHandler]
void UpdateCharacterSpacing()
{
if (IsElementOrControlEmpty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public override SizeF SizeThatFits(SizeF size)
return new SizeF(10, result.Height);
}

[PortHandler]
protected override void OnElementChanged(ElementChangedEventArgs<ProgressBar> e)
{
if (e.NewElement != null)
Expand Down Expand Up @@ -59,6 +60,7 @@ void UpdateProgressColor()
Control.ProgressTintColor = Element.ProgressColor == Color.Default ? null : Element.ProgressColor.ToUIColor();
}

[PortHandler]
void UpdateProgress()
{
Control.Progress = (float)Element.Progress;
Expand Down
4 changes: 4 additions & 0 deletions src/Controls/samples/Controls.Sample/Pages/MainPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ void SetupMauiLayout()
verticalStack.Add(new Entry { Placeholder = "This should be placeholder text" });
verticalStack.Add(new Entry { Text = "This should be read only property", IsReadOnly = true });

verticalStack.Add(new ProgressBar { Progress = 0.5 });
verticalStack.Add(new ProgressBar { Progress = 0.5, BackgroundColor = Color.LightCoral });
verticalStack.Add(new ProgressBar { Progress = 0.5, ProgressColor = Color.Purple });

verticalStack.Add(new Slider());

verticalStack.Add(new Switch());
Expand Down
7 changes: 7 additions & 0 deletions src/Controls/src/Core/HandlerImpl/ProgressBar.Impl.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Microsoft.Maui.Controls
{
public partial class ProgressBar : IProgress
{

}
}
2 changes: 1 addition & 1 deletion src/Controls/src/Core/ProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Microsoft.Maui.Controls
{
public class ProgressBar : View, IElementConfiguration<ProgressBar>
public partial class ProgressBar : View, IElementConfiguration<ProgressBar>
{
public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(ProgressBar), Color.Default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<ItemGroup>
<PackageReference Include="JetBrains.DotMemoryUnit" Version="3.1.20200127.214830" />
<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="Mono.Cecil" Version="0.11.3" />
<PackageReference Include="System.CodeDom" Version="5.0.0" />
Expand Down
Loading

0 comments on commit 869737d

Please sign in to comment.