diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 878f137..906972f 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -1,19 +1,48 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "title": "Build Schema", - "$ref": "#/definitions/build", "definitions": { - "build": { - "type": "object", + "Host": { + "type": "string", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "ExecutableTarget": { + "type": "string", + "enum": [ + "Clean", + "Compile", + "Publish", + "Restore", + "Test" + ] + }, + "Verbosity": { + "type": "string", + "description": "", + "enum": [ + "Verbose", + "Normal", + "Minimal", + "Quiet" + ] + }, + "NukeBuild": { "properties": { - "Configuration": { - "type": "string", - "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", - "enum": [ - "Debug", - "Release" - ] - }, "Continue": { "type": "boolean", "description": "Indicates to continue a previously failed build attempt" @@ -23,25 +52,8 @@ "description": "Shows the help text for this build assembly" }, "Host": { - "type": "string", "description": "Host for execution. Default is 'automatic'", - "enum": [ - "AppVeyor", - "AzurePipelines", - "Bamboo", - "Bitbucket", - "Bitrise", - "GitHubActions", - "GitLab", - "Jenkins", - "Rider", - "SpaceAutomation", - "TeamCity", - "Terminal", - "TravisCI", - "VisualStudio", - "VSCode" - ] + "$ref": "#/definitions/Host" }, "NoLogo": { "type": "boolean", @@ -70,45 +82,42 @@ "type": "array", "description": "List of targets to be skipped. Empty list skips all dependencies", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Publish", - "Restore", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, - "Solution": { - "type": "string", - "description": "Path to a solution file that is automatically loaded" - }, "Target": { "type": "array", "description": "List of targets to be invoked. Default is '{default_target}'", "items": { - "type": "string", - "enum": [ - "Clean", - "Compile", - "Publish", - "Restore", - "Test" - ] + "$ref": "#/definitions/ExecutableTarget" } }, "Verbosity": { - "type": "string", "description": "Logging verbosity during build execution. Default is 'Normal'", - "enum": [ - "Minimal", - "Normal", - "Quiet", - "Verbose" - ] + "$ref": "#/definitions/Verbosity" } } } - } -} \ No newline at end of file + }, + "allOf": [ + { + "properties": { + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded" + } + } + }, + { + "$ref": "#/definitions/NukeBuild" + } + ] +} diff --git a/src/Robware.Projects.Gogs/GogsApi.cs b/src/Robware.Projects.Gogs/GogsApi.cs index 74fd75a..d04d125 100644 --- a/src/Robware.Projects.Gogs/GogsApi.cs +++ b/src/Robware.Projects.Gogs/GogsApi.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using Robware.Projects.Code; using Robware.Projects.Gogs.Models; using Robware.Projects.Gogs.States; +using System; namespace Robware.Projects.Gogs { public class GogsApi : IGitApi { @@ -24,7 +25,7 @@ namespace Robware.Projects.Gogs { try { return (await Get>($"api/v1/users/{user}/repos")).Select(state => new GogsRepository(state)); } - catch (HttpRequestException e) { + catch (Exception e) { throw new UserNotFoundException(user, e); } } @@ -33,7 +34,7 @@ namespace Robware.Projects.Gogs { try { return (await Get>($"api/v1/repos/{user}/{repository}/branches")).Select(state => new GogsBranch(state)); } - catch (HttpRequestException e) { + catch (Exception e) { throw new RepositoryNotFoundException(user, repository, e); } } @@ -42,7 +43,7 @@ namespace Robware.Projects.Gogs { try { return new GogsCommit(await Get($"api/v1/repos/{user}/{repository}/commits/{hash}")); } - catch (HttpRequestException e) { + catch (Exception e) { throw new CommitNotFoundException(user, repository, hash, e); } }