Skip to content

vasyl-purchel/alpaca

Repository files navigation

AlpacaBuildTool

Build Status Dependency Status Coverage Status Code Climate Inline docs Gem Version

Logo

AlpacaBuildTool is a Ruby gem with alpaca command line interface that helps to work with C# Visual Studio solutions

Most aspects of its behavior can be tweaked via various configuration options or via alpaca configure command

Installation

Install gem:

$ gem install alpacabuildtool

Basic Usage

SYNOPSIS
    alpaca [global options] command [command options] [arguments...]

GLOBAL OPTIONS
    --help            - Show this message
    -p, --pattern=arg - Solutions search pattern (default: **/*.sln)
    --version         - Display the program version

COMMANDS
    compile   - Compile solution[s]
    configure - Configure alpaca to your needs
    help      - Shows a list of commands or help for one command
    pack      - Create packages for solution[s]
    release   - Release packages for solution[s]
    report    - Generate reports for solution[s]
    test      - Test solution[s]
    update    - Update solution[s] versions

Run $ alpaca compile and by default alpaca will search for all solutions recurcively in current folder and compile all of them unless they have nobuild tag in a name(no_build: ['.nobuild'])

It is safe to run alpaca from solution folder or any parent folders If you want to build only specific solution then use global option $ alpaca -p '**/Cool.sln' compile

Check $ alpaca command --help for help on each command

Configuration

Inheritance

Alpaca's configuration has 3 levels - default, global, local. Local configuration has the highest priority so it can override any property from other configurations. Global configuration can override only default configuration.

Defaults

Default configuration (lib/data/.alpaca.conf) is stored with installing gem so alpaca can work out of the box. It shouldn't be changed as it will get overriden after gem updated

You can check it's defaults here

User Wide

Global configuration (~/.alpaca.conf) can be created manually or with a help of alpaca configure global ... You can use it to store user wide configuration to apply some tweaks of default configuration to all your solutions

Check default configuration for full explanation of structure and examples

Solution Specific

Local configuration (#{solution-folder}/.alpaca.conf) can be created manually or with a help of alpaca configure local ... You can use it to store solution specific configuration like nuget packages to be created from solution or reports names.

Also you can change default path to local configuration by setting

local_configuration:        'any/relative/path/to/local/configuration'

this example will put your local configuration into #{solution-folder}/any/relative/path/to/local/configuration file

Common usage for local configuration would be nuget packages

Example

packages:
   - id:          "Package.Unique.Id"
     type:        :tool
     project:     "Console.Tool"
     source:      "tools-repository"
     description: "Tool to make cool stuff"

Notes

If you need to use tool on multi os then you may want to have different values for executables path's so you can use:

field:
  :windows: value1
  :linux:   value2

For packages:

Mandatory fields: id, type, project, source, description, authors Optional fields: title, licenseUrl, projectUrl, copyright, iconUrl, requireLicenseAcceptance, releaseNotes, tags, owners

Store common fields in global configuration under all_packages field

You can use types:

  • :tool - to put all files from project/bin/[Configuration]/ folder into tools/
  • :project - to create usual nuget package from Project.csproj

Tools

  • MSBuild (C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe) for compilation
  • Nuget (C:\Nuget\Nuget.exe) for package management
  • NUnit (NUnit.Console latest pre-release nuget package) for tests
  • OpenCover (OpenCover latest release nuget package) for coverage
  • NUnitOrange (NUnitOrange latest release nuget package) for nunit tests result convertion to html
  • ReportGenerator (ReportGenerator latest release nuget package) for OpenCover result convertion to html

Compatibility

Alpaca is tested on travis-ci.org with following Ruby implementations:

  • MRI 1.9.3
  • MRI 2.0
  • MRI 2.1
  • MRI 2.2

Contribution

If you discover issues, have ideas for improvements or new features, please report them to me [email protected] or submit a pull request. Please, try to follow these guidelines when you do so.

Rake tasks

rake build                # Build alpacabuildtool-1.0.0.rc.gem
                          #   into the pkg directory.
rake clean                # Remove any temporary products.
rake clobber              # Remove any generated file.
rake clobber_rdoc         # Remove RDoc HTML files
rake coverage             # Run RSpec with code coverage
rake features             # Run Cucumber features
rake install              # Build and install alpacabuildtool gem
                          #   into system gems.
rake install:local        # Build and install alpacabuildtool gem
                          #   into system gems without network access.
rake rdoc                 # Build RDoc HTML files
rake release              # Create tag v{VERSION} and build and
                          #   push alpacabuildtool gem to Rubygems
                          #   To prevent publishing in Rubygems
                          #   use `gem_push=no rake release`
rake rerdoc               # Rebuild RDoc HTML files
rake rubocop              # Run RuboCop
rake rubocop:auto_correct # Auto-correct RuboCop offenses
rake test                 # Run RSpec code examples

Pull requests

Changelog

Alpaca's changelog is available here.

Copyright

Copyright (c) 2015 Vasyl Purchel. See LICENSE for further details.