alpacabuildtool 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +48 -0
- data/.rubocop.yml +12 -0
- data/.semver +6 -0
- data/.travis.yml +10 -0
- data/CHANGELOG +18 -0
- data/Gemfile +7 -0
- data/LICENSE +22 -0
- data/README.md +235 -0
- data/README.rdoc +39 -0
- data/Rakefile +74 -0
- data/alpacabuildtool.gemspec +34 -0
- data/alpacabuildtool.rdoc +5 -0
- data/alpacabuildtool.todo +9 -0
- data/bin/alpaca +142 -0
- data/features/alpaca.feature +8 -0
- data/features/step_definitions/alpaca_steps.rb +13 -0
- data/features/step_definitions/visual_studio_solutions_steps.rb +47 -0
- data/features/support/env.rb +10 -0
- data/features/visual_studio_solutions.feature +43 -0
- data/lib/alpacabuildtool.rb +4 -0
- data/lib/alpacabuildtool/application.rb +195 -0
- data/lib/alpacabuildtool/configuration.rb +209 -0
- data/lib/alpacabuildtool/data/.alpaca.conf +148 -0
- data/lib/alpacabuildtool/data/doom.flf +826 -0
- data/lib/alpacabuildtool/data/logo.jpg +0 -0
- data/lib/alpacabuildtool/entities/nuspec.rb +107 -0
- data/lib/alpacabuildtool/entities/project.rb +54 -0
- data/lib/alpacabuildtool/entities/solution.rb +104 -0
- data/lib/alpacabuildtool/entities/xml.rb +41 -0
- data/lib/alpacabuildtool/entities/xml_node.rb +75 -0
- data/lib/alpacabuildtool/log/font.rb +92 -0
- data/lib/alpacabuildtool/log/log.rb +15 -0
- data/lib/alpacabuildtool/log/rainbowify_formatter.rb +70 -0
- data/lib/alpacabuildtool/log/rainbowify_logger.rb +47 -0
- data/lib/alpacabuildtool/managers/build_manager.rb +32 -0
- data/lib/alpacabuildtool/managers/package_manager.rb +136 -0
- data/lib/alpacabuildtool/managers/report_manager.rb +33 -0
- data/lib/alpacabuildtool/managers/test_manager.rb +35 -0
- data/lib/alpacabuildtool/os.rb +29 -0
- data/lib/alpacabuildtool/package_types/project_package.rb +44 -0
- data/lib/alpacabuildtool/package_types/tool_package.rb +53 -0
- data/lib/alpacabuildtool/tools/git.rb +22 -0
- data/lib/alpacabuildtool/tools/msbuild.rb +29 -0
- data/lib/alpacabuildtool/tools/nuget.rb +49 -0
- data/lib/alpacabuildtool/tools/nunit.rb +28 -0
- data/lib/alpacabuildtool/tools/nunit_orange.rb +18 -0
- data/lib/alpacabuildtool/tools/open_cover.rb +29 -0
- data/lib/alpacabuildtool/tools/report_generator.rb +25 -0
- data/lib/alpacabuildtool/tools/tool.rb +84 -0
- data/lib/alpacabuildtool/tools/wrapper.rb +66 -0
- data/lib/alpacabuildtool/versioning/version.rb +163 -0
- data/lib/alpacabuildtool/versioning/versioning.rb +84 -0
- data/spec/lib/alpacabuildtool/configuration_spec.rb +201 -0
- data/spec/lib/alpacabuildtool/entities/xml_spec.rb +39 -0
- data/spec/lib/alpacabuildtool/versioning/version_spec.rb +86 -0
- data/spec/lib/alpacabuildtool/versioning/versioning_spec.rb +194 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/support/coverage.rb +26 -0
- data/test_data/sln1/.alpaca.conf +11 -0
- data/test_data/sln1/.semver +6 -0
- data/test_data/sln1/TestSolution.sln +22 -0
- data/test_data/sln1/TestSolution/App.config +6 -0
- data/test_data/sln1/TestSolution/Program.cs +16 -0
- data/test_data/sln1/TestSolution/Properties/AssemblyInfo.cs +36 -0
- data/test_data/sln1/TestSolution/TestSolution.csproj +59 -0
- data/test_data/sln2/.alpaca.conf +8 -0
- data/test_data/sln2/.semver +6 -0
- data/test_data/sln2/ProjectName/ProjectName.csproj +54 -0
- data/test_data/sln2/ProjectName/Properties/AssemblyInfo.cs +36 -0
- data/test_data/sln2/ProjectName/SomeFolderInProject/SomeClass.cs +16 -0
- data/test_data/sln2/ProjectName2/ProjectName2.csproj +58 -0
- data/test_data/sln2/ProjectName2/Properties/AssemblyInfo.cs +37 -0
- data/test_data/sln2/SolutionName.sln +34 -0
- data/test_data/sln2/Unit.Tests/Properties/AssemblyInfo.cs +36 -0
- data/test_data/sln2/Unit.Tests/SomeClassTests.cs +21 -0
- data/test_data/sln2/Unit.Tests/Unit.Tests.csproj +65 -0
- data/test_data/sln2/Unit.Tests/packages.config +4 -0
- data/test_data/sln3/TestSolution.nobuild.sln +22 -0
- data/test_data/sln3/TestSolution/App.config +6 -0
- data/test_data/sln3/TestSolution/Program.cs +16 -0
- data/test_data/sln3/TestSolution/Properties/AssemblyInfo.cs +36 -0
- data/test_data/sln3/TestSolution/TestSolution.nobuild.csproj +59 -0
- metadata +309 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c78949030dd18aefe2e3f58cd4755f73f3c7e666
|
4
|
+
data.tar.gz: d9444fca39a1137c4edb76a4f07b444b59639d21
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fcc063f2774d9b802a89a378609af2263010bc3ef48359cb294b0844db7bd537a6de31b4870b2d1d7820f60b24d6052e6d4eb01d6f9822074e234df6a56541f1
|
7
|
+
data.tar.gz: b08348bbd928db43bafe18605052ccbd5bbc06dc4a9a6dc09d904c0cc8e9e255cdc153f746d28fc83bacca005948a1ea4774a5f3dc8d125f9b3af01536294f63
|
data/.gitignore
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
*.gem
|
2
|
+
/pkg/
|
3
|
+
/reports/
|
4
|
+
/tmp/
|
5
|
+
|
6
|
+
## Specific to VisualStudio test data:
|
7
|
+
[Dd]ebug
|
8
|
+
[Rr]elease
|
9
|
+
[Oo]bj
|
10
|
+
*.suo
|
11
|
+
*.ide
|
12
|
+
|
13
|
+
## Documentation cache and generated files:
|
14
|
+
/.yardoc/
|
15
|
+
/_yardoc/
|
16
|
+
/doc/
|
17
|
+
/rdoc/
|
18
|
+
|
19
|
+
## Environment normalisation:
|
20
|
+
/.bundle/
|
21
|
+
/lib/bundler/man/
|
22
|
+
Gemfile.lock
|
23
|
+
|
24
|
+
## Cucumber test reports
|
25
|
+
results.html
|
26
|
+
offences.html
|
27
|
+
|
28
|
+
## rdoc
|
29
|
+
/html/
|
30
|
+
|
31
|
+
## bash autocompletion
|
32
|
+
.rake_t_cache
|
33
|
+
|
34
|
+
## coverage
|
35
|
+
/coverage/
|
36
|
+
|
37
|
+
## alpaca generated data
|
38
|
+
test_data/TestResults
|
39
|
+
test_data/sln2/packages
|
40
|
+
**/.tests
|
41
|
+
**/.output
|
42
|
+
*.nuspec
|
43
|
+
CHANGES.txt
|
44
|
+
README.txt
|
45
|
+
|
46
|
+
## mkmf (search tool in $PATH variable)
|
47
|
+
mkmf.log
|
48
|
+
|
data/.rubocop.yml
ADDED
data/.semver
ADDED
data/.travis.yml
ADDED
data/CHANGELOG
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= Version 1.0.0-rc
|
2
|
+
* Rebrand to alpacabuildtool due to conflict with existing alpaca gem
|
3
|
+
* Complete functionality
|
4
|
+
* Feature tests coverage for commands
|
5
|
+
* Specs coverage for main parts
|
6
|
+
* Automatic downloading of tools
|
7
|
+
* Generation of nuspec, readme, changelog files for packages
|
8
|
+
* Update rubocop to v0.30.1
|
9
|
+
* Tools are classes and not modules
|
10
|
+
* No Unity3D stubs/support
|
11
|
+
* Use ruby logger with beautifiers like *header* and *puts*
|
12
|
+
* New structure of the project
|
13
|
+
* New specs folder structure to match lib folder
|
14
|
+
* Complete documentation
|
15
|
+
|
16
|
+
= Version 0.0.1-alpha
|
17
|
+
* in development
|
18
|
+
* basic structure and functionality
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Vasyl Purchel
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,235 @@
|
|
1
|
+
# AlpacaBuildTool
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/vasyl-purchel/alpaca.svg?branch=master)](https://travis-ci.org/vasyl-purchel/alpaca)
|
4
|
+
[![Dependency Status](https://gemnasium.com/vasyl-purchel/alpaca.svg)](https://gemnasium.com/vasyl-purchel/alpaca)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/vasyl-purchel/alpaca/badge.svg?branch=master)](https://coveralls.io/r/vasyl-purchel/alpaca?branch=master)
|
6
|
+
[![Code Climate](https://codeclimate.com/github/vasyl-purchel/alpaca/badges/gpa.svg)](https://codeclimate.com/github/vasyl-purchel/alpaca)
|
7
|
+
[![Inline docs](https://inch-ci.org/github/vasyl-purchel/alpaca.svg)](http://inch-ci.org/github/vasyl-purchel/alpaca)
|
8
|
+
[![Gem Version](https://badge.fury.io/rb/alpacabuildtool.svg)](http://badge.fury.io/rb/alpacabuildtool)
|
9
|
+
|
10
|
+
<p align="center">
|
11
|
+
<img src="https://raw.githubusercontent.com/vasyl-purchel/alpaca/master/lib/alpacabuildtool/data/logo.jpg" alt="Logo"/>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
**AlpacaBuildTool** is a Ruby gem with **alpaca** command line interface that
|
15
|
+
helps to work with C# Visual Studio solutions
|
16
|
+
|
17
|
+
Most aspects of its behavior can be tweaked via various
|
18
|
+
[configuration options][1]
|
19
|
+
or via _alpaca configure_ command
|
20
|
+
|
21
|
+
- [Installation](#installation)
|
22
|
+
- [Basic usage](#basic-usage)
|
23
|
+
- [Configuration](#configuration)
|
24
|
+
- [Inheritance](#inheritance)
|
25
|
+
- [Defaults](#defaults)
|
26
|
+
- [User wide](#user-wide)
|
27
|
+
- [Solution specific](#solution-specific)
|
28
|
+
- [Default tools](#tools)
|
29
|
+
- [Compatibility](#compatibility)
|
30
|
+
- [Contribution](#contribution)
|
31
|
+
- [Pull requests](#pull-requests)
|
32
|
+
- [Changelog](#changelog)
|
33
|
+
- [Copyright](#copyright)
|
34
|
+
|
35
|
+
## Installation
|
36
|
+
|
37
|
+
Install gem:
|
38
|
+
|
39
|
+
```
|
40
|
+
$ gem install alpacabuildtool
|
41
|
+
```
|
42
|
+
|
43
|
+
## Basic Usage
|
44
|
+
|
45
|
+
```
|
46
|
+
SYNOPSIS
|
47
|
+
alpaca [global options] command [command options] [arguments...]
|
48
|
+
|
49
|
+
GLOBAL OPTIONS
|
50
|
+
--help - Show this message
|
51
|
+
-p, --pattern=arg - Solutions search pattern (default: **/*.sln)
|
52
|
+
--version - Display the program version
|
53
|
+
|
54
|
+
COMMANDS
|
55
|
+
compile - Compile solution[s]
|
56
|
+
configure - Configure alpaca to your needs
|
57
|
+
help - Shows a list of commands or help for one command
|
58
|
+
pack - Create packages for solution[s]
|
59
|
+
release - Release packages for solution[s]
|
60
|
+
report - Generate reports for solution[s]
|
61
|
+
test - Test solution[s]
|
62
|
+
update - Update solution[s] versions
|
63
|
+
```
|
64
|
+
|
65
|
+
Run `$ alpaca compile` and by default *alpaca* will search for all solutions
|
66
|
+
recurcively in current folder and compile all of them unless they have
|
67
|
+
*nobuild* tag in a name(`no_build: ['.nobuild']`)
|
68
|
+
|
69
|
+
It is safe to run alpaca from solution folder or any parent folders
|
70
|
+
If you want to build only specific solution then use global option
|
71
|
+
`$ alpaca -p '**/Cool.sln' compile`
|
72
|
+
|
73
|
+
Check `$ alpaca command --help` for help on each command
|
74
|
+
|
75
|
+
## Configuration
|
76
|
+
|
77
|
+
### Inheritance
|
78
|
+
|
79
|
+
Alpaca's configuration has 3 levels - default, global, local.
|
80
|
+
Local configuration has the highest priority so it can override any property
|
81
|
+
from other configurations. Global configuration can override only default
|
82
|
+
configuration.
|
83
|
+
|
84
|
+
### Defaults
|
85
|
+
|
86
|
+
Default configuration _(lib/data/.alpaca.conf)_ is stored with installing gem
|
87
|
+
so alpaca can work out of the box.
|
88
|
+
It shouldn't be changed as it will get overriden after gem updated
|
89
|
+
|
90
|
+
You can check it's defaults [here][1]
|
91
|
+
|
92
|
+
### User Wide
|
93
|
+
|
94
|
+
Global configuration _(~/.alpaca.conf)_ can be created manually or
|
95
|
+
with a help of `alpaca configure global ...`
|
96
|
+
You can use it to store user wide configuration to apply some tweaks of
|
97
|
+
default configuration to all your solutions
|
98
|
+
|
99
|
+
Check [default configuration][1]
|
100
|
+
for full explanation of structure and examples
|
101
|
+
|
102
|
+
### Solution Specific
|
103
|
+
|
104
|
+
Local configuration _(#{solution-folder}/.alpaca.conf)_ can be created
|
105
|
+
manually or with a help of `alpaca configure local ...`
|
106
|
+
You can use it to store solution specific configuration like nuget packages
|
107
|
+
to be created from solution or reports names.
|
108
|
+
|
109
|
+
Also you can change default path to local configuration by setting
|
110
|
+
|
111
|
+
```yaml
|
112
|
+
local_configuration: 'any/relative/path/to/local/configuration'
|
113
|
+
```
|
114
|
+
|
115
|
+
_this example will put your local configuration into_
|
116
|
+
`#{solution-folder}/any/relative/path/to/local/configuration` _file_
|
117
|
+
|
118
|
+
Common usage for local configuration would be nuget packages
|
119
|
+
|
120
|
+
#### Example
|
121
|
+
|
122
|
+
```yaml
|
123
|
+
packages:
|
124
|
+
- id: "Package.Unique.Id"
|
125
|
+
type: :tool
|
126
|
+
project: "Console.Tool"
|
127
|
+
source: "tools-repository"
|
128
|
+
description: "Tool to make cool stuff"
|
129
|
+
```
|
130
|
+
|
131
|
+
#### Notes
|
132
|
+
|
133
|
+
If you need to use tool on multi os then you may want to have different values
|
134
|
+
for executables path's so you can use:
|
135
|
+
|
136
|
+
```
|
137
|
+
field:
|
138
|
+
:windows: value1
|
139
|
+
:linux: value2
|
140
|
+
```
|
141
|
+
|
142
|
+
For packages:
|
143
|
+
|
144
|
+
Mandatory fields: `id`, `type`, `project`, `source`, `description`, `authors`
|
145
|
+
Optional fields: `title`, `licenseUrl`, `projectUrl`, `copyright`, `iconUrl`,
|
146
|
+
`requireLicenseAcceptance`, `releaseNotes`, `tags`, `owners`
|
147
|
+
|
148
|
+
Store common fields in global configuration under *all_packages* field
|
149
|
+
|
150
|
+
You can use types:
|
151
|
+
|
152
|
+
* `:tool` - to put all files from project/bin/[Configuration]/ folder
|
153
|
+
into tools/
|
154
|
+
* `:project` - to create usual nuget package from Project.csproj
|
155
|
+
|
156
|
+
## Tools
|
157
|
+
|
158
|
+
* MSBuild (C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe)
|
159
|
+
_for compilation_
|
160
|
+
* Nuget (C:\Nuget\Nuget.exe)
|
161
|
+
_for package management_
|
162
|
+
* NUnit (NUnit.Console latest pre-release nuget package)
|
163
|
+
_for tests_
|
164
|
+
* OpenCover (OpenCover latest release nuget package)
|
165
|
+
_for coverage_
|
166
|
+
* NUnitOrange (NUnitOrange latest release nuget package)
|
167
|
+
_for nunit tests result convertion to html_
|
168
|
+
* ReportGenerator (ReportGenerator latest release nuget package)
|
169
|
+
_for OpenCover result convertion to html_
|
170
|
+
|
171
|
+
## Compatibility
|
172
|
+
|
173
|
+
Alpaca is tested on travis-ci.org with following Ruby implementations:
|
174
|
+
|
175
|
+
* MRI 1.9.3
|
176
|
+
* MRI 2.0
|
177
|
+
* MRI 2.1
|
178
|
+
* MRI 2.2
|
179
|
+
|
180
|
+
## Contribution
|
181
|
+
|
182
|
+
If you discover issues, have ideas for improvements or new features,
|
183
|
+
please report them to me <vasyl.purchel@gmail.com> or submit a pull
|
184
|
+
request. Please, try to follow these guidelines when you do so.
|
185
|
+
|
186
|
+
### Rake tasks
|
187
|
+
|
188
|
+
```
|
189
|
+
rake build # Build alpacabuildtool-1.0.0.rc.gem
|
190
|
+
# into the pkg directory.
|
191
|
+
rake clean # Remove any temporary products.
|
192
|
+
rake clobber # Remove any generated file.
|
193
|
+
rake clobber_rdoc # Remove RDoc HTML files
|
194
|
+
rake coverage # Run RSpec with code coverage
|
195
|
+
rake features # Run Cucumber features
|
196
|
+
rake install # Build and install alpacabuildtool gem
|
197
|
+
# into system gems.
|
198
|
+
rake install:local # Build and install alpacabuildtool gem
|
199
|
+
# into system gems without network access.
|
200
|
+
rake rdoc # Build RDoc HTML files
|
201
|
+
rake release # Create tag v{VERSION} and build and
|
202
|
+
# push alpacabuildtool gem to Rubygems
|
203
|
+
# To prevent publishing in Rubygems
|
204
|
+
# use `gem_push=no rake release`
|
205
|
+
rake rerdoc # Rebuild RDoc HTML files
|
206
|
+
rake rubocop # Run RuboCop
|
207
|
+
rake rubocop:auto_correct # Auto-correct RuboCop offenses
|
208
|
+
rake test # Run RSpec code examples
|
209
|
+
```
|
210
|
+
|
211
|
+
### Pull requests
|
212
|
+
|
213
|
+
* Read [how to properly contribute to open source projects on Github][2].
|
214
|
+
* Fork the project.
|
215
|
+
* Write [good commit messages][3].
|
216
|
+
* Commit and push until you are happy with your contribution.
|
217
|
+
* Make sure to add tests for it. This is important so I don't break it
|
218
|
+
in a future version unintentionally.
|
219
|
+
* Add an entry to the [Changelog](CHANGELOG) accordingly.
|
220
|
+
* [Squash related commits together][4].
|
221
|
+
* Open a [pull request][5]
|
222
|
+
|
223
|
+
## Changelog
|
224
|
+
|
225
|
+
Alpaca's changelog is available [here](CHANGELOG).
|
226
|
+
|
227
|
+
## Copyright
|
228
|
+
|
229
|
+
Copyright (c) 2015 Vasyl Purchel. See [LICENSE](LICENSE) for further details.
|
230
|
+
|
231
|
+
[1]: https://github.com/vasyl-purchel/alpaca/blob/master/lib/alpacabuildtool/data/.alpaca.conf
|
232
|
+
[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request
|
233
|
+
[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
234
|
+
[4]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html
|
235
|
+
[5]: https://help.github.com/articles/using-pull-requests
|
data/README.rdoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
= \AlpacaBuildTool - yet another build tool
|
2
|
+
|
3
|
+
{<img src="https://travis-ci.org/vasyl-purchel/alpaca.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/vasyl-purchel/alpaca]
|
4
|
+
{<img src="https://gemnasium.com/vasyl-purchel/alpaca.svg" alt="Dependency Status" />}[https://gemnasium.com/vasyl-purchel/alpaca]
|
5
|
+
{<img src="https://coveralls.io/repos/vasyl-purchel/alpaca/badge.svg?branch=master" alt="Coverage Status" />}[https://coveralls.io/r/vasyl-purchel/alpaca?branch=master]
|
6
|
+
{<img src="https://codeclimate.com/github/vasyl-purchel/alpaca/badges/gpa.svg" alt="Code Climate" />}[https://codeclimate.com/github/vasyl-purchel/alpaca]
|
7
|
+
{<img src="https://inch-ci.org/github/vasyl-purchel/alpaca.svg" alt="Inline docs" />}[http://inch-ci.org/github/vasyl-purchel/alpaca]
|
8
|
+
{<img src="https://badge.fury.io/rb/alpacabuildtool.svg" alt="Gem Version" />}[http://badge.fury.io/rb/alpacabuildtool]
|
9
|
+
|
10
|
+
+AlpacaBuildTool+ is a Ruby gem with +alpaca+ command line interface that
|
11
|
+
helps to work with C# Visual Studio solutions
|
12
|
+
|
13
|
+
Most aspects of its behavior can be tweaked via various configuration options
|
14
|
+
or via command
|
15
|
+
|
16
|
+
alpaca configure
|
17
|
+
|
18
|
+
== Installation
|
19
|
+
|
20
|
+
Install gem:
|
21
|
+
|
22
|
+
$ gem install alpacabuildtool
|
23
|
+
|
24
|
+
== Compatibility
|
25
|
+
|
26
|
+
Alpaca is tested on travis-ci.org with following Ruby implementations:
|
27
|
+
|
28
|
+
* MRI 1.9.3
|
29
|
+
* MRI 2.0
|
30
|
+
* MRI 2.1
|
31
|
+
* MRI 2.2
|
32
|
+
|
33
|
+
== Changelog
|
34
|
+
|
35
|
+
Alpaca's changelog is available {here}[https://github.com/vasyl-purchel/alpaca/blob/master/CHANGELOG].
|
36
|
+
|
37
|
+
== Copyright
|
38
|
+
|
39
|
+
Copyright (c) 2015 Vasyl Purchel. See {LICENSE}[https://github.com/vasyl-purchel/alpaca/blob/master/LICENSE] for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rbconfig'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'rubygems/package_task'
|
7
|
+
require 'rdoc/task'
|
8
|
+
require 'cucumber'
|
9
|
+
require 'cucumber/rake/task'
|
10
|
+
require 'benchmark'
|
11
|
+
require 'rainbow'
|
12
|
+
require 'rainbow/ext/string' unless String.method_defined?(:color)
|
13
|
+
|
14
|
+
module Rake
|
15
|
+
# Redefining rake task to show benchmarking
|
16
|
+
class Task
|
17
|
+
def execute_with_benchmark(*args)
|
18
|
+
bench = Benchmark.measure do
|
19
|
+
execute_without_benchmark(*args)
|
20
|
+
end
|
21
|
+
puts '###########################################################'
|
22
|
+
puts "#{name} --> #{bench}"
|
23
|
+
puts '###########################################################'
|
24
|
+
end
|
25
|
+
alias_method :execute_without_benchmark, :execute
|
26
|
+
alias_method :execute, :execute_with_benchmark
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Rake::RDocTask.new do |rd|
|
31
|
+
rd.main = 'README.rdoc'
|
32
|
+
rd.rdoc_files.include('README.rdoc', 'lib/**/*.rb', 'bin/**/*')
|
33
|
+
rd.title = 'AlpacaBuildTool'
|
34
|
+
end
|
35
|
+
|
36
|
+
Bundler.setup
|
37
|
+
Bundler::GemHelper.install_tasks
|
38
|
+
|
39
|
+
CUKE_RESULTS = 'results.html'
|
40
|
+
CLEAN << CUKE_RESULTS
|
41
|
+
desc 'Run features'
|
42
|
+
Cucumber::Rake::Task.new(:features) do |t|
|
43
|
+
opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x"
|
44
|
+
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
|
45
|
+
case RbConfig::CONFIG['host_os']
|
46
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
47
|
+
opts += ' --tags @windows'
|
48
|
+
else
|
49
|
+
opts += ' --tags @linux'
|
50
|
+
end
|
51
|
+
t.cucumber_opts = opts
|
52
|
+
t.fork = false
|
53
|
+
end
|
54
|
+
|
55
|
+
task cucumber: :features
|
56
|
+
|
57
|
+
require 'rspec/core/rake_task'
|
58
|
+
RSpec::Core::RakeTask.new(:test) do |task|
|
59
|
+
task.rspec_opts = '--color --format documentation'
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'Run RSpec with code coverage'
|
63
|
+
task :coverage do
|
64
|
+
ENV['COVERAGE'] = 'true'
|
65
|
+
Rake::Task['test'].execute
|
66
|
+
end
|
67
|
+
|
68
|
+
require 'rubocop/rake_task'
|
69
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
70
|
+
task.formatters = %w(simple html)
|
71
|
+
task.options << '-ooffences.html'
|
72
|
+
end
|
73
|
+
|
74
|
+
task default: [:rubocop, :test, :features]
|