albacore 1.0.0 → 2.0.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -21
- data/.travis.yml +31 -12
- data/Gemfile +14 -6
- data/Guardfile +1 -3
- data/README.md +200 -47
- data/Rakefile +9 -19
- data/albacore.gemspec +33 -23
- data/lib/albacore.rb +3 -47
- data/lib/albacore/albacore_module.rb +57 -0
- data/lib/albacore/application.rb +43 -0
- data/lib/albacore/cmd_config.rb +66 -0
- data/lib/albacore/config_dsl.rb +55 -0
- data/lib/albacore/cross_platform_cmd.rb +291 -0
- data/lib/albacore/dsl.rb +90 -0
- data/lib/albacore/errors/command_failed_error.rb +11 -0
- data/lib/albacore/errors/command_not_found_error.rb +13 -0
- data/lib/albacore/errors/unfilled_property_error.rb +14 -0
- data/lib/albacore/ext/README.md +12 -0
- data/lib/albacore/ext/teamcity.rb +64 -0
- data/lib/albacore/facts.rb +25 -0
- data/lib/albacore/logging.rb +32 -0
- data/lib/albacore/nuget_model.rb +387 -0
- data/lib/albacore/paths.rb +34 -0
- data/lib/albacore/project.rb +141 -0
- data/lib/albacore/semver.rb +5 -0
- data/lib/albacore/task_types/asmver.rb +72 -0
- data/lib/albacore/task_types/asmver/cpp.rb +20 -0
- data/lib/albacore/task_types/asmver/cs.rb +17 -0
- data/lib/albacore/task_types/asmver/engine.rb +126 -0
- data/lib/albacore/task_types/asmver/file_generator.rb +45 -0
- data/lib/albacore/task_types/asmver/fs.rb +37 -0
- data/lib/albacore/task_types/asmver/vb.rb +27 -0
- data/lib/albacore/task_types/build.rb +192 -0
- data/lib/albacore/task_types/nugets_authentication.rb +9 -0
- data/lib/albacore/task_types/nugets_pack.rb +378 -0
- data/lib/albacore/task_types/nugets_restore.rb +138 -0
- data/lib/albacore/task_types/test_runner.rb +39 -0
- data/lib/albacore/tasks/README.md +16 -0
- data/lib/albacore/tasks/albasemver.rb +49 -0
- data/lib/albacore/tasks/projectlint.rb +81 -0
- data/lib/albacore/tasks/versionizer.rb +65 -0
- data/lib/albacore/tools/fluent_migrator.rb +177 -0
- data/lib/albacore/tools/restore_hint_paths.rb +112 -0
- data/lib/albacore/version.rb +3 -3
- data/spec/Rakefile +5 -0
- data/spec/albacore_spec.rb +12 -0
- data/spec/asmver_spec.rb +151 -0
- data/spec/asmver_task_spec.rb +32 -0
- data/spec/build_spec.rb +60 -0
- data/spec/config_dsl_spec.rb +83 -0
- data/spec/cross_platform_cmd_spec.rb +65 -0
- data/spec/dsl_spec.rb +39 -0
- data/spec/ext_teamcity_spec.rb +71 -0
- data/spec/facts_spec.rb +7 -0
- data/spec/nuget_model_spec.rb +401 -0
- data/spec/nugets_pack_spec.rb +231 -0
- data/spec/nugets_restore_spec.rb +55 -0
- data/spec/project_spec.rb +26 -0
- data/spec/projectlint/added_but_not_on_filesystem/aproject.csproj +29 -0
- data/spec/projectlint/correct/File.cs +1 -0
- data/spec/projectlint/correct/Image.txt +1 -0
- data/spec/projectlint/correct/MyHeavy.heavy +1 -0
- data/spec/projectlint/correct/Schema.xsd +1 -0
- data/spec/projectlint/correct/SubFolder/AnotherFile.cs +1 -0
- data/spec/projectlint/correct/aproject.csproj +29 -0
- data/spec/projectlint/on_filesystem_but_not_added/File.cs +1 -0
- data/spec/projectlint/on_filesystem_but_not_added/Image.txt +1 -0
- data/spec/projectlint/on_filesystem_but_not_added/aproject.csproj +11 -0
- data/spec/projectlint_spec.rb +77 -0
- data/spec/smoke_spec.rb +55 -0
- data/spec/spec_helper.rb +19 -20
- data/spec/support/Nuget/NuGet.exe +0 -0
- data/spec/support/echo/FSharp.Core.dll +0 -0
- data/spec/support/echo/FSharp.Core.xml +10517 -0
- data/spec/support/echo/echo.XML +12 -0
- data/spec/support/echo/echo.exe +0 -0
- data/spec/support/echo/echo.exe.config +17 -0
- data/spec/support/echo/echo.pdb +0 -0
- data/spec/support/returnstatus/FSharp.Core.dll +0 -0
- data/spec/support/returnstatus/FSharp.Core.xml +10517 -0
- data/spec/support/returnstatus/returnstatus.XML +12 -0
- data/spec/support/returnstatus/returnstatus.exe +0 -0
- data/spec/support/returnstatus/returnstatus.exe.config +17 -0
- data/spec/support/returnstatus/returnstatus.pdb +0 -0
- data/spec/support/sh_interceptor.rb +83 -0
- data/spec/testdata/.gitignore +5 -0
- data/spec/testdata/DebugProject/.gitignore +1 -0
- data/spec/testdata/DebugProject/Degbu.fsproj +57 -0
- data/spec/testdata/DebugProject/Degbu.sln +20 -0
- data/spec/testdata/DebugProject/Gemfile +1 -0
- data/spec/testdata/DebugProject/Library1.fs +4 -0
- data/spec/testdata/DebugProject/Rakefile +22 -0
- data/spec/testdata/EmptyProject/EmptyProject.csproj +39 -0
- data/spec/{assemblyinfo → testdata/EmptyProject/Properties}/AssemblyInfo.cs +5 -5
- data/spec/testdata/Gemfile +1 -0
- data/spec/testdata/NuGet.exe +0 -0
- data/spec/testdata/Project/Library1.fs +4 -0
- data/spec/testdata/Project/Project.fsproj +52 -0
- data/spec/testdata/Project/Project.sln +20 -0
- data/spec/testdata/Project/packages.config +6 -0
- data/spec/testdata/Rakefile +22 -0
- data/spec/testdata/TestingDependencies/Sample.Commands/Library.fs +6 -0
- data/spec/testdata/TestingDependencies/Sample.Commands/Sample.Commands.fsproj +78 -0
- data/spec/testdata/TestingDependencies/Sample.Commands/Script.fsx +8 -0
- data/spec/testdata/TestingDependencies/Sample.Commands/packages.config +6 -0
- data/spec/testdata/TestingDependencies/Sample.Core/Library.fs +3 -0
- data/spec/testdata/TestingDependencies/Sample.Core/Sample.Core.fsproj +59 -0
- data/spec/testdata/TestingDependencies/Sample.Core/Script.fsx +8 -0
- data/spec/testdata/TestingDependencies/Sample.Core/packages.config +4 -0
- data/spec/testdata/TestingDependencies/Sample.sln +26 -0
- data/spec/testdata/TestingDependencies/vendor/FSharp.Core.dll +0 -0
- data/spec/testdata/TestingDependencies/vendor/FSharp.Core.optdata +0 -0
- data/spec/testdata/TestingDependencies/vendor/FSharp.Core.sigdata +0 -0
- data/spec/testdata/TestingDependencies/vendor/FSharp.Core.xml +8748 -0
- data/spec/testdata/example.nuspec +14 -0
- data/spec/testdata/example.symbols.nuspec +21 -0
- data/spec/tools/fluent_migrator_spec.rb +80 -0
- metadata +303 -212
- data/.bundle/config +0 -2
- data/.rspec +0 -2
- data/CONTRIBUTING.md +0 -87
- data/LICENSE +0 -21
- data/lib/albacore/albacoretask.rb +0 -50
- data/lib/albacore/aspnetcompiler.rb +0 -80
- data/lib/albacore/assemblyinfo.rb +0 -163
- data/lib/albacore/assemblyinfolanguages/assemblyinfoengine.rb +0 -54
- data/lib/albacore/assemblyinfolanguages/cppcliengine.rb +0 -18
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +0 -15
- data/lib/albacore/assemblyinfolanguages/fsharpengine.rb +0 -23
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +0 -15
- data/lib/albacore/config/aspnetcompilerconfig.rb +0 -30
- data/lib/albacore/config/assemblyinfoconfig.rb +0 -18
- data/lib/albacore/config/config.rb +0 -22
- data/lib/albacore/config/cscconfig.rb +0 -28
- data/lib/albacore/config/docuconfig.rb +0 -19
- data/lib/albacore/config/execconfig.rb +0 -19
- data/lib/albacore/config/fluentmigratorconfig.rb +0 -19
- data/lib/albacore/config/ilmergeconfig.rb +0 -19
- data/lib/albacore/config/msbuildconfig.rb +0 -29
- data/lib/albacore/config/mspecconfig.rb +0 -19
- data/lib/albacore/config/mstestconfig.rb +0 -19
- data/lib/albacore/config/nantconfig.rb +0 -18
- data/lib/albacore/config/nchurnconfig.rb +0 -19
- data/lib/albacore/config/ncoverconsoleconfig.rb +0 -19
- data/lib/albacore/config/ncoverreportconfig.rb +0 -18
- data/lib/albacore/config/ndependconfig.rb +0 -19
- data/lib/albacore/config/netversion.rb +0 -28
- data/lib/albacore/config/nugetinstallconfig.rb +0 -18
- data/lib/albacore/config/nugetpackconfig.rb +0 -18
- data/lib/albacore/config/nugetpushconfig.rb +0 -18
- data/lib/albacore/config/nugetupdateconfig.rb +0 -18
- data/lib/albacore/config/nunitconfig.rb +0 -19
- data/lib/albacore/config/nuspecconfig.rb +0 -18
- data/lib/albacore/config/plinkconfig.rb +0 -18
- data/lib/albacore/config/specflowconfig.rb +0 -18
- data/lib/albacore/config/sqlcmdconfig.rb +0 -18
- data/lib/albacore/config/unzipconfig.rb +0 -19
- data/lib/albacore/config/xbuildconfig.rb +0 -18
- data/lib/albacore/config/xunitconfig.rb +0 -18
- data/lib/albacore/config/zipdirectoryconfig.rb +0 -18
- data/lib/albacore/csc.rb +0 -77
- data/lib/albacore/docu.rb +0 -38
- data/lib/albacore/exec.rb +0 -20
- data/lib/albacore/fluentmigrator.rb +0 -69
- data/lib/albacore/ilmerge.rb +0 -38
- data/lib/albacore/msbuild.rb +0 -55
- data/lib/albacore/mspec.rb +0 -39
- data/lib/albacore/mstest.rb +0 -47
- data/lib/albacore/nant.rb +0 -41
- data/lib/albacore/nchurn.rb +0 -49
- data/lib/albacore/ncoverconsole.rb +0 -56
- data/lib/albacore/ncoverreport.rb +0 -40
- data/lib/albacore/ncoverreports.rb +0 -16
- data/lib/albacore/ncoverreports/assemblyfilter.rb +0 -10
- data/lib/albacore/ncoverreports/branchcoverage.rb +0 -10
- data/lib/albacore/ncoverreports/classfilter.rb +0 -9
- data/lib/albacore/ncoverreports/codecoveragebase.rb +0 -27
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +0 -23
- data/lib/albacore/ncoverreports/documentfilter.rb +0 -9
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +0 -9
- data/lib/albacore/ncoverreports/methodcoverage.rb +0 -10
- data/lib/albacore/ncoverreports/methodfilter.rb +0 -9
- data/lib/albacore/ncoverreports/namespacefilter.rb +0 -9
- data/lib/albacore/ncoverreports/reportbase.rb +0 -23
- data/lib/albacore/ncoverreports/reportfilterbase.rb +0 -29
- data/lib/albacore/ncoverreports/summaryreport.rb +0 -9
- data/lib/albacore/ncoverreports/symbolcoverage.rb +0 -9
- data/lib/albacore/ndepend.rb +0 -33
- data/lib/albacore/nugetinstall.rb +0 -62
- data/lib/albacore/nugetpack.rb +0 -50
- data/lib/albacore/nugetpush.rb +0 -40
- data/lib/albacore/nugetupdate.rb +0 -50
- data/lib/albacore/nunit.rb +0 -46
- data/lib/albacore/nuspec.rb +0 -180
- data/lib/albacore/output.rb +0 -105
- data/lib/albacore/plink.rb +0 -50
- data/lib/albacore/specflow.rb +0 -30
- data/lib/albacore/sqlcmd.rb +0 -67
- data/lib/albacore/support/attrmethods.rb +0 -33
- data/lib/albacore/support/createtask.rb +0 -50
- data/lib/albacore/support/failure.rb +0 -15
- data/lib/albacore/support/logging.rb +0 -38
- data/lib/albacore/support/openstruct.rb +0 -13
- data/lib/albacore/support/platform.rb +0 -25
- data/lib/albacore/support/runcommand.rb +0 -45
- data/lib/albacore/support/updateattributes.rb +0 -13
- data/lib/albacore/support/yamlconfig.rb +0 -18
- data/lib/albacore/unzip.rb +0 -42
- data/lib/albacore/xbuild.rb +0 -41
- data/lib/albacore/xunit.rb +0 -44
- data/lib/albacore/zipdirectory.rb +0 -106
- data/spec/albacoremodel_spec.rb +0 -52
- data/spec/aspnetcompiler_spec.rb +0 -84
- data/spec/assemblyinfo_spec.rb +0 -209
- data/spec/attrmethods_spec.rb +0 -135
- data/spec/config_spec.rb +0 -32
- data/spec/createtask_spec.rb +0 -234
- data/spec/csc_spec.rb +0 -86
- data/spec/docu_spec.rb +0 -31
- data/spec/exec_spec.rb +0 -25
- data/spec/fluentmigrator_spec.rb +0 -88
- data/spec/ilmerge_spec.rb +0 -35
- data/spec/msbuild_spec.rb +0 -55
- data/spec/mspec_spec.rb +0 -30
- data/spec/mstest_spec.rb +0 -35
- data/spec/nant_spec.rb +0 -40
- data/spec/nchurn_spec.rb +0 -80
- data/spec/ncoverconsole_spec.rb +0 -80
- data/spec/ncoverreport_spec.rb +0 -139
- data/spec/ndepend_spec.rb +0 -26
- data/spec/netversion_spec.rb +0 -51
- data/spec/nugetinstall_spec.rb +0 -59
- data/spec/nugetpack_spec.rb +0 -49
- data/spec/nugetpush_spec.rb +0 -39
- data/spec/nugetupdate_spec.rb +0 -49
- data/spec/nunit_spec.rb +0 -35
- data/spec/nuspec/nuspec.xsd +0 -84
- data/spec/nuspec_spec.rb +0 -74
- data/spec/output/bar/bar.txt +0 -0
- data/spec/output/baz.txt +0 -0
- data/spec/output/erb.txt +0 -1
- data/spec/output/foo/foo/foo.txt +0 -0
- data/spec/output_spec.rb +0 -85
- data/spec/patch/system_patch.rb +0 -12
- data/spec/platform_spec.rb +0 -15
- data/spec/plink_spec.rb +0 -56
- data/spec/runcommand_spec.rb +0 -92
- data/spec/specflow_spec.rb +0 -30
- data/spec/sqlcmd_spec.rb +0 -66
- data/spec/unzip_spec.rb +0 -56
- data/spec/xbuild_spec.rb +0 -40
- data/spec/xunit_spec.rb +0 -30
- data/spec/yaml/test.yml +0 -3
- data/spec/yamlconfig_spec.rb +0 -53
- data/spec/zip/baz.txt +0 -0
- data/spec/zip/foo/bar/bar.txt +0 -0
- data/spec/zip/foo/foo.txt +0 -0
- data/spec/zip_spec.rb +0 -97
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'albacore/support/updateattributes'
|
2
|
-
|
3
|
-
module NCover
|
4
|
-
class CyclomaticComplexity
|
5
|
-
include UpdateAttributes
|
6
|
-
|
7
|
-
attr_accessor :maximum, :item_type
|
8
|
-
|
9
|
-
def initialize(params={})
|
10
|
-
@maximum = 100
|
11
|
-
@item_type = :View
|
12
|
-
update_attributes(params) if params
|
13
|
-
super()
|
14
|
-
end
|
15
|
-
|
16
|
-
def get_coverage_options
|
17
|
-
options = "CyclomaticComplexity"
|
18
|
-
options << ":#{@maximum}" if @maximum
|
19
|
-
options << ":#{@item_type}" if @item_type
|
20
|
-
options
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require "albacore/support/updateattributes"
|
2
|
-
|
3
|
-
module NCover
|
4
|
-
class ReportBase
|
5
|
-
include UpdateAttributes
|
6
|
-
|
7
|
-
attr_accessor :output_path,
|
8
|
-
:report_format,
|
9
|
-
:report_type
|
10
|
-
|
11
|
-
def initialize(params = {})
|
12
|
-
update_attributes(params) if params
|
13
|
-
super()
|
14
|
-
end
|
15
|
-
|
16
|
-
def get_report_options()
|
17
|
-
o = "#{@report_type}"
|
18
|
-
o << ":#{@report_format}" if @report_format
|
19
|
-
o << ":\"#{@output_path}\"" if @output_path
|
20
|
-
o
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require 'albacore/support/updateattributes'
|
2
|
-
|
3
|
-
module NCover
|
4
|
-
class ReportFilterBase
|
5
|
-
include UpdateAttributes
|
6
|
-
|
7
|
-
attr_accessor :filter,
|
8
|
-
:filter_type,
|
9
|
-
:item_type,
|
10
|
-
:is_regex
|
11
|
-
|
12
|
-
def initialize(item_type, params={})
|
13
|
-
@filter = ""
|
14
|
-
@item_type = item_type
|
15
|
-
@is_regex = false
|
16
|
-
@filter_type = :exclude
|
17
|
-
update_attributes(params) if params
|
18
|
-
super()
|
19
|
-
end
|
20
|
-
|
21
|
-
def get_filter_options
|
22
|
-
f = "\"#{@filter}\""
|
23
|
-
f << ":#{@item_type}"
|
24
|
-
f << ":#{@is_regex}"
|
25
|
-
f << ":#{@filter_type == :include}"
|
26
|
-
f
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/lib/albacore/ndepend.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/ndependconfig"
|
3
|
-
|
4
|
-
class NDepend
|
5
|
-
TaskName = :ndepend
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NDepend
|
10
|
-
|
11
|
-
attr_accessor :project_file
|
12
|
-
|
13
|
-
def initialize()
|
14
|
-
super()
|
15
|
-
update_attributes(ndepend.to_hash)
|
16
|
-
end
|
17
|
-
|
18
|
-
def execute
|
19
|
-
unless @project_file
|
20
|
-
fail_with_message("ndepend requires #project_file")
|
21
|
-
return
|
22
|
-
end
|
23
|
-
|
24
|
-
result = run_command(@command, build_parameters)
|
25
|
-
fail_with_message("NDepend failed, see the build log for more details.") unless result
|
26
|
-
end
|
27
|
-
|
28
|
-
def build_parameters
|
29
|
-
p = []
|
30
|
-
p << "\"#{File.expand_path(@project_file)}\""
|
31
|
-
p
|
32
|
-
end
|
33
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nugetinstallconfig"
|
3
|
-
|
4
|
-
class NuGetInstall
|
5
|
-
TaskName = :nugetinstall
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NuGetInstall
|
10
|
-
|
11
|
-
attr_reader :no_cache,
|
12
|
-
:prerelease,
|
13
|
-
:exclude_version
|
14
|
-
|
15
|
-
attr_accessor :package,
|
16
|
-
:output_directory,
|
17
|
-
:version
|
18
|
-
|
19
|
-
attr_array :sources
|
20
|
-
|
21
|
-
def initialize()
|
22
|
-
@command = "nuget"
|
23
|
-
|
24
|
-
super()
|
25
|
-
update_attributes(nugetinstall.to_hash)
|
26
|
-
end
|
27
|
-
|
28
|
-
def execute
|
29
|
-
unless @package
|
30
|
-
fail_with_message("nugetinstall requires #package")
|
31
|
-
return
|
32
|
-
end
|
33
|
-
|
34
|
-
result = run_command("nugetinstall", build_parameters)
|
35
|
-
fail_with_message("NuGet Install failed, see the build log for more details.") unless result
|
36
|
-
end
|
37
|
-
|
38
|
-
def build_parameters
|
39
|
-
p = []
|
40
|
-
p << "install"
|
41
|
-
p << @package
|
42
|
-
p << "-Version #{@version}" if @version
|
43
|
-
p << "-OutputDirectory \"#{@output_directory}\"" if @output_directory
|
44
|
-
p << "-ExcludeVersion" if @exclude_version
|
45
|
-
p << "-NoCache" if @no_cache
|
46
|
-
p << "-Prerelease" if @prerelease
|
47
|
-
p << "-Source \"#{@sources.join(";")}\"" if @sources
|
48
|
-
p
|
49
|
-
end
|
50
|
-
|
51
|
-
def no_cache
|
52
|
-
@no_cache = true
|
53
|
-
end
|
54
|
-
|
55
|
-
def prerelease
|
56
|
-
@prerelease = true
|
57
|
-
end
|
58
|
-
|
59
|
-
def exclude_version
|
60
|
-
@exclude_version = true
|
61
|
-
end
|
62
|
-
end
|
data/lib/albacore/nugetpack.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nugetpackconfig"
|
3
|
-
|
4
|
-
class NuGetPack
|
5
|
-
TaskName = :nugetpack
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NuGetPack
|
10
|
-
|
11
|
-
attr_reader :symbols
|
12
|
-
|
13
|
-
attr_accessor :nuspec,
|
14
|
-
:output_directory,
|
15
|
-
:base_path
|
16
|
-
|
17
|
-
attr_hash :properties
|
18
|
-
|
19
|
-
def initialize()
|
20
|
-
@command = "nuget"
|
21
|
-
|
22
|
-
super()
|
23
|
-
update_attributes(nugetpack.to_hash)
|
24
|
-
end
|
25
|
-
|
26
|
-
def execute
|
27
|
-
unless @nuspec
|
28
|
-
fail_with_message("nugetpack requires #nuspec" )
|
29
|
-
return
|
30
|
-
end
|
31
|
-
|
32
|
-
result = run_command("nugetpack", build_parameters)
|
33
|
-
fail_with_message("NuGet Pack failed, see the build log for more details.") unless result
|
34
|
-
end
|
35
|
-
|
36
|
-
def build_parameters
|
37
|
-
p = []
|
38
|
-
p << "pack"
|
39
|
-
p << "-Symbols" if @symbols
|
40
|
-
p << "\"#{@nuspec}\""
|
41
|
-
p << "-BasePath \"#{@base_path}\"" if @base_path
|
42
|
-
p << "-OutputDirectory \"#{@output_directory}\"" if @output_directory
|
43
|
-
p << "-Properties #{@properties.map { |key, value| "#{key}=\"#{value}\"" }.join(";")}" if @properties
|
44
|
-
p
|
45
|
-
end
|
46
|
-
|
47
|
-
def symbols
|
48
|
-
@symbols = true
|
49
|
-
end
|
50
|
-
end
|
data/lib/albacore/nugetpush.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nugetpushconfig"
|
3
|
-
|
4
|
-
class NuGetPush
|
5
|
-
TaskName = :nugetpush
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NuGetPush
|
10
|
-
|
11
|
-
attr_accessor :package,
|
12
|
-
:api_key,
|
13
|
-
:source
|
14
|
-
|
15
|
-
def initialize()
|
16
|
-
@command = "nuget"
|
17
|
-
|
18
|
-
super()
|
19
|
-
update_attributes(nugetpush.to_hash)
|
20
|
-
end
|
21
|
-
|
22
|
-
def execute
|
23
|
-
unless @package
|
24
|
-
fail_with_message("nugetinstall requires #package")
|
25
|
-
return
|
26
|
-
end
|
27
|
-
|
28
|
-
result = run_command("nugetpush", build_parameters)
|
29
|
-
fail_with_message("NuGet Push failed, see the build log for more details.") unless result
|
30
|
-
end
|
31
|
-
|
32
|
-
def build_parameters
|
33
|
-
p = []
|
34
|
-
p << "push"
|
35
|
-
p << "\"#{@package}\""
|
36
|
-
p << "#{@api_key}" if @api_key
|
37
|
-
p << "-Source #{source}" if @source
|
38
|
-
p
|
39
|
-
end
|
40
|
-
end
|
data/lib/albacore/nugetupdate.rb
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nugetupdateconfig"
|
3
|
-
|
4
|
-
class NuGetUpdate
|
5
|
-
TaskName = :nugetupdate
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NuGetUpdate
|
10
|
-
|
11
|
-
attr_reader :safe
|
12
|
-
|
13
|
-
attr_accessor :input_file,
|
14
|
-
:repository_path
|
15
|
-
|
16
|
-
attr_array :source,
|
17
|
-
:id
|
18
|
-
|
19
|
-
def initialize()
|
20
|
-
@command = "nuget"
|
21
|
-
|
22
|
-
super()
|
23
|
-
update_attributes(nugetupdate.to_hash)
|
24
|
-
end
|
25
|
-
|
26
|
-
def execute
|
27
|
-
unless @input_file
|
28
|
-
fail_with_message("nugetupdate requires #input_file")
|
29
|
-
return
|
30
|
-
end
|
31
|
-
|
32
|
-
result = run_command("nugetupdate", build_parameters)
|
33
|
-
fail_with_message("NuGet Update failed, see the build log for more details.") unless result
|
34
|
-
end
|
35
|
-
|
36
|
-
def build_parameters
|
37
|
-
p = []
|
38
|
-
p << "update"
|
39
|
-
p << "\"#{@input_file}\""
|
40
|
-
p << "-Source \"#{@source.join(";")}\"" if @source
|
41
|
-
p << "-Id \"#{@id.join(";")}\"" if @id
|
42
|
-
p << "-RepositoryPath #{@repository_path}" if @repository_path
|
43
|
-
p << "-Safe" if @safe
|
44
|
-
p
|
45
|
-
end
|
46
|
-
|
47
|
-
def safe
|
48
|
-
@safe = true
|
49
|
-
end
|
50
|
-
end
|
data/lib/albacore/nunit.rb
DELETED
@@ -1,46 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nunitconfig"
|
3
|
-
|
4
|
-
class NUnit
|
5
|
-
TaskName = :nunit
|
6
|
-
|
7
|
-
include Albacore::Task
|
8
|
-
include Albacore::RunCommand
|
9
|
-
include Configuration::NUnit
|
10
|
-
|
11
|
-
attr_reader :no_logo
|
12
|
-
|
13
|
-
attr_accessor :results_path
|
14
|
-
|
15
|
-
attr_array :assemblies
|
16
|
-
|
17
|
-
def initialize()
|
18
|
-
super()
|
19
|
-
update_attributes(nunit.to_hash)
|
20
|
-
end
|
21
|
-
|
22
|
-
def execute()
|
23
|
-
result = run_command("nunit", build_parameters)
|
24
|
-
fail_with_message("NUnit failed, see the build log for more details.") unless result
|
25
|
-
end
|
26
|
-
|
27
|
-
def build_parameters
|
28
|
-
p = []
|
29
|
-
p << @assemblies.map{ |asm| "\"#{asm}\"" } if @assemblies
|
30
|
-
p << "/xml=\"#{@results_path}\"" if @results_path
|
31
|
-
p << "/nologo" if @no_logo
|
32
|
-
p
|
33
|
-
end
|
34
|
-
|
35
|
-
def no_logo
|
36
|
-
@no_logo = true
|
37
|
-
end
|
38
|
-
|
39
|
-
def build_command_line
|
40
|
-
c = []
|
41
|
-
c << @command
|
42
|
-
c << build_parameters
|
43
|
-
c << @parameters
|
44
|
-
c
|
45
|
-
end
|
46
|
-
end
|
data/lib/albacore/nuspec.rb
DELETED
@@ -1,180 +0,0 @@
|
|
1
|
-
require "albacore/albacoretask"
|
2
|
-
require "albacore/config/nuspecconfig"
|
3
|
-
require "rexml/document"
|
4
|
-
|
5
|
-
class NuspecFile
|
6
|
-
def initialize(src, target, exclude)
|
7
|
-
@src = src
|
8
|
-
@target = target
|
9
|
-
@exclude = exclude
|
10
|
-
end
|
11
|
-
|
12
|
-
def render(xml)
|
13
|
-
depend = xml.add_element("file", { "src" => @src })
|
14
|
-
depend.add_attribute("target", @target) if @target
|
15
|
-
depend.add_attribute("exclude", @exclude) if @exclude
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
class NuspecDependency
|
20
|
-
attr_accessor :id, :version
|
21
|
-
|
22
|
-
def initialize(id, version)
|
23
|
-
@id = id
|
24
|
-
@version = version
|
25
|
-
end
|
26
|
-
|
27
|
-
def render(xml)
|
28
|
-
depend = xml.add_element("dependency", {"id" => @id, "version" => @version})
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class NuspecFrameworkAssembly
|
33
|
-
attr_accessor :name, :target_framework
|
34
|
-
|
35
|
-
def initialize(name, target_framework)
|
36
|
-
@name = name
|
37
|
-
@target_framework = target_framework
|
38
|
-
end
|
39
|
-
|
40
|
-
def render(xml)
|
41
|
-
depend = xml.add_element("frameworkAssembly", {"assemblyName" => @name, "targetFramework" => @target_framework})
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
class NuspecReference
|
46
|
-
attr_accessor :file
|
47
|
-
|
48
|
-
def initialize(file)
|
49
|
-
@file = file
|
50
|
-
end
|
51
|
-
|
52
|
-
def render(xml)
|
53
|
-
depend = xml.add_element("reference", {"file" => @file})
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
class Nuspec
|
58
|
-
include Albacore::Task
|
59
|
-
include Configuration::Nuspec
|
60
|
-
|
61
|
-
attr_reader :pretty_formatting,
|
62
|
-
:require_license_acceptance
|
63
|
-
|
64
|
-
attr_accessor :id,
|
65
|
-
:version,
|
66
|
-
:title,
|
67
|
-
:description,
|
68
|
-
:language,
|
69
|
-
:license_url,
|
70
|
-
:project_url,
|
71
|
-
:output_file,
|
72
|
-
:summary,
|
73
|
-
:icon_url,
|
74
|
-
:copyright,
|
75
|
-
:release_notes
|
76
|
-
|
77
|
-
attr_array :authors,
|
78
|
-
:owners,
|
79
|
-
:tags
|
80
|
-
|
81
|
-
def initialize()
|
82
|
-
@dependencies = []
|
83
|
-
@files = []
|
84
|
-
@frameworkAssemblies = []
|
85
|
-
@references = []
|
86
|
-
|
87
|
-
super()
|
88
|
-
update_attributes(nuspec.to_hash)
|
89
|
-
end
|
90
|
-
|
91
|
-
def pretty_formatting
|
92
|
-
@pretty_formatting = true
|
93
|
-
end
|
94
|
-
|
95
|
-
def require_license_acceptance
|
96
|
-
@require_license_acceptance = true
|
97
|
-
end
|
98
|
-
|
99
|
-
def dependency(id, version)
|
100
|
-
@dependencies << NuspecDependency.new(id, version)
|
101
|
-
end
|
102
|
-
|
103
|
-
def file(src, target = nil, exclude = nil)
|
104
|
-
@files << NuspecFile.new(src, target, exclude)
|
105
|
-
end
|
106
|
-
|
107
|
-
def framework_assembly(name, target_framework)
|
108
|
-
@frameworkAssemblies << NuspecFrameworkAssembly.new(name, target_framework)
|
109
|
-
end
|
110
|
-
|
111
|
-
def reference(file)
|
112
|
-
@references << NuspecReference.new(file)
|
113
|
-
end
|
114
|
-
|
115
|
-
def execute
|
116
|
-
check_required_field(@output_file, "output_file")
|
117
|
-
check_required_field(@id, "id")
|
118
|
-
check_required_field(@version, "version")
|
119
|
-
check_required_field(@authors, "authors")
|
120
|
-
check_required_field(@description, "description")
|
121
|
-
|
122
|
-
output = ""
|
123
|
-
|
124
|
-
builder = REXML::Document.new
|
125
|
-
build(builder)
|
126
|
-
builder.write(output, @pretty_formatting ? 2 : -1)
|
127
|
-
|
128
|
-
@logger.debug("Writing #{@output_file}")
|
129
|
-
|
130
|
-
File.open(@output_file, "w") { |f| f.write(output) }
|
131
|
-
end
|
132
|
-
|
133
|
-
def build(document)
|
134
|
-
document << REXML::XMLDecl.new
|
135
|
-
|
136
|
-
package = document.add_element("package")
|
137
|
-
package.add_attribute("xmlns", "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd")
|
138
|
-
|
139
|
-
metadata = package.add_element("metadata")
|
140
|
-
metadata.add_element("id").add_text(@id)
|
141
|
-
metadata.add_element("version").add_text(@version)
|
142
|
-
metadata.add_element("title").add_text(@title) if @title
|
143
|
-
metadata.add_element("authors").add_text(@authors.join(", "))
|
144
|
-
metadata.add_element("description").add_text(@description)
|
145
|
-
metadata.add_element("releaseNotes").add_text(@release_notes)
|
146
|
-
metadata.add_element("copyright").add_text(@copyright)
|
147
|
-
metadata.add_element("language").add_text(@language) if @language
|
148
|
-
metadata.add_element("licenseUrl").add_text(@license_url) if @license_url
|
149
|
-
metadata.add_element("projectUrl").add_text(@project_url) if @project_url
|
150
|
-
metadata.add_element("owners").add_text(@owners.join(", ")) if @owners
|
151
|
-
metadata.add_element("summary").add_text(@summary) if @summary
|
152
|
-
metadata.add_element("iconUrl").add_text(@icon_url) if @icon_url
|
153
|
-
metadata.add_element("requireLicenseAcceptance").add_text("true") if @require_license_acceptance
|
154
|
-
metadata.add_element("tags").add_text(@tags.join(" ")) if @tags
|
155
|
-
|
156
|
-
if @dependencies.length > 0
|
157
|
-
depend = metadata.add_element("dependencies")
|
158
|
-
@dependencies.each { |x| x.render(depend) }
|
159
|
-
end
|
160
|
-
|
161
|
-
if @files.length > 0
|
162
|
-
files = package.add_element("files")
|
163
|
-
@files.each { |x| x.render(files) }
|
164
|
-
end
|
165
|
-
|
166
|
-
if @frameworkAssemblies.length > 0
|
167
|
-
depend = metadata.add_element("frameworkAssemblies")
|
168
|
-
@frameworkAssemblies.each { |x| x.render(depend) }
|
169
|
-
end
|
170
|
-
|
171
|
-
if @references.length > 0
|
172
|
-
depend = metadata.add_element("references")
|
173
|
-
@references.each { |x| x.render(depend) }
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
177
|
-
def check_required_field(field, fieldname)
|
178
|
-
raise "nuspec requires \"#{fieldname}\"" unless field
|
179
|
-
end
|
180
|
-
end
|