Skip to content

Commit

Permalink
(GH-27) Remove copy/paste errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Nov 23, 2018
1 parent 2f8a837 commit dbea3ba
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 359 deletions.
2 changes: 1 addition & 1 deletion CODEOFCONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ By adopting this Code of Conduct, project maintainers commit themselves to fairl

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [cake-build@outlook.com](mailto:cake-build@outlook.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [abuse@gep13.co.uk](mailto:abuse@gep13.co.uk). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.

This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available from http://contributor-covenant.org/version/1/3/0/
364 changes: 182 additions & 182 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,182 +1,182 @@
//////////////////////////////////////////////////////////////////////
// ADDINS
//////////////////////////////////////////////////////////////////////

#addin "nuget:?package=MagicChunks&version=1.1.0.34"
#addin "nuget:?package=Cake.Tfx&version=0.4.2"
#addin "nuget:?package=Cake.Npm&version=0.7.2"

//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////

#tool "nuget:?package=gitreleasemanager&version=0.6.0"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.4"

// Load other scripts.
#load "./build/parameters.cake"

//////////////////////////////////////////////////////////////////////
// PARAMETERS
//////////////////////////////////////////////////////////////////////

BuildParameters parameters = BuildParameters.GetParameters(Context, BuildSystem);
bool publishingError = false;

///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////

Setup(context =>
{
parameters.SetBuildVersion(
BuildVersion.CalculatingSemanticVersion(
context: Context,
parameters: parameters
)
);

// Increase verbosity?
if(parameters.IsMasterCakeVsoBranch && (context.Log.Verbosity != Verbosity.Diagnostic)) {
Information("Increasing verbosity to diagnostic.");
context.Log.Verbosity = Verbosity.Diagnostic;
}

Information("Building version {0} of cake-vso ({1}, {2}) using version {3} of Cake. (IsTagged: {4})",
parameters.Version.SemVersion,
parameters.Configuration,
parameters.Target,
parameters.Version.CakeVersion,
parameters.IsTagged);
});

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
.Does(() =>
{
CleanDirectories(new[] { "./build-results" });
});

Task("Install-Tfx-Cli")
.Does(() =>
{
Npm.WithLogLevel(NpmLogLevel.Silent).FromPath(".").Install(settings => settings.Package("tfx-cli").Globally());
});

Task("Create-Release-Notes")
.Does(() =>
{
GitReleaseManagerCreate(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", new GitReleaseManagerCreateSettings {
Milestone = parameters.Version.Milestone,
Name = parameters.Version.Milestone,
Prerelease = true,
TargetCommitish = "master"
});
});

Task("Update-Json-Versions")
.Does(() =>
{
var projectToPackagePackageJson = "vss-extension.json";
Information("Updating {0} version -> {1}", projectToPackagePackageJson, parameters.Version.SemVersion);

TransformConfig(projectToPackagePackageJson, projectToPackagePackageJson, new TransformationCollection {
{ "version", parameters.Version.SemVersion }
});

var taskJson = "Tasks/chocolatey/task.json";
Information("Updating {0} version -> {1}", taskJson, parameters.Version.SemVersion);

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Major", parameters.Version.Major }
});

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Minor", parameters.Version.Minor }
});

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Patch", parameters.Version.Patch }
});
});

Task("Package-Extension")
.IsDependentOn("Update-Json-Versions")
.IsDependentOn("Install-Tfx-Cli")
.IsDependentOn("Clean")
.Does(() =>
{
var buildResultDir = Directory("./build-results");

TfxExtensionCreate(new TfxExtensionCreateSettings()
{
ManifestGlobs = new List<string>(){ "./vss-extension.json" },
OutputPath = buildResultDir
});
});

Task("Publish-GitHub-Release")
.WithCriteria(() => parameters.ShouldPublish)
.Does(() =>
{
var buildResultDir = Directory("./build-results");
var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix");

GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", parameters.Version.Milestone, buildResultDir + packageFile);
GitReleaseManagerClose(parameters.GitHub.UserName, parameters.GitHub.Password, "cake-build", "cake-vso", parameters.Version.Milestone);
})
.OnError(exception =>
{
Information("Publish-GitHub-Release Task failed, but continuing with next Task...");
publishingError = true;
});

Task("Publish-Extension")
.IsDependentOn("Package-Extension")
.WithCriteria(() => parameters.ShouldPublish)
.Does(() =>
{
var buildResultDir = Directory("./build-results");
var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix");

TfxExtensionPublish(buildResultDir + packageFile, new TfxExtensionPublishSettings()
{
AuthType = TfxAuthType.Pat,
Token = parameters.Marketplace.Token
});
})
.OnError(exception =>
{
Information("Publish-Extension Task failed, but continuing with next Task...");
publishingError = true;
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Package-Extension");

Task("Appveyor")
.IsDependentOn("Publish-Extension")
.IsDependentOn("Publish-GitHub-Release")
.Finally(() =>
{
if(publishingError)
{
throw new Exception("An error occurred during the publishing of cake-vscode. All publishing tasks have been attempted.");
}
});

Task("ReleaseNotes")
.IsDependentOn("Create-Release-Notes");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////

RunTarget(parameters.Target);
//////////////////////////////////////////////////////////////////////
// ADDINS
//////////////////////////////////////////////////////////////////////

#addin "nuget:?package=MagicChunks&version=1.1.0.34"
#addin "nuget:?package=Cake.Tfx&version=0.4.2"
#addin "nuget:?package=Cake.Npm&version=0.7.2"

//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////

#tool "nuget:?package=gitreleasemanager&version=0.7.1"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.4"

// Load other scripts.
#load "./build/parameters.cake"

//////////////////////////////////////////////////////////////////////
// PARAMETERS
//////////////////////////////////////////////////////////////////////

BuildParameters parameters = BuildParameters.GetParameters(Context, BuildSystem);
bool publishingError = false;

///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
///////////////////////////////////////////////////////////////////////////////

Setup(context =>
{
parameters.SetBuildVersion(
BuildVersion.CalculatingSemanticVersion(
context: Context,
parameters: parameters
)
);

// Increase verbosity?
if(parameters.IsMasterBranch && (context.Log.Verbosity != Verbosity.Diagnostic)) {
Information("Increasing verbosity to diagnostic.");
context.Log.Verbosity = Verbosity.Diagnostic;
}

Information("Building version {0} of chocolatey-azuredevops ({1}, {2}) using version {3} of Cake. (IsTagged: {4})",
parameters.Version.SemVersion,
parameters.Configuration,
parameters.Target,
parameters.Version.CakeVersion,
parameters.IsTagged);
});

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
.Does(() =>
{
CleanDirectories(new[] { "./build-results" });
});

Task("Install-Tfx-Cli")
.Does(() =>
{
Npm.WithLogLevel(NpmLogLevel.Silent).FromPath(".").Install(settings => settings.Package("tfx-cli").Globally());
});

Task("Create-Release-Notes")
.Does(() =>
{
GitReleaseManagerCreate(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", new GitReleaseManagerCreateSettings {
Milestone = parameters.Version.Milestone,
Name = parameters.Version.Milestone,
Prerelease = true,
TargetCommitish = "master"
});
});

Task("Update-Json-Versions")
.Does(() =>
{
var projectToPackagePackageJson = "vss-extension.json";
Information("Updating {0} version -> {1}", projectToPackagePackageJson, parameters.Version.SemVersion);

TransformConfig(projectToPackagePackageJson, projectToPackagePackageJson, new TransformationCollection {
{ "version", parameters.Version.SemVersion }
});

var taskJson = "Tasks/chocolatey/task.json";
Information("Updating {0} version -> {1}", taskJson, parameters.Version.SemVersion);

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Major", parameters.Version.Major }
});

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Minor", parameters.Version.Minor }
});

TransformConfig(taskJson, taskJson, new TransformationCollection {
{ "version/Patch", parameters.Version.Patch }
});
});

Task("Package-Extension")
.IsDependentOn("Update-Json-Versions")
.IsDependentOn("Install-Tfx-Cli")
.IsDependentOn("Clean")
.Does(() =>
{
var buildResultDir = Directory("./build-results");

TfxExtensionCreate(new TfxExtensionCreateSettings()
{
ManifestGlobs = new List<string>(){ "./vss-extension.json" },
OutputPath = buildResultDir
});
});

Task("Publish-GitHub-Release")
.WithCriteria(() => parameters.ShouldPublish)
.Does(() =>
{
var buildResultDir = Directory("./build-results");
var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix");

GitReleaseManagerAddAssets(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", parameters.Version.Milestone, buildResultDir + packageFile);
GitReleaseManagerClose(parameters.GitHub.UserName, parameters.GitHub.Password, "gep13", "chocolatey-azuredevops", parameters.Version.Milestone);
})
.OnError(exception =>
{
Information("Publish-GitHub-Release Task failed, but continuing with next Task...");
publishingError = true;
});

Task("Publish-Extension")
.IsDependentOn("Package-Extension")
.WithCriteria(() => parameters.ShouldPublish)
.Does(() =>
{
var buildResultDir = Directory("./build-results");
var packageFile = File("cake-build.cake-" + parameters.Version.SemVersion + ".vsix");

TfxExtensionPublish(buildResultDir + packageFile, new TfxExtensionPublishSettings()
{
AuthType = TfxAuthType.Pat,
Token = parameters.Marketplace.Token
});
})
.OnError(exception =>
{
Information("Publish-Extension Task failed, but continuing with next Task...");
publishingError = true;
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

Task("Default")
.IsDependentOn("Package-Extension");

Task("Appveyor")
.IsDependentOn("Publish-Extension")
.IsDependentOn("Publish-GitHub-Release")
.Finally(() =>
{
if(publishingError)
{
throw new Exception("An error occurred during the publishing of cake-vscode. All publishing tasks have been attempted.");
}
});

Task("ReleaseNotes")
.IsDependentOn("Create-Release-Notes");

//////////////////////////////////////////////////////////////////////
// EXECUTION
//////////////////////////////////////////////////////////////////////

RunTarget(parameters.Target);
Loading

0 comments on commit dbea3ba

Please sign in to comment.