-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
571 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"cake.tool": { | ||
"version": "3.0.0", | ||
"commands": [ | ||
"dotnet-cake" | ||
] | ||
} | ||
} | ||
} |
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,87 @@ | ||
#addin nuget:?package=Cake.FileHelpers&version=6.0.0 | ||
|
||
var target = Argument("target", "Default"); | ||
var group = Argument("group", "BuiltIn"); | ||
var name = Argument("name", "AwesomeControl"); | ||
var configuration = Argument("configuration", "Release"); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// TASKS | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
const string CONTROL_FODLER_PATH_TEMPLATE="./src/Features/Gallery/Pages/{0}/{1}"; | ||
|
||
Task("Default") | ||
.Does(() => | ||
{ | ||
var controlFolderPath = string.Format(CONTROL_FODLER_PATH_TEMPLATE, group, name); | ||
Information("Control folder path: " + controlFolderPath); | ||
|
||
if (DirectoryExists(controlFolderPath)) { | ||
Warning("Control folder path exists"); | ||
return; | ||
} | ||
|
||
CreateDirectory(controlFolderPath); | ||
|
||
Information($"\n>> Generate >> {name}ControlInfo.cs"); | ||
FileWriteText($"{controlFolderPath}/{name}ControlInfo.cs", $@"namespace MAUIsland.Gallery.{group}; | ||
class {name}ControlInfo : IControlInfo | ||
{{ | ||
public string ControlName => nameof({name}); | ||
public string ControlRoute => typeof({name}Page).FullName; | ||
public ImageSource ControlIcon => new FontImageSource() | ||
{{ | ||
FontFamily = FontNames.FluentSystemIconsRegular, | ||
Glyph = FluentUIIcon.Ic_fluent_approvals_app_20_regular | ||
}}; | ||
public string ControlDetail => throw new NotImplementedException(); | ||
public string GitHubUrl => $""https://github.com/Strypper/MAUIsland/tree/main/MAUIsland/Features/Gallery/MAUI/{{ControlName}}""; | ||
public string DocumentUrl => $""https://learn.microsoft.com/en-us/dotnet/maui/user-interface/controls/{{ControlName}}/?view=net-maui-7.0""; | ||
public string GroupName => ControlGroupInfo.{group}Controls; | ||
}}"); | ||
|
||
Information($"\n>> Generate >> {name}Page.xaml"); | ||
FileWriteText($"{controlFolderPath}/{name}Page.xaml", $@"<?xml version=""1.0"" encoding=""utf-8"" ?> | ||
<app:BasePage | ||
xmlns=""http://schemas.microsoft.com/dotnet/2021/maui"" | ||
xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml"" | ||
xmlns:app=""clr-namespace:MAUIsland"" | ||
x:Class=""MAUIsland.{name}Page"" | ||
x:DataType=""app:{name}PageViewModel"" | ||
Title=""{name}""> | ||
<VerticalStackLayout> | ||
<Label | ||
Text=""Welcome to {name} Page!"" | ||
VerticalOptions=""Center"" | ||
HorizontalOptions=""Center"" /> | ||
</VerticalStackLayout> | ||
</app:BasePage>"); | ||
|
||
Information($"\n>> Generate >> {name}Page.xaml.cs"); | ||
FileWriteText($"{controlFolderPath}/{name}Page.xaml.cs", $@"namespace MAUIsland; | ||
public partial class {name}Page : IControlPage | ||
{{ | ||
public {name}Page() | ||
{{ | ||
InitializeComponent(); | ||
}} | ||
}}"); | ||
|
||
Information($"\n>> Generate >> {name}PageViewModel.cs"); | ||
FileWriteText($"{controlFolderPath}/{name}PageViewModel.cs", $@"namespace MAUIsland; | ||
public partial class {name}PageViewModel : NavigationAwareBaseViewModel | ||
{{ | ||
public {name}PageViewModel( | ||
IAppNavigator appNavigator | ||
) : base(appNavigator) | ||
{{ | ||
}} | ||
}}"); | ||
}); | ||
|
||
////////////////////////////////////////////////////////////////////// | ||
// EXECUTION | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
RunTarget(target); |
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
Binary file not shown.
22 changes: 22 additions & 0 deletions
22
tools/Addins/Cake.FileHelpers.6.0.0/Cake.FileHelpers.nuspec
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,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
<metadata> | ||
<id>Cake.FileHelpers</id> | ||
<version>6.0.0</version> | ||
<title>Cake.FileHelpers</title> | ||
<authors>Redth</authors> | ||
<license type="expression">Apache-2.0</license> | ||
<licenseUrl>https://licenses.nuget.org/Apache-2.0</licenseUrl> | ||
<icon>icon.png</icon> | ||
<projectUrl>https://github.com/cake-contrib/Cake.FileHelpers</projectUrl> | ||
<iconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/addin/cake-contrib-addin-medium.png</iconUrl> | ||
<description>Cake Build addon to provide Aliases for common File operations (Reading, Writing, Replacing Text).</description> | ||
<copyright>Copyright 2017-2023 - Cake Contributions</copyright> | ||
<tags>cake script build cake-addin cake-build addin</tags> | ||
<repository type="git" url="https://github.com/cake-contrib/Cake.FileHelpers.git" commit="7962e55b54989881495229367958b3367408219c" /> | ||
<dependencies> | ||
<group targetFramework="net6.0" /> | ||
<group targetFramework="net7.0" /> | ||
</dependencies> | ||
</metadata> | ||
</package> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
194 changes: 194 additions & 0 deletions
194
tools/Addins/Cake.FileHelpers.6.0.0/lib/net6.0/Cake.FileHelpers.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.