-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task to generate wrapper designer class source
- Loading branch information
1 parent
89f8ff8
commit 38f4e44
Showing
5 changed files
with
63 additions
and
29 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
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
27 changes: 27 additions & 0 deletions
27
src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceDesignerIntermediateClass.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,27 @@ | ||
using System.IO; | ||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
using Microsoft.Android.Build.Tasks; | ||
|
||
namespace Xamarin.Android.Tasks | ||
{ | ||
public class GenerateResourceDesignerIntermediateClass : AndroidTask | ||
{ | ||
public override string TaskPrefix => "GRDIC"; | ||
|
||
public string Namespace { get; set; } | ||
public ITaskItem OutputFile { get; set; } | ||
public override bool RunTask () | ||
{ | ||
File.WriteAllText (OutputFile.ItemSpec, $@"// This is an Auto Generated file DO NOT EDIT | ||
using System; | ||
namespace {Namespace} {{ | ||
public class Resource : Xamarin.Android.Resource.Designer.Resource {{ | ||
}} | ||
}} | ||
", System.Text.Encoding.UTF8); | ||
return !Log.HasLoggedErrors; | ||
} | ||
} | ||
} |
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