dansiegel / Mobile.BuildTools

The Mobile.BuildTools makes it easier to develop code bases in a clean, consistent, secure, and configurable way. Determine at Build which environment your app needs to run on, and what Client Secrets it should have. Plus many more amazing features!
http://mobilebuildtools.com
MIT License
228 stars 29 forks source link

Convert AppSettings to Roslyn Generator #297

Closed dansiegel closed 2 years ago

dansiegel commented 2 years ago

Description

Updates the AppSettings to utilize a Roslyn Generator rather than MSBuild Task. This provides some additional power in that you will now be able to declare a partial class with an implemented interface and have the Mobile.BuildTools generate the missing properties for you.

public interface IB2COptions
{
    string ClientId { get; }
    string Domain { get; }
}

public partial class B2COptions : IB2COptions
{
    // properties generated by Mobile.BuildTools
}

Then in the buildtools.json you might have:

{
  "appSettings": {
    "MyProject": [
      {
        "className": "B2COptions",
        "properties": [
          {
            // Declare the properties
          }
        ]
      }
    ]
  }
}