Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [<AllowNullLiteral>]
- type BaseiOSSpecificConfiguration() =
- member val BundleIdentifier = "" with get,set
- member val iTunesAppId = "" with get,set
- member val iTunesConnectUsername = "" with get,set
- member val iTunesConnectPassword = "" with get,set
- [<AllowNullLiteral>]
- type BaseAndroidSpecificConfiguration() =
- member val BundleIdentifier = "" with get,set
- member val AndroidKeystorePath = "" with get,set
- member val AndroidKeystorePassword = "" with get,set
- member val AndroidKeystoreAlias = "" with get,set
- member val DropboxFolderPath = "" with get,set
- type iOSSpecificConfigurations() =
- member val DevConfiguration = new BaseiOSSpecificConfiguration() with get,set
- member val DemoConfiguration = new BaseiOSSpecificConfiguration() with get,set
- member val ReleaseConfiguration = new BaseiOSSpecificConfiguration() with get,set
- type AndroidSpecificConfigurations() =
- member val DevConfiguration = new BaseAndroidSpecificConfiguration() with get,set
- member val DemoConfiguration = new BaseAndroidSpecificConfiguration() with get,set
- member val ReleaseConfiguration = new BaseAndroidSpecificConfiguration() with get,set
- [<AllowNullLiteral>]
- type Configuration() =
- member val SolutionFileName = "" with get,set
- member val ProjectFolderPath = "" with get,set
- member val ProjectFileName = "" with get,set
- member val CoreProjectFolderPath = "" with get,set
- member val CoreProjectFileName = "" with get,set
- member val iOSSpecificConfigurations = new iOSSpecificConfigurations() with get,set
- member val AndroidSpecificConfigurations = new AndroidSpecificConfigurations() with get,set
- let ParseBuildConfigurations filePath : Configuration =
- let file = new FileStream(filePath, FileMode.Open, FileAccess.Read)
- let stream = new StreamReader(file)
- let deserializer = new Deserializer(namingConvention = new CamelCaseNamingConvention())
- let configuration = deserializer.Deserialize<Configuration>(stream)
- stream.Close()
- file.Close()
- configuration
- let DetermineAndroidSpecificConfiguration (buildConfigurationName : string) (configuration : Configuration) : BaseAndroidSpecificConfiguration =
- match buildConfigurationName.ToLowerInvariant() with
- | "dev" -> configuration.AndroidSpecificConfigurations.DevConfiguration
- | "demo" -> configuration.AndroidSpecificConfigurations.DemoConfiguration
- | "release" -> configuration.AndroidSpecificConfigurations.ReleaseConfiguration
- | _ -> null
- let DetermineiOSSpecificConfiguration (buildConfigurationName : string) (configuration : Configuration) : BaseiOSSpecificConfiguration =
- match buildConfigurationName.ToLowerInvariant() with
- | "dev" -> configuration.iOSSpecificConfigurations.DevConfiguration
- | "demo" -> configuration.iOSSpecificConfigurations.DemoConfiguration
- | "release" -> configuration.iOSSpecificConfigurations.ReleaseConfiguration
- | _ -> null
- let DetermineBuildConfigurationName (buildBranch : string) : string =
- let lowered = buildBranch.ToLowerInvariant()
- match lowered with
- | "development" -> "Dev"
- | "master" -> "Release"
- | lowered when lowered.StartsWith("release/") -> "Demo"
- | lowered when lowered.StartsWith("feature/") -> "Dev"
- | lowered when lowered.StartsWith("hotfix/") -> "Dev"
- | _ -> ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement