public void WriteVersion_ShouldWriteFileVersion_WithNoPrereleaseTag()
        {
            var asm = GenerateAssembly(new Version(1, 0, 0), "");

            string version = null;

            versionWriter.WriteTo(asm, v => version = v);

            Assert.IsNotNull(asm);
            Assert.AreEqual("1.0.0", version);
        }
Example #2
0
        public void WriteTo(Action <string> writeAction)
        {
            string version = string.Empty;

            _versionWriter.WriteTo(Assembly.GetExecutingAssembly(), v => version = v);

            string message = "DacTools.Deployment v" + version + @"
DacTools.Deployment is a tool that can be used to deploy DacPac files to Microsoft SQL Server. This tool expands upon DacFx by providing the ability to run multiple deployments to multiple databases simultaniously in parallel.

<Application> [options...]

    <Application>                   The name of this Application, such as DacTools.Deployment.exe.
    [options...]                    Any of the below options you want to add as command line arguments.

    /version                        Displays the current version of DacTools.Deployment
    /help, /h or /?                 Shows this Help Text
    /verbosity or /v                Set Verbosity Level (Debug, Info, Warn, Error, None). Default is Info
    /log or /l                      Set a path for a Log File.
                                    If not supplied then no log file is created and logging only goes to console.

    /dacpac or /d                   The path to the .dacpac file to run the operation on.
    /masterconnectionstring or /S   The SQL Server Connection string for the master database on the server to deploy to.
    /databases or /D                A list of databases to either whitelist (default) or blacklist.
                                    The list can be provided as a set of either comma or space separated values.
    /blacklist or /b                Configures the tool to use the value of the  '/databases' option as a blacklist.
    /threads or /t                  Configures the maximum number of threads to use while deploying databases.
                                    If set to -1 then the value of Environment.ProcessorCount will be used.

    /variable:<VariableName>        If provided then the DacDeployOptions SqlCommandVariableValues of '<VariableName>' will be set to the provided value.
    /p:<ParameterName>              If provided then the DacDeployOptions Parameter of '<ParameterName>' will be set to the provided value.
                                    Only certain parameters are supported, for a full list of supported parameters please refer to the documentation.
";

            writeAction(message);
        }
Example #3
0
        public void WriteTo(Action <string> writeAction)
        {
            var version  = string.Empty;
            var assembly = Assembly.GetExecutingAssembly();

            versionWriter.WriteTo(assembly, v => version = v);

            var args    = ArgumentList();
            var nl      = System.Environment.NewLine;
            var message = "GitVersion " + version + nl + nl + args;

            writeAction(message);
        }
Example #4
0
        public void WriteTo(Action <string> writeAction)
        {
            var version  = string.Empty;
            var assembly = Assembly.GetExecutingAssembly();

            versionWriter.WriteTo(assembly, v => version = v);

            var message = "GitVersion " + version + @"
Use convention to derive a SemVer product version from a GitFlow or GitHub based repository.

GitVersion [path]

    path            The directory containing .git. If not defined current directory is used. (Must be first argument)
    init            Configuration utility for gitversion
    /version        Displays the version of GitVersion
    /diag           Runs GitVersion with additional diagnostic information (requires git.exe to be installed)
    /h or /?        Shows Help

    /targetpath     Same as 'path', but not positional
    /output         Determines the output to the console. Can be either 'json' or 'buildserver', will default to 'json'.
    /showvariable   Used in conjuntion with /output json, will output just a particular variable.
                    eg /output json /showvariable SemVer - will output `1.2.3+beta.4`
    /l              Path to logfile.
    /config         Path to config file (defaults to GitVersion.yml)
    /showconfig     Outputs the effective GitVersion config (defaults + custom from GitVersion.yml) in yaml format
    /overrideconfig Overrides GitVersion config values inline (semicolon-separated key value pairs e.g. /overrideconfig tag-prefix=Foo)
                    Currently supported config overrides: tag-prefix
    /nocache        Bypasses the cache, result will not be written to the cache.
    /nonormalize    Disables normalize step on a build server.

 # AssemblyInfo updating
    /updateassemblyinfo
                    Will recursively search for all 'AssemblyInfo.cs' files in the git repo and update them
    /updateassemblyinfofilename
                    Specify name of AssemblyInfo file. Can also /updateAssemblyInfo GlobalAssemblyInfo.cs as a shorthand
    /ensureassemblyinfo
                    If the assembly info file specified with /updateassemblyinfo or /updateassemblyinfofilename is not found,
                    it be created with these attributes: AssemblyFileVersion, AssemblyVersion and AssemblyInformationalVersion
                    ---
                    Supports writing version info for: C#, F#, VB

    # Create or update Wix version file
    /updatewixversionfile
                   All the GitVersion variables are written to 'GitVersion_WixVersion.wxi'.
                   The variables can then be referenced in other WiX project files for versioning.

    # Remote repository args
    /url            Url to remote git repository.
    /b              Name of the branch to use on the remote repository, must be used in combination with /url.
    /u              Username in case authentication is required.
    /p              Password in case authentication is required.
    /c              The commit id to check. If not specified, the latest available commit on the specified branch will be used.
    /dynamicRepoLocation
                    By default dynamic repositories will be cloned to %tmp%. Use this switch to override
    /nofetch        Disables 'git fetch' during version calculation. Might cause GitVersion to not calculate your version as expected.

# Execute build args
    /exec           Executes target executable making GitVersion variables available as environmental variables
    /execargs       Arguments for the executable specified by /exec
    /proj           Build a msbuild file, GitVersion variables will be passed as msbuild properties
    /projargs       Additional arguments to pass to msbuild
    /verbosity      Specifies the amount of information to be displayed.
                    (Quiet, Minimal, Normal, Verbose, Diagnostic)
                    Default is Normal

gitversion init     Configuration utility for gitversion
";

            writeAction(message);
        }