derickbailey-Albacore 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/EULA.txt +19 -0
- data/lib/albacore.rb +4 -0
- data/lib/albacore/assemblyinfo.rb +56 -0
- data/lib/albacore/msbuild.rb +40 -0
- data/lib/albacore/patches/buildparameters.rb +15 -0
- data/lib/rake/assemblyinfotask.rb +21 -0
- data/lib/rake/msbuildtask.rb +21 -0
- data/lib/spec/assemblyinfo_spec.rb +129 -0
- data/lib/spec/assemblyinfotask_spec.rb +15 -0
- data/lib/spec/msbuild_spec.rb +81 -0
- data/lib/spec/msbuildtask_spec.rb +27 -0
- data/lib/spec/patches/system_patch.rb +8 -0
- data/lib/spec/support/TestSolution/TestSolution.sln +20 -0
- data/lib/spec/support/TestSolution/TestSolution/Class1.cs +11 -0
- data/lib/spec/support/TestSolution/TestSolution/Properties/AssemblyInfo.cs +36 -0
- data/lib/spec/support/TestSolution/TestSolution/TestSolution.csproj +59 -0
- data/lib/spec/support/assemblyinfotester.rb +34 -0
- data/lib/spec/support/msbuildtestdata.rb +26 -0
- data/lib/spec/support/spec_helper.rb +8 -0
- data/rakefile.rb +35 -0
- metadata +83 -0
data/EULA.txt
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2009 Derick Bailey. All Rights Reserved.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/lib/albacore.rb
ADDED
@@ -0,0 +1,4 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'albacore', 'msbuild')
|
2
|
+
require File.join(File.dirname(__FILE__), 'albacore', 'assemblyinfo')
|
3
|
+
require File.join(File.dirname(__FILE__), 'rake', 'msbuildtask')
|
4
|
+
require File.join(File.dirname(__FILE__), 'rake', 'assemblyinfotask')
|
@@ -0,0 +1,56 @@
|
|
1
|
+
class AssemblyInfo
|
2
|
+
|
3
|
+
attr_accessor :version, :title, :description, :output_file, :custom_attributes, :copyright, :com_visible, :com_guid
|
4
|
+
|
5
|
+
def write
|
6
|
+
write_assemblyinfo @output_file
|
7
|
+
end
|
8
|
+
|
9
|
+
def write_assemblyinfo(assemblyinfo_file)
|
10
|
+
File.open(assemblyinfo_file, 'w') do |f|
|
11
|
+
f.write using_statements + "\n"
|
12
|
+
|
13
|
+
f.write build_attribute("AssemblyVersion", @version) if @version != nil
|
14
|
+
f.write build_attribute("AssemblyTitle", @title) if @title != nil
|
15
|
+
f.write build_attribute("AssemblyDescription", @description) if @description != nil
|
16
|
+
f.write build_attribute("AssemblyCopyright", @copyright) if @copyright != nil
|
17
|
+
f.write build_attribute("ComVisible", @com_visible) if @com_visible != nil
|
18
|
+
f.write build_attribute("Guid", @com_guid) if @com_guid != nil
|
19
|
+
|
20
|
+
f.write "\n"
|
21
|
+
if @custom_attributes != nil
|
22
|
+
attributes = build_custom_attributes()
|
23
|
+
f.write attributes.join
|
24
|
+
f.write("\n")
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def custom_attributes(attributes)
|
31
|
+
@custom_attributes = attributes
|
32
|
+
end
|
33
|
+
|
34
|
+
def using_statements
|
35
|
+
statements = ''
|
36
|
+
statements << "using System.Reflection;\n"
|
37
|
+
statements << "using System.Runtime.InteropServices;\n"
|
38
|
+
statements
|
39
|
+
end
|
40
|
+
|
41
|
+
def build_attribute(attr_name, attr_data)
|
42
|
+
attribute = "[assembly: #{attr_name}("
|
43
|
+
attribute << "#{attr_data.inspect}" if attr_data != nil
|
44
|
+
attribute << ")]\n"
|
45
|
+
attribute
|
46
|
+
end
|
47
|
+
|
48
|
+
def build_custom_attributes()
|
49
|
+
attributes = []
|
50
|
+
@custom_attributes.each do |key, value|
|
51
|
+
attributes << build_attribute(key, value)
|
52
|
+
end
|
53
|
+
attributes
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'patches', 'buildparameters')
|
2
|
+
|
3
|
+
class MSBuild
|
4
|
+
attr_accessor :path_to_exe, :solution
|
5
|
+
|
6
|
+
def initialize(path_to_exe=nil)
|
7
|
+
if path_to_exe == nil
|
8
|
+
build_path_to_exe
|
9
|
+
else
|
10
|
+
@path_to_exe = path_to_exe
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def build_path_to_exe
|
15
|
+
@path_to_exe = File.join(ENV['windir'].dup, 'Microsoft.NET', 'Framework', 'v3.5', 'MSBuild.exe')
|
16
|
+
end
|
17
|
+
|
18
|
+
def targets(targets)
|
19
|
+
@targets=targets
|
20
|
+
@targets.extend(ArrayParameterBuilder)
|
21
|
+
end
|
22
|
+
|
23
|
+
def properties(properties)
|
24
|
+
@properties = properties
|
25
|
+
@properties.extend(HashParameterBuilder)
|
26
|
+
end
|
27
|
+
|
28
|
+
def build
|
29
|
+
build_solution(@solution)
|
30
|
+
end
|
31
|
+
|
32
|
+
def build_solution(solution)
|
33
|
+
cmd = "\"#{@path_to_exe}\" \"#{solution}\""
|
34
|
+
cmd << " /property:#{@properties.build_parameters}" if @properties != nil
|
35
|
+
cmd << " /target:#{@targets.build_parameters}" if @targets != nil
|
36
|
+
|
37
|
+
system cmd
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module HashParameterBuilder
|
2
|
+
def build_parameters
|
3
|
+
option_text = ''
|
4
|
+
self.each do |key, value|
|
5
|
+
option_text << "#{key}\=#{value};"
|
6
|
+
end
|
7
|
+
option_text.chop
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
module ArrayParameterBuilder
|
12
|
+
def build_parameters
|
13
|
+
self.join ";"
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/tasklib'
|
3
|
+
|
4
|
+
module Rake
|
5
|
+
class AssemblyInfoTask < Rake::TaskLib
|
6
|
+
attr_accessor :name
|
7
|
+
|
8
|
+
def initialize(name=:AssemblyInfo)
|
9
|
+
@name = name
|
10
|
+
@asm = AssemblyInfo.new
|
11
|
+
yield @asm if block_given?
|
12
|
+
define
|
13
|
+
end
|
14
|
+
|
15
|
+
def define
|
16
|
+
task name do
|
17
|
+
@asm.write
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/tasklib'
|
3
|
+
|
4
|
+
module Rake
|
5
|
+
class MSBuildTask < Rake::TaskLib
|
6
|
+
attr_accessor :name
|
7
|
+
|
8
|
+
def initialize(name=:MSBuild, msbuild_path=nil)
|
9
|
+
@name = name
|
10
|
+
@msbuild = MSBuild.new msbuild_path
|
11
|
+
yield @msbuild if block_given?
|
12
|
+
define
|
13
|
+
end
|
14
|
+
|
15
|
+
def define
|
16
|
+
task name do
|
17
|
+
@msbuild.build
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'spec_helper')
|
2
|
+
require 'assemblyinfotester'
|
3
|
+
require 'assemblyinfo'
|
4
|
+
|
5
|
+
describe AssemblyInfo, "when providing custom attributes" do
|
6
|
+
|
7
|
+
before :all do
|
8
|
+
@tester = AssemblyInfoTester.new
|
9
|
+
asm = AssemblyInfo.new
|
10
|
+
|
11
|
+
asm.custom_attributes :CustomAttribute => "custom attribute data", :AnotherAttribute => "more data here"
|
12
|
+
|
13
|
+
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should write the custom attributes to the assembly info file" do
|
17
|
+
@filedata.should include("[assembly: CustomAttribute(\"custom attribute data\")]")
|
18
|
+
@filedata.should include("[assembly: AnotherAttribute(\"more data here\")]")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe AssemblyInfo, "when specifying a custom attribute with no data" do
|
23
|
+
|
24
|
+
before :all do
|
25
|
+
@tester = AssemblyInfoTester.new
|
26
|
+
asm = AssemblyInfo.new
|
27
|
+
|
28
|
+
asm.custom_attributes :NoArgsAttribute => nil
|
29
|
+
|
30
|
+
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should write the attribute with an empty argument list" do
|
34
|
+
@filedata.should include("[assembly: NoArgsAttribute()]")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe AssemblyInfo, "when specifying an attribute with non-string data" do
|
39
|
+
|
40
|
+
before :all do
|
41
|
+
@tester = AssemblyInfoTester.new
|
42
|
+
asm = AssemblyInfo.new
|
43
|
+
|
44
|
+
asm.custom_attributes :NonStringAttribute => true
|
45
|
+
|
46
|
+
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should write the attribute data without quotes" do
|
50
|
+
@filedata.should include("[assembly: NonStringAttribute(true)]")
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe AssemblyInfo, "when generating an assembly info file" do
|
55
|
+
|
56
|
+
before :all do
|
57
|
+
@tester = AssemblyInfoTester.new
|
58
|
+
asm = AssemblyInfo.new
|
59
|
+
|
60
|
+
asm.version = @tester.version
|
61
|
+
asm.title = @tester.title
|
62
|
+
asm.description = @tester.description
|
63
|
+
asm.copyright = @tester.copyright
|
64
|
+
asm.com_visible = @tester.com_visible
|
65
|
+
asm.com_guid = @tester.com_guid
|
66
|
+
|
67
|
+
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should use the system.reflection namespace" do
|
71
|
+
@filedata.should include("using System.Reflection;")
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should use the system.runtime.interopservices namespace" do
|
75
|
+
@filedata.should include("using System.Runtime.InteropServices;")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should contain the specified version information" do
|
79
|
+
@filedata.should include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should contain the assembly title" do
|
83
|
+
@filedata.should include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should contain the assembly description" do
|
87
|
+
@filedata.should include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should contain the copyright information" do
|
91
|
+
@filedata.should include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should contain the com visible information" do
|
95
|
+
@filedata.should include("[assembly: ComVisible(#{@tester.com_visible})]")
|
96
|
+
@filedata.should include("[assembly: Guid(\"#{@tester.com_guid}\")]")
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe AssemblyInfo, "when generating an assembly info file with no attributes provided" do
|
101
|
+
|
102
|
+
before :all do
|
103
|
+
@tester = AssemblyInfoTester.new
|
104
|
+
asm = AssemblyInfo.new
|
105
|
+
|
106
|
+
@filedata = @tester.build_and_read_assemblyinfo_file asm
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should not contain the specified version information" do
|
110
|
+
@filedata.should_not include("[assembly: AssemblyVersion(\"#{@tester.version}\")]")
|
111
|
+
end
|
112
|
+
|
113
|
+
it "should not contain the assembly title" do
|
114
|
+
@filedata.should_not include("[assembly: AssemblyTitle(\"#{@tester.title}\")]")
|
115
|
+
end
|
116
|
+
|
117
|
+
it "should not contain the assembly description" do
|
118
|
+
@filedata.should_not include("[assembly: AssemblyDescription(\"#{@tester.description}\")]")
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should not contain the copyright information" do
|
122
|
+
@filedata.should_not include("[assembly: AssemblyCopyright(\"#{@tester.copyright}\")]")
|
123
|
+
end
|
124
|
+
|
125
|
+
it "should not contain the com visible information" do
|
126
|
+
@filedata.should_not include("[assembly: ComVisible(#{@tester.com_visible})]")
|
127
|
+
@filedata.should_not include("[assembly: Guid(\"#{@tester.com_guid}\")]")
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'spec_helper')
|
2
|
+
require 'assemblyinfo'
|
3
|
+
require 'assemblyinfotask'
|
4
|
+
|
5
|
+
describe Rake::AssemblyInfoTask, "when running" do
|
6
|
+
before :all do
|
7
|
+
Rake::AssemblyInfoTask.new() do |t|
|
8
|
+
@yielded_object = t
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should yield the assembly info api" do
|
13
|
+
@yielded_object.kind_of?(AssemblyInfo).should == true
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'spec_helper')
|
2
|
+
require 'msbuild'
|
3
|
+
require 'msbuildtestdata'
|
4
|
+
require 'system_patch'
|
5
|
+
|
6
|
+
describe MSBuild, "when an msbuild path is not specified" do
|
7
|
+
|
8
|
+
before :all do
|
9
|
+
@testdata = MSBuildTestData.new
|
10
|
+
@msbuild = @testdata.msbuild
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should default to the .net framework v3.5" do
|
14
|
+
@msbuild.path_to_exe.should == @testdata.msbuild_path
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe MSBuild, "when an msbuild path is specified" do
|
19
|
+
|
20
|
+
before :all do
|
21
|
+
@testdata = MSBuildTestData.new
|
22
|
+
@msbuild = @testdata.msbuild "Some Path"
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should use the specified path for the msbuild exe" do
|
26
|
+
@msbuild.path_to_exe.should == "Some Path"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe MSBuild, "when building a visual studio solution" do
|
31
|
+
|
32
|
+
before :all do
|
33
|
+
@testdata = MSBuildTestData.new
|
34
|
+
@msbuild = @testdata.msbuild
|
35
|
+
|
36
|
+
@msbuild.solution = @testdata.solution_path
|
37
|
+
@msbuild.build
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should output the solution's binaries" do
|
41
|
+
File.exist?(@testdata.output_path).should == true
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe MSBuild, "when building a visual studio solution for a specified configuration" do
|
46
|
+
|
47
|
+
before :all do
|
48
|
+
@testdata= MSBuildTestData.new("Release")
|
49
|
+
@msbuild = @testdata.msbuild
|
50
|
+
|
51
|
+
@msbuild.properties :configuration => :release
|
52
|
+
@msbuild.solution = @testdata.solution_path
|
53
|
+
@msbuild.build
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should build with the specified configuration as a property" do
|
57
|
+
$system_command.should include("/property:configuration=release")
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should output the solution's binaries according to the specified configuration" do
|
61
|
+
File.exist?(@testdata.output_path).should == true
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe MSBuild, "when specifying targets to build" do
|
66
|
+
|
67
|
+
before :all do
|
68
|
+
|
69
|
+
@testdata= MSBuildTestData.new
|
70
|
+
@msbuild = @testdata.msbuild
|
71
|
+
|
72
|
+
@msbuild.targets [:Clean, :Build]
|
73
|
+
@msbuild.solution = @testdata.solution_path
|
74
|
+
@msbuild.build
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should build the targets" do
|
78
|
+
$system_command.should include("/target:Clean;Build")
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), 'support', 'spec_helper')
|
2
|
+
require 'msbuild'
|
3
|
+
require 'msbuildtask'
|
4
|
+
|
5
|
+
describe Rake::MSBuildTask, "when running" do
|
6
|
+
before :all do
|
7
|
+
Rake::MSBuildTask.new() do |t|
|
8
|
+
@yielded_object = t
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should yield the msbuild api" do
|
13
|
+
@yielded_object.kind_of?(MSBuild).should == true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe Rake::MSBuildTask, "when specifying the msbuild path" do
|
18
|
+
before :all do
|
19
|
+
@msbuildtask = Rake::MSBuildTask.new(:name, "Path To Exe") do |t|
|
20
|
+
@msbuild = t
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should use the specified path for the msbuild exe" do
|
25
|
+
@msbuild.path_to_exe.should == "Path To Exe"
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
Microsoft Visual Studio Solution File, Format Version 10.00
|
3
|
+
# Visual Studio 2008
|
4
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestSolution", "TestSolution\TestSolution.csproj", "{36F8C06F-3BBA-4D11-9333-83573A760284}"
|
5
|
+
EndProject
|
6
|
+
Global
|
7
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
8
|
+
Debug|Any CPU = Debug|Any CPU
|
9
|
+
Release|Any CPU = Release|Any CPU
|
10
|
+
EndGlobalSection
|
11
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
12
|
+
{36F8C06F-3BBA-4D11-9333-83573A760284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
13
|
+
{36F8C06F-3BBA-4D11-9333-83573A760284}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
14
|
+
{36F8C06F-3BBA-4D11-9333-83573A760284}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
15
|
+
{36F8C06F-3BBA-4D11-9333-83573A760284}.Release|Any CPU.Build.0 = Release|Any CPU
|
16
|
+
EndGlobalSection
|
17
|
+
GlobalSection(SolutionProperties) = preSolution
|
18
|
+
HideSolutionNode = FALSE
|
19
|
+
EndGlobalSection
|
20
|
+
EndGlobal
|
@@ -0,0 +1,36 @@
|
|
1
|
+
using System.Reflection;
|
2
|
+
using System.Runtime.CompilerServices;
|
3
|
+
using System.Runtime.InteropServices;
|
4
|
+
|
5
|
+
// General Information about an assembly is controlled through the following
|
6
|
+
// set of attributes. Change these attribute values to modify the information
|
7
|
+
// associated with an assembly.
|
8
|
+
[assembly: AssemblyTitle("TestSolution")]
|
9
|
+
[assembly: AssemblyDescription("")]
|
10
|
+
[assembly: AssemblyConfiguration("")]
|
11
|
+
[assembly: AssemblyCompany("")]
|
12
|
+
[assembly: AssemblyProduct("TestSolution")]
|
13
|
+
[assembly: AssemblyCopyright("Copyright © 2009")]
|
14
|
+
[assembly: AssemblyTrademark("")]
|
15
|
+
[assembly: AssemblyCulture("")]
|
16
|
+
|
17
|
+
// Setting ComVisible to false makes the types in this assembly not visible
|
18
|
+
// to COM components. If you need to access a type in this assembly from
|
19
|
+
// COM, set the ComVisible attribute to true on that type.
|
20
|
+
[assembly: ComVisible(false)]
|
21
|
+
|
22
|
+
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
23
|
+
[assembly: Guid("dbabb27c-a536-4b5b-91f1-2226b6e3655c")]
|
24
|
+
|
25
|
+
// Version information for an assembly consists of the following four values:
|
26
|
+
//
|
27
|
+
// Major Version
|
28
|
+
// Minor Version
|
29
|
+
// Build Number
|
30
|
+
// Revision
|
31
|
+
//
|
32
|
+
// You can specify all the values or you can default the Build and Revision Numbers
|
33
|
+
// by using the '*' as shown below:
|
34
|
+
// [assembly: AssemblyVersion("1.0.*")]
|
35
|
+
[assembly: AssemblyVersion("1.0.0.0")]
|
36
|
+
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
3
|
+
<PropertyGroup>
|
4
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
5
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
6
|
+
<ProductVersion>9.0.30729</ProductVersion>
|
7
|
+
<SchemaVersion>2.0</SchemaVersion>
|
8
|
+
<ProjectGuid>{36F8C06F-3BBA-4D11-9333-83573A760284}</ProjectGuid>
|
9
|
+
<OutputType>Library</OutputType>
|
10
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
11
|
+
<RootNamespace>TestSolution</RootNamespace>
|
12
|
+
<AssemblyName>TestSolution</AssemblyName>
|
13
|
+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
14
|
+
<FileAlignment>512</FileAlignment>
|
15
|
+
</PropertyGroup>
|
16
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
17
|
+
<DebugSymbols>true</DebugSymbols>
|
18
|
+
<DebugType>full</DebugType>
|
19
|
+
<Optimize>false</Optimize>
|
20
|
+
<OutputPath>bin\Debug\</OutputPath>
|
21
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
22
|
+
<ErrorReport>prompt</ErrorReport>
|
23
|
+
<WarningLevel>4</WarningLevel>
|
24
|
+
</PropertyGroup>
|
25
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
26
|
+
<DebugType>pdbonly</DebugType>
|
27
|
+
<Optimize>true</Optimize>
|
28
|
+
<OutputPath>bin\Release\</OutputPath>
|
29
|
+
<DefineConstants>TRACE</DefineConstants>
|
30
|
+
<ErrorReport>prompt</ErrorReport>
|
31
|
+
<WarningLevel>4</WarningLevel>
|
32
|
+
</PropertyGroup>
|
33
|
+
<ItemGroup>
|
34
|
+
<Reference Include="System" />
|
35
|
+
<Reference Include="System.Core">
|
36
|
+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
37
|
+
</Reference>
|
38
|
+
<Reference Include="System.Xml.Linq">
|
39
|
+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
40
|
+
</Reference>
|
41
|
+
<Reference Include="System.Data.DataSetExtensions">
|
42
|
+
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
43
|
+
</Reference>
|
44
|
+
<Reference Include="System.Data" />
|
45
|
+
<Reference Include="System.Xml" />
|
46
|
+
</ItemGroup>
|
47
|
+
<ItemGroup>
|
48
|
+
<Compile Include="Class1.cs" />
|
49
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
50
|
+
</ItemGroup>
|
51
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
52
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
53
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
54
|
+
<Target Name="BeforeBuild">
|
55
|
+
</Target>
|
56
|
+
<Target Name="AfterBuild">
|
57
|
+
</Target>
|
58
|
+
-->
|
59
|
+
</Project>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'assemblyinfo'
|
2
|
+
|
3
|
+
class AssemblyInfoTester < AssemblyInfo
|
4
|
+
|
5
|
+
attr_accessor :assemblyinfo_file
|
6
|
+
|
7
|
+
def initialize
|
8
|
+
@version = "0.0.0.1"
|
9
|
+
@title = "some assembly title"
|
10
|
+
@description = "some assembly description goes here."
|
11
|
+
@copyright = "some copyright info goes here"
|
12
|
+
@com_visible = false
|
13
|
+
@com_guid = "dbabb27c-a536-4b5b-91f1-2226b6e3655c"
|
14
|
+
|
15
|
+
setup_assemblyinfo_file
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup_assemblyinfo_file
|
19
|
+
@assemblyinfo_file = File.join(File.dirname(__FILE__), "AssemblyInfo", "AssemblyInfo.cs")
|
20
|
+
File.delete @assemblyinfo_file if File.exist? @assemblyinfo_file
|
21
|
+
end
|
22
|
+
|
23
|
+
def build_and_read_assemblyinfo_file(assemblyinfo)
|
24
|
+
assemblyinfo.output_file = @assemblyinfo_file
|
25
|
+
assemblyinfo.write
|
26
|
+
|
27
|
+
contents = ''
|
28
|
+
File.open(@assemblyinfo_file, "r") do |f|
|
29
|
+
contents = f.read
|
30
|
+
end
|
31
|
+
contents
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'msbuild'
|
2
|
+
|
3
|
+
class MSBuildTestData
|
4
|
+
|
5
|
+
attr_accessor :msbuild_path, :solution_path, :config_mode, :output_path
|
6
|
+
|
7
|
+
def initialize(config_mode='Debug')
|
8
|
+
@solution_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution.sln")
|
9
|
+
@msbuild_path = "C:\\Windows/Microsoft.NET/Framework/v3.5/MSBuild.exe"
|
10
|
+
@config_mode = config_mode
|
11
|
+
|
12
|
+
setup_output
|
13
|
+
end
|
14
|
+
|
15
|
+
def setup_output
|
16
|
+
@output_path = File.join(File.dirname(__FILE__), "../", "support", "TestSolution", "TestSolution", "bin", "#{@config_mode}", "TestSolution.dll")
|
17
|
+
File.delete @output_path if File.exist? @output_path
|
18
|
+
end
|
19
|
+
|
20
|
+
def msbuild(path_to_msbuild=nil)
|
21
|
+
@msbuild = MSBuild.new path_to_msbuild
|
22
|
+
@msbuild.extend(SystemPatch)
|
23
|
+
@msbuild
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
2
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../")
|
3
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../../")
|
4
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../../rake/")
|
5
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../../albacore/")
|
6
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../../albacore/patches")
|
7
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../model/")
|
8
|
+
$: << File.join(File.expand_path(File.dirname(__FILE__)), "../patches/")
|
data/rakefile.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec/rake/spectask'
|
2
|
+
require 'lib/albacore'
|
3
|
+
|
4
|
+
task :default => :specs
|
5
|
+
|
6
|
+
desc "Run functional specs for the Albacore framework"
|
7
|
+
Spec::Rake::SpecTask.new :specs do |t|
|
8
|
+
t.spec_opts << '--colour'
|
9
|
+
t.spec_opts << '--format specdoc'
|
10
|
+
t.spec_files = FileList['lib/spec/**/*_spec.rb']
|
11
|
+
end
|
12
|
+
|
13
|
+
namespace :albacore do
|
14
|
+
|
15
|
+
desc "Run a complete Albacore build sample"
|
16
|
+
task :sample => ['albacore:assemblyinfo', 'albacore:msbuild']
|
17
|
+
|
18
|
+
desc "Run a sample build using the MSBuildTask"
|
19
|
+
Rake::MSBuildTask.new(:msbuild) do |msb|
|
20
|
+
msb.properties :configuration => :Debug
|
21
|
+
msb.targets [:Clean, :Build]
|
22
|
+
msb.solution = "lib/spec/support/TestSolution/TestSolution.sln"
|
23
|
+
end
|
24
|
+
|
25
|
+
desc "Run a sample assembly info generator"
|
26
|
+
Rake::AssemblyInfoTask.new(:assemblyinfo) do |asm|
|
27
|
+
asm.version = "0.1.2.3"
|
28
|
+
asm.title = "my assembly title"
|
29
|
+
asm.description = "this is the assembly description"
|
30
|
+
asm.copyright = "copyright some year, by some legal entity"
|
31
|
+
asm.custom_attributes :SomeAttribute => "some value goes here", :AnotherAttribute => "with some data"
|
32
|
+
|
33
|
+
asm.output_file = "lib/spec/support/AssemblyInfo/AssemblyInfo.cs"
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: derickbailey-Albacore
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Derick Bailey
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-05-16 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description:
|
17
|
+
email: derickbailey@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- rakefile.rb
|
26
|
+
- EULA.txt
|
27
|
+
- lib/albacore
|
28
|
+
- lib/albacore/assemblyinfo.rb
|
29
|
+
- lib/albacore/msbuild.rb
|
30
|
+
- lib/albacore/patches
|
31
|
+
- lib/albacore/patches/buildparameters.rb
|
32
|
+
- lib/albacore.rb
|
33
|
+
- lib/rake
|
34
|
+
- lib/rake/assemblyinfotask.rb
|
35
|
+
- lib/rake/msbuildtask.rb
|
36
|
+
- lib/spec
|
37
|
+
- lib/spec/assemblyinfo_spec.rb
|
38
|
+
- lib/spec/assemblyinfotask_spec.rb
|
39
|
+
- lib/spec/msbuildtask_spec.rb
|
40
|
+
- lib/spec/msbuild_spec.rb
|
41
|
+
- lib/spec/patches
|
42
|
+
- lib/spec/patches/system_patch.rb
|
43
|
+
- lib/spec/support
|
44
|
+
- lib/spec/support/AssemblyInfo
|
45
|
+
- lib/spec/support/assemblyinfotester.rb
|
46
|
+
- lib/spec/support/msbuildtestdata.rb
|
47
|
+
- lib/spec/support/spec_helper.rb
|
48
|
+
- lib/spec/support/TestSolution
|
49
|
+
- lib/spec/support/TestSolution/TestSolution
|
50
|
+
- lib/spec/support/TestSolution/TestSolution/Class1.cs
|
51
|
+
- lib/spec/support/TestSolution/TestSolution/Properties
|
52
|
+
- lib/spec/support/TestSolution/TestSolution/Properties/AssemblyInfo.cs
|
53
|
+
- lib/spec/support/TestSolution/TestSolution/TestSolution.csproj
|
54
|
+
- lib/spec/support/TestSolution/TestSolution.sln
|
55
|
+
has_rdoc: false
|
56
|
+
homepage: http://github.com/derickbailey/Albacore
|
57
|
+
licenses:
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
68
|
+
version:
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "0"
|
74
|
+
version:
|
75
|
+
requirements: []
|
76
|
+
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 1.3.5
|
79
|
+
signing_key:
|
80
|
+
specification_version: 2
|
81
|
+
summary: A Suite of Rake Build Tasks For .Net Solutions
|
82
|
+
test_files: []
|
83
|
+
|