-
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #5 from egvijayanand/working
Initial release of VijayAnand.MauiToolkit.* NuGet packages
- Loading branch information
Showing
26 changed files
with
700 additions
and
1 deletion.
There are no files selected for viewing
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,8 @@ | ||
{ | ||
"folders": [ | ||
{ | ||
"path": "." | ||
} | ||
], | ||
"settings": {} | ||
} |
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 @@ | ||
VijayAnand.MauiToolkit.Core |
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,5 @@ | ||
:: Creates a new NuGet package from the project file in Debug configuration | ||
@echo off | ||
|
||
call Create-Package.bat Debug | ||
pause |
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,60 @@ | ||
:: Creates a new NuGet package from the project file | ||
@echo off | ||
|
||
if [%1]==[] (call Error "Build configuration input is not provided." & goto end) | ||
|
||
set config=%1 | ||
|
||
:: Package Name | ||
|
||
if not exist CorePackageName.txt (call Error "Core package name file not available." & goto end) | ||
|
||
set /P corePkgName=<CorePackageName.txt | ||
|
||
if [%corePkgName%]==[] (call Error "Core package name not configured." & goto end) | ||
|
||
if not exist ToolkitPackageName.txt (call Error "Toolkit package name file not available." & goto end) | ||
|
||
set /P toolkitPkgName=<ToolkitPackageName.txt | ||
|
||
if [%toolkitPkgName%]==[] (call Error "Toolkit package name not configured." & goto end) | ||
|
||
:: Package Version | ||
|
||
if not exist PackageVersion.txt (call Error "Version file not available." & goto end) | ||
|
||
set /P pkgVersion=<PackageVersion.txt | ||
|
||
if [%pkgVersion%]==[] (call Error "Version # not configured." & goto end) | ||
|
||
:: .NET SDK Version | ||
|
||
dotnet --version | ||
|
||
:: Package Configuration | ||
|
||
call Info "Core Package: %corePkgName% ver. %pkgVersion%" | ||
call Info "Toolkit Package: %toolkitPkgName% ver. %pkgVersion%" | ||
|
||
call Info "Delete existing package ..." | ||
|
||
if exist .\VijayAnand.MauiToolkit.Core\bin\%config%\%corePkgName%.%pkgVersion%.nupkg del .\VijayAnand.MauiToolkit.Core\bin\%config%\%corePkgName%.%pkgVersion%.nupkg | ||
|
||
if exist .\VijayAnand.MauiToolkit\bin\%config%\%toolkitPkgName%.%pkgVersion%.nupkg del .\VijayAnand.MauiToolkit\bin\%config%\%toolkitPkgName%.%pkgVersion%.nupkg | ||
|
||
call Info "Creating NuGet package ..." | ||
|
||
dotnet build .\VijayAnand.MauiToolkit.Core\VijayAnand.MauiToolkit.Core.csproj -c %config% -p:PackageVersion=%pkgVersion% -p:ContinuousIntegrationBuild=true | ||
|
||
if not %errorlevel% == 0 (call Error "Core package creation failed." & goto end) | ||
|
||
echo. | ||
:: Adding NuGet reference | ||
::dotnet add .\VijayAnand.MauiToolkit\VijayAnand.MauiToolkit.csproj package %corePkgName% --version %pkgVersion% | ||
|
||
dotnet build .\VijayAnand.MauiToolkit\VijayAnand.MauiToolkit.csproj -c %config% -p:PackageVersion=%pkgVersion% -p:ContinuousIntegrationBuild=true | ||
|
||
echo. | ||
if %errorlevel% == 0 (call Success "Process completed.") else (call Error "Toolkit package creation failed.") | ||
|
||
:end |
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,5 @@ | ||
:: Creates a new NuGet package from the project file in Release configuration | ||
@echo off | ||
|
||
call Create-Package.bat Release | ||
pause |
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 @@ | ||
1.0.0-pre1 |
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,67 @@ | ||
:: Installs the NuGet package | ||
@echo off | ||
|
||
if defined MyGetSource (set "nugetSource=%MyGetSource%") else (set nugetSource=E:\Tasks\Projects\Templates\Release\NuGet\Packages) | ||
|
||
:: Package Name | ||
|
||
if not exist CorePackageName.txt (call Error "Core package name file not available." & goto end) | ||
|
||
set /P corePkgName=<CorePackageName.txt | ||
|
||
if [%corePkgName%]==[] (call Error "Core package name not configured." & goto end) | ||
|
||
if not exist ToolkitPackageName.txt (call Error "Maui package name file not available." & goto end) | ||
|
||
set /P toolkitPkgName=<ToolkitPackageName.txt | ||
|
||
if [%toolkitPkgName%]==[] (call Error "Maui package name not configured." & goto end) | ||
|
||
:: Package Version | ||
|
||
if not exist PackageVersion.txt (call Error "Package version file not available." & goto end) | ||
|
||
set /P pkgVersion=<PackageVersion.txt | ||
|
||
if [%pkgVersion%]==[] (call Error "Package version # not configured." & goto end) | ||
|
||
:: Existence Check | ||
|
||
if not exist .\VijayAnand.MauiToolkit.Core\bin\Release\%corePkgName%.%pkgVersion%.nupkg call Error "Core NuGet package not avilable ..." & goto end | ||
|
||
if not exist .\VijayAnand.MauiToolkit\bin\Release\%toolkitPkgName%.%pkgVersion%.nupkg call Error "Toolkit NuGet package not avilable ..." & goto end | ||
|
||
:: Validate the Package | ||
|
||
call Info "Validating %corePkgName% ver. %pkgVersion% ..." | ||
|
||
dotnet-validate package local .\VijayAnand.MauiToolkit.Core\bin\Release\%corePkgName%.%pkgVersion%.nupkg | ||
|
||
call Info "Validating %toolkitPkgName% ver. %pkgVersion% ..." | ||
|
||
dotnet-validate package local .\VijayAnand.MauiToolkit\bin\Release\%toolkitPkgName%.%pkgVersion%.nupkg | ||
|
||
:: Directory Check | ||
|
||
if not exist "%nugetSource%\%corePkgName%\" mkdir "%nugetSource%\%corePkgName%" | ||
|
||
if not exist "%nugetSource%\%toolkitPkgName%\" mkdir "%nugetSource%\%toolkitPkgName%" | ||
|
||
:: Push the Package | ||
|
||
call Info "Pushing %corePkgName% ver. %pkgVersion% to My NuGet ..." | ||
|
||
dotnet nuget push .\VijayAnand.MauiToolkit.Core\bin\Release\%corePkgName%.%pkgVersion%.nupkg --source %nugetSource%\%corePkgName% | ||
|
||
if not %errorlevel% == 0 (call Error "Core package push failed." & goto end) | ||
|
||
echo. | ||
call Info "Pushing %toolkitPkgName% ver. %pkgVersion% to My NuGet ..." | ||
|
||
dotnet nuget push .\VijayAnand.MauiToolkit\bin\Release\%toolkitPkgName%.%pkgVersion%.nupkg --source %nugetSource%\%toolkitPkgName% | ||
|
||
echo. | ||
if %errorlevel% == 0 (call Success "Process completed.") else (call Error "Toolkit package push failed.") | ||
|
||
:end | ||
pause |
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 @@ | ||
VijayAnand.MauiToolkit |
13 changes: 13 additions & 0 deletions
13
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IDialogService.cs
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,13 @@ | ||
namespace VijayAnand.MauiToolkit.Core | ||
{ | ||
public interface IDialogService | ||
{ | ||
Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons); | ||
|
||
Task DisplayAlert(string title, string message, string cancel); | ||
|
||
Task<bool> DisplayAlert(string title, string message, string accept, string cancel); | ||
|
||
Task<string> DisplayPromptAsync(string title, string message, string accept = "OK", string cancel = "Cancel", string? placeholder = null, int maxLength = -1, InputType inputType = InputType.Default, string initialValue = ""); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/INavigationService.cs
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,13 @@ | ||
namespace VijayAnand.MauiToolkit.Core | ||
{ | ||
public interface INavigationService | ||
{ | ||
Task GoToAsync(string uri); | ||
|
||
Task GoToAsync(string uri, string key, string value); | ||
|
||
Task GoToAsync(string uri, Dictionary<string, object> parameters); | ||
|
||
Task GoBackAsync(bool modal = false); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/IShareService.cs
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,9 @@ | ||
namespace VijayAnand.MauiToolkit.Core | ||
{ | ||
public interface IShareService | ||
{ | ||
Task ShareText(string title, string text); | ||
|
||
Task ShareUri(string title, string text, string uri); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/InputType.cs
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,15 @@ | ||
namespace VijayAnand.MauiToolkit.Core | ||
{ | ||
public enum InputType | ||
{ | ||
Plain, | ||
Chat, | ||
Decimal, | ||
Default, | ||
Email, | ||
Numeric, | ||
Telephone, | ||
Text, | ||
Url | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/VijayAnand.MauiToolkit.Core.csproj
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,49 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
|
||
<!-- Project Options --> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<RootNamespace>VijayAnand.MauiToolkit.Core</RootNamespace> | ||
|
||
<!-- NuGet Package Info --> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageId>VijayAnand.MauiToolkit.Core</PackageId> | ||
<Authors>Vijay Anand E G</Authors> | ||
<Copyright>Copyright © 2022 Vijay Anand E G</Copyright> | ||
<Product>VijayAnand.MauiToolkit.Core is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor).</Product> | ||
<Title>.NET MAUI Toolkit - Core</Title> | ||
<Description>VijayAnand.MauiToolkit.Core is a set of helper methods and classes to simplify working with .NET MAUI (and Blazor).</Description> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<RepositoryUrl>https://github.com/egvijayanand/dotnet-maui-toolkit</RepositoryUrl> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageTags>.NET,MAUI,Blazor,BlazorWebView,C#,Hybrid,Toolkit,Razor,RCL,iOS,Android,macOS,WinForms,Windows,WinUI3,WPF,MacCatalyst,Server,WebAssembly,WASM</PackageTags> | ||
<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/release-notes.txt"))</PackageReleaseNotes> | ||
<AssemblyName>VijayAnand.MauiToolkit.Core</AssemblyName> | ||
<Version>1.0.0</Version> | ||
<AssemblyVersion>1.0.0.0</AssemblyVersion> | ||
<FileVersion>1.0.0.0</FileVersion> | ||
<PackageReadmeFile>overview.md</PackageReadmeFile> | ||
<PackageProjectUrl>https://egvijayanand.in/</PackageProjectUrl> | ||
|
||
<!-- Source Linking --> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'"> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="overview.md" Pack="true" PackagePath="\" /> | ||
<None Include="release-notes.txt" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/overview.md
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,15 @@ | ||
### VijayAnand.MauiToolkit.Core | ||
|
||
This is a toolkit with a set of abstractions to simplify working with .NET MAUI and Blazor. | ||
|
||
It's built on top of .NET 6 and published as a NuGet package - [VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/). | ||
|
||
The objective is to ease the development of the `Razor Class Library` (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF). | ||
|
||
And .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), and Windows (via WinUI 3). | ||
|
||
To start with defines the following abstractions: | ||
|
||
* Dialogs - `IDialogService` | ||
* Navigation - `INavigationService` | ||
* Share - `IShareService` |
13 changes: 13 additions & 0 deletions
13
src/VijayAnand.MauiToolkit/VijayAnand.MauiToolkit.Core/release-notes.txt
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,13 @@ | ||
What's new in ver. 1.0.0-pre1: | ||
|
||
Initial release of VijayAnand.MauiToolkit.Core NuGet package and is built on top of .NET 6. | ||
|
||
The objective is to ease the development of the Razor Class Library (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF). | ||
|
||
And .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), and Windows (via WinUI 3). | ||
|
||
To start with defines the following abstractions: | ||
|
||
1. Dialogs - IDialogService | ||
2. Navigation - INavigationService | ||
3. Share - IShareService |
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,28 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 16 | ||
VisualStudioVersion = 16.0.30114.105 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VijayAnand.MauiToolkit", "VijayAnand.MauiToolkit\VijayAnand.MauiToolkit.csproj", "{8384E7C5-B193-4915-A493-7488B92DF85C}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VijayAnand.MauiToolkit.Core", "VijayAnand.MauiToolkit.Core\VijayAnand.MauiToolkit.Core.csproj", "{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{8384E7C5-B193-4915-A493-7488B92DF85C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8384E7C5-B193-4915-A493-7488B92DF85C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8384E7C5-B193-4915-A493-7488B92DF85C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8384E7C5-B193-4915-A493-7488B92DF85C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{AF5EAD10-57A6-49D1-B449-CFB3F2EFA5E4}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
Oops, something went wrong.