Fork me on GitHub

PowerShell Commandlets

Appccelerates uses PowerShell commandlets to make multi-repository development a lot easier.

Commandlets support auto-completion of function names and parameters. Make sure to use the "Tab" kay a lot :-)

How to use the commandlets

Clone the Scripts repository to the same parent folder as all other Appccelerate folders. See Multi repository.

Execute the Appccelerate.ps1 script from the scripts repository. This will import the commandlets into the current PowerShell shell.

Prerequisite

The commandlets use nuget.exe and git.exe to run. Both must be installed and added to the Path environment variable.

Git related commandlets

Clone

Clones one or more repositories from github to the parent directory of the scrips repository.

Clone [[-Repositories] {bootstrapper | commandlineparser | CheckHintPathTask | CheckNoBindingRedirectsTask | CheckNugetDependenciesTask | CheckTestFixtureAttributeSetTask | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | evaluationengine | eventbroker | fundamentals | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | statemachine | Version | all}] [-user] []

Samples

Remarks

You can use this commandlet to setup all Appccelerate repositories quickly: clone the scripts folder, run .\script.Appccelerate.ps1 and execute clone all.

GetStatus

Checks a repository for local changes and shows if there are local modifications and how many commits the local repository is behind or ahead of the origin.

GetStatus [[-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all}] []

Samples

Pull

Pulls a git repository.

Pull [[-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all}] []

Samples

Nuget related commandlets

CheckNugetDependenciesForConflictingVersions

Checks whether all nuget package dependencies have a consistent version number across all projects in the specified repositories. Prints all dependencies and found conflicts.

CheckNugetDependenciesForConflictingVersions [[-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all}] [-skipDevelopmentDependencies] []

Samples

Remarks

The versions have to be consistent so that code depending on different Appccelerate components can be built without assembly version conflicts.

Development packages are packages that are only used internally (e.g. build infrastructure) and will not become dependencies for projects using an Appccelerate package. Therefore, inconsistent versions are not nice but will not result in build problems.

CreateLocalNugetPackages

Creates nuget packages locally from Appccelerate repositories.

CreateLocalNugetPackages [-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all} [[-outputDirectory] ] [-skipAppccelerateVersionInstallation] [-skipIntegrate] []

Samples

Remarks

CreateLocalNugetPackages restores nuget packages, builds a release build (including all checks, tests and specifications), generates the nuget package version using Appccelerate.Version and creates the nuget packages (one for every .nuspec found in the repository).

The skip switches can be used to speed up the commandlet in case there is already a release build or the version executable was already installed.

The version executable is installed into the user's temp directory.

UpdatePackage

Updates nuget package(s).

UpdatePackage [-Id] [[-Source] ] [[-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all}] []

Samples

Remarks

UpdatePackage restores nuget packages prior to updating.

WaitForNugetPackageUpdateOnMyGet

Gets the latest available version of an Appccelerate nuget package from the Appccelerate MyGet feed and waits until a new version is available.

WaitForNugetPackageUpdateOnMyGet [-Repository] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask} []

Samples

Remarks

This commandlet is used after a push to GitHub to wait until the build server has built and pushed the new package to the MyGet feed. Afterwards, the package can be updated from the MyGet feed.

The WaitForNugetPackageUpdateOnMyGet looks for pre-release nuget packages, too.

The specified repository is used to build to package id: Appccelerate.<repository>

UpdateLocally

Builds a local nuget package and updates it in the specified repositories.

UpdateLocally [-SourceRepository] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask} [[-Repositories] {fundamentals | bootstrapper | stateMachine | eventbroker | evaluationengine | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | Version | CheckNoBindingRedirectsTask | CheckHintPathTask | CheckNugetDependenciesTask | all}] [-skipAppccelerateVersionInstallation] []

Samples

Remarks

This commandlet is very useful when working on multiple repositories due to dependencies. You can use this commandlet to update the dependent repositories with the changes made locally. Note that you need to commit your changes in order to update the package. Otherwise nuget will not update to a pre-release version with the same main version.

The commandlet is based on the assumption that the source repository has only one nuget package with the name Appccelerate.<repository>.

UpdateLocally executes the following steps:

  1. calculate version by calling GetVersion and add the prerelease version -localWXYZ (WXYZ is an automatically incremented number).
  2. execute CreateLocalPackage with the above version.
  3. execute UpdatePackage with the packages in the source repository for the target repositories.

Before committing changes from a local update, update the package from nuget.org or the Appccelerate package feed on MyGet. Otherwise dependencies on local packages are committed and result in a build failure. You can use the InstallGitHooks to prevent committing local packages.

InstallGitHooks

Adds git commit hooks to repositories so that you cannot commit local nuget package dependencies (see UpdateLocally).

InstallGitHooks [[-Repositories] {bootstrapper | commandlineparser | CheckHintPathTask | CheckNoBindingRedirectsTask | CheckNugetDependenciesTask | CheckTestFixtureAttributeSetTask | distributedeventbroker | distributedeventbroker.masstransit | distributedeventbroker.nservicebus | evaluationengine | eventbroker | fundamentals | io | mappingeventbroker | mappingeventbroker.automapper | scopingeventbroker | statemachine | Version | all}] []

Samples

Remarks

The hook searches all modified packages.config files for -local and fails if found.