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] []
- -Repositories: comma separated list of repositories to clone. Use
all
to clone all Appccelerate repositories (except scripts).
Samples
Clone all -user appccelerate
clone all repositories from https://github.com/appccelerateClone fundamentals,bootstrapper -user ursenzler
clone repositories https://github.com/ursenzler/fundamentals and https://github.com/ursenzler/bootstrapperGetStatus -Repositories fundamentals -user appccelerate
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}] []
- -Repositories: comma separated list of repositories to check. Use
all
to get status from all repositories.
Samples
GetStatus all
GetStatus fundamentals,bootstrapper
GetStatus -Repositories fundamentals
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}]
[]
- -Repositories: comma separated list of repositories to pull. Use
all
to pull all repositories.
Samples
Pull all
Pull fundamentals,bootstrapper
Pull -Repositories fundamentals
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] []
- -Repositories: comma separated list of repositories to check. Use
all
to check all repositories. - -skipDevelopmentDependencies: whether nuget packages that are marked as development packages should be checked.
Samples
CheckNugetDependenciesForConflictingVersions all
CheckNugetDependenciesForConflictingVersions fundamentals,bootstrapper
CheckNugetDependenciesForConflictingVersions all -skipDevelopmentDependencies
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] []
- -Repositories: comma separated list of repositories to create packages from. Use
all
for all repositories. - -outputDirectory: directory to create packages in. Default value is the directory
NugetPackages
in the same parent directory as the scripts git directory. - -skipAppccelerateVersionInstallation: switch for skipping the installation of the versioning executable. Do only skip if you just used this command before.
- -skipIntegrate: switch for skipping building of the sources. Do only skip if you run a release build before.
Samples
CreateLocalNugetPackages fundamentals
CreateLocalNugetPackages fundamentals -skipAppccelerateVersionInstallation -skipIntegrate
CreateLocalNugetPackages fundamentals -outputDirectory c:\temp\
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}] []
- -Id: Id of the nuget package(s) to be updated. Can contain wildcards, e.g.
Appccelerate.*
- -Source: semicolon separated list of Nuget package sources to use. . Default value is
https://www.nuget.org/api/v2;https://www.myget.org/F/appccelerate/
- -Repositories: comma separated list of repositories to be updated. Use
all
to update all repositories.
Samples
UpdatePackage FluentAssertions all
UpdatePackage Appccelerate.* bootstrapper,statemachine
UpdatePackage Appccelerate.* -Source nuget.org all
update using only nuget.org as a package source
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} []
- -Repository: The repository for whose nuget package to wait for.
Samples
WaitForNugetPackageUpdateOnMyGet fundamentals
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] []
- -SourceRepository: the repository for that is built and whose nuget package is built.
- -Repositories: comma separated list of repositories that are updated.
- -skipAppccelerateVersionInstallation: switch for skipping the installation of the versioning executable. Do only skip if you just used this command before.
Samples
UpdateLocally fundamentals eventBroker,stateMachine
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:
- calculate version by calling
GetVersion
and add the prerelease version-localWXYZ
(WXYZ is an automatically incremented number). - execute
CreateLocalPackage
with the above version. - 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}] []
- -Repositories: comma separated list of repositories to add the hook.
Samples
InstallGitHooks all
Remarks
The hook searches all modified packages.config
files for -local
and fails if found.