albacore 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +84 -81
- data/VERSION +1 -1
- data/install_dependencies.rb +10 -10
- data/lib/albacore.rb +10 -2
- data/lib/albacore/assemblyinfo.rb +100 -100
- data/lib/albacore/assemblyinfolanguages/csharpengine.rb +14 -0
- data/lib/albacore/assemblyinfolanguages/vbnetengine.rb +14 -0
- data/lib/albacore/docu.rb +39 -0
- data/lib/albacore/exec.rb +23 -0
- data/lib/albacore/expandtemplates.rb +73 -71
- data/lib/albacore/msbuild.rb +56 -61
- data/lib/albacore/mspectestrunner.rb +44 -42
- data/lib/albacore/nant.rb +39 -0
- data/lib/albacore/ncoverconsole.rb +68 -61
- data/lib/albacore/ncoverreport.rb +56 -55
- data/lib/albacore/ncoverreports/assemblyfilter.rb +7 -7
- data/lib/albacore/ncoverreports/branchcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/classfilter.rb +5 -5
- data/lib/albacore/ncoverreports/codecoveragebase.rb +22 -22
- data/lib/albacore/ncoverreports/cyclomaticcomplexity.rb +19 -19
- data/lib/albacore/ncoverreports/documentfilter.rb +5 -5
- data/lib/albacore/ncoverreports/fullcoveragereport.rb +17 -17
- data/lib/albacore/ncoverreports/methodcoverage.rb +7 -7
- data/lib/albacore/ncoverreports/methodfilter.rb +5 -5
- data/lib/albacore/ncoverreports/namespacefilter.rb +5 -5
- data/lib/albacore/ncoverreports/reportfilterbase.rb +23 -23
- data/lib/albacore/ncoverreports/summaryreport.rb +18 -18
- data/lib/albacore/ncoverreports/symbolcoverage.rb +6 -7
- data/lib/albacore/ndepend.rb +35 -0
- data/lib/albacore/nunittestrunner.rb +36 -35
- data/lib/albacore/plink.rb +48 -0
- data/lib/albacore/sftp.rb +33 -31
- data/lib/albacore/sqlcmd.rb +54 -51
- data/lib/albacore/ssh.rb +35 -33
- data/lib/albacore/support/albacore_helper.rb +1 -4
- data/lib/albacore/support/attrmethods.rb +25 -0
- data/lib/albacore/support/failure.rb +17 -17
- data/lib/albacore/support/globalconfig.rb +6 -0
- data/lib/albacore/support/logging.rb +30 -28
- data/lib/albacore/support/runcommand.rb +41 -41
- data/lib/albacore/support/yamlconfig.rb +23 -27
- data/lib/albacore/unzip.rb +28 -0
- data/lib/albacore/xbuild.rb +54 -0
- data/lib/albacore/xunittestrunner.rb +40 -43
- data/lib/albacore/zipdirectory.rb +72 -63
- data/lib/rake/assemblyinfotask.rb +12 -11
- data/lib/rake/docutask.rb +17 -0
- data/lib/rake/exectask.rb +18 -0
- data/lib/rake/expandtemplatestask.rb +12 -11
- data/lib/rake/msbuildtask.rb +13 -12
- data/lib/rake/mspectask.rb +12 -11
- data/lib/rake/nanttask.rb +17 -0
- data/lib/rake/ncoverconsoletask.rb +12 -11
- data/lib/rake/ncoverreporttask.rb +12 -11
- data/lib/rake/ndependtask.rb +23 -0
- data/lib/rake/nunittask.rb +12 -11
- data/lib/rake/plinktask.rb +23 -0
- data/lib/rake/renametask.rb +15 -15
- data/lib/rake/sftptask.rb +11 -10
- data/lib/rake/sqlcmdtask.rb +13 -12
- data/lib/rake/sshtask.rb +11 -10
- data/lib/rake/support/albacoretask.rb +16 -15
- data/lib/rake/unziptask.rb +17 -0
- data/lib/rake/xbuildtask.rb +22 -0
- data/lib/rake/xunittask.rb +12 -11
- data/lib/rake/ziptask.rb +12 -11
- data/rakefile.rb +255 -204
- data/spec/assemblyinfo_spec.rb +426 -221
- data/spec/assemblyinfotask_spec.rb +21 -21
- data/spec/docu_spec.rb +70 -0
- data/spec/docutask_spec.rb +39 -0
- data/spec/exec_spec.rb +23 -0
- data/spec/exectask_spec.rb +31 -0
- data/spec/expandtemplates_spec.rb +149 -148
- data/spec/expandtemplatestask_spec.rb +21 -21
- data/spec/msbuild_spec.rb +150 -139
- data/spec/msbuildtask_spec.rb +21 -21
- data/spec/mspectask_spec.rb +21 -21
- data/spec/nant_spec.rb +101 -0
- data/spec/nanttask_spec.rb +31 -0
- data/spec/ncoverconsole_spec.rb +253 -221
- data/spec/ncoverconsoletask_spec.rb +21 -21
- data/spec/ncoverreport_spec.rb +538 -523
- data/spec/ncoverreporttask_spec.rb +21 -21
- data/spec/ndepend_spec.rb +49 -0
- data/spec/{commandtask_spec.rb → ndependtask_spec.rb} +10 -10
- data/spec/nunittask_spec.rb +21 -21
- data/spec/nunittestrunner_spec.rb +6 -6
- data/spec/patches/docu_patch.rb +13 -0
- data/spec/patches/system_patch.rb +18 -18
- data/spec/patches/tasklib_patch.rb +10 -10
- data/spec/plink_spec.rb +61 -0
- data/spec/plinktask_spec.rb +31 -0
- data/spec/renametask_spec.rb +21 -21
- data/spec/sftp_spec.rb +24 -24
- data/spec/sftptask_spec.rb +31 -31
- data/spec/sqlcmd_spec.rb +118 -120
- data/spec/sqlcmdtask_spec.rb +21 -21
- data/spec/ssh_spec.rb +36 -37
- data/spec/sshtask_spec.rb +29 -29
- data/spec/support/TestSolution/NDependProject.xml +315 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/Class1.cs +12 -12
- data/spec/support/TestSolution/TestSolution.XUnitTests/FailingTestFixture.cs +14 -0
- data/spec/support/TestSolution/TestSolution.XUnitTests/TestSolution.XUnitTests.csproj +1 -0
- data/spec/support/TestSolution/TestSolution.build +25 -0
- data/spec/support/assemblyinfotester.rb +40 -38
- data/spec/support/expandtemplatestestdata.rb +73 -73
- data/spec/support/msbuildtestdata.rb +28 -28
- data/spec/support/nanttestdata.rb +33 -0
- data/spec/support/ncoverconsoletestdata.rb +18 -0
- data/spec/support/ncoverreporttestdata.rb +24 -24
- data/spec/support/spec_helper.rb +2 -1
- data/spec/support/yamlconfig/msbuild.yml +3 -0
- data/spec/support/yamlconfig/yaml_autoconfig_test.yml +1 -0
- data/spec/support/ziptestdata.rb +11 -6
- data/spec/xunit_spec.rb +63 -0
- data/spec/xunittask_spec.rb +19 -19
- data/spec/yamlconfig_spec.rb +38 -52
- data/spec/zip_spec.rb +56 -11
- data/spec/ziptask_spec.rb +22 -22
- metadata +53 -8
- data/lib/albacore/command.rb +0 -23
- data/lib/rake/commandtask.rb +0 -16
- data/spec/command_spec.rb +0 -23
data/README.markdown
CHANGED
@@ -1,81 +1,84 @@
|
|
1
|
-
# Welcome to the Albacore project.
|
2
|
-
|
3
|
-
Albacore is intended to be a professional quality suite of Rake tasks to help automate the process of building a .NET based system. All tasks are built using a test-first approach through rspec, and all tests are included in the Albacore gem.
|
4
|
-
|
5
|
-
## How To Install Albacore From Gemcutter Gems:
|
6
|
-
|
7
|
-
If you would like to install the current, stable release of Albacore, you can do so easily through the Gemcutter gem server. Follow these simple instructions and you will be good to go.
|
8
|
-
|
9
|
-
**Step 1:** Setup Gemcutter as a gem source
|
10
|
-
|
11
|
-
> gem source -a http://gemcutter.org
|
12
|
-
|
13
|
-
(note: you only need to do this once for any given computer that is going to install gems from gemcutter.)
|
14
|
-
|
15
|
-
**Step 2:** Install the Albacore gem
|
16
|
-
|
17
|
-
> gem install albacore
|
18
|
-
|
19
|
-
(note: as of v0.0.7, the "albacore" gem is spelled with a lowercase "a".)
|
20
|
-
|
21
|
-
## How To Manually Build And Install The Albacore Gem
|
22
|
-
|
23
|
-
If you would like to install the latest source code for Albacore, and get all the new features and functionality (possibly in an unstable form), you can manually build and install the Albacore gem. Follow these simple instructions and you will be good to go.
|
24
|
-
|
25
|
-
**Step 1:** Clone Albacore
|
26
|
-
|
27
|
-
Use your Github account to fork Albacore, or clone it directly from my public clone URL.
|
28
|
-
|
29
|
-
> git clone git://github.com/derickbailey/Albacore.git Albacore
|
30
|
-
|
31
|
-
**Step 2:** Build the gem
|
32
|
-
|
33
|
-
In your local clone of Albacore, use the jeweler rake tasks to build the latest version of the Albacore code into a gem.
|
34
|
-
|
35
|
-
> rake jeweler:gemspec
|
36
|
-
>
|
37
|
-
> rake jeweler:build
|
38
|
-
|
39
|
-
this will produce an 'albacore-#.#.#.gem' file in the 'pkg' folder, where '#.#.#' is the version number. For example 'albacore-0.0.7.gem'.
|
40
|
-
|
41
|
-
**Step 3:** Install the gem
|
42
|
-
|
43
|
-
After building the gem, you can install it from your local file system.
|
44
|
-
|
45
|
-
> gem install -l pkg/albacore-#.#.#.gem
|
46
|
-
|
47
|
-
where '#.#.#' is the version number of the gem. For example 'albacore-0.0.7.gem'
|
48
|
-
|
49
|
-
## How To Use Albacore
|
50
|
-
|
51
|
-
After installing Albacore, you only need to
|
52
|
-
|
53
|
-
require 'albacore'
|
54
|
-
|
55
|
-
in your rakefile. This will allow you to use the tasks that Albacore includes.
|
56
|
-
|
57
|
-
desc "Run a sample build using the MSBuildTask"
|
58
|
-
msbuildtask do |msb|
|
59
|
-
msb.properties = {:configuration => :Debug}
|
60
|
-
msb.targets [:Clean, :Build]
|
61
|
-
msb.solution = "spec/support/TestSolution/TestSolution.sln"
|
62
|
-
end
|
63
|
-
|
64
|
-
Beyond the simple example, check out the [Albacore Wiki](http://wiki.github.com/derickbailey/Albacore) for detailed instructions on how to use the built in tasks and their options.
|
65
|
-
|
66
|
-
## How To Contribute, Collaborate, Communicate
|
67
|
-
|
68
|
-
If you'd like to get involved with the Albacore framework, we have a discussion group over at google: **[AlbacoreDev](http://groups.google.com/group/albacoredev)**
|
69
|
-
|
70
|
-
Anyone can fork the main repository and submit patches, as well. And lastly, the [wiki](http://wiki.github.com/derickbailey/Albacore) and [issues list](http://github.com/derickbailey/Albacore/issues) are also open for additions, edits, and discussion.
|
71
|
-
|
72
|
-
## Contributors
|
73
|
-
|
74
|
-
Many thanks for contributions to Albacore are due:
|
75
|
-
|
76
|
-
* [
|
77
|
-
* [
|
78
|
-
* [
|
79
|
-
* [
|
80
|
-
* [
|
81
|
-
* [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
|
1
|
+
# Welcome to the Albacore project.
|
2
|
+
|
3
|
+
Albacore is intended to be a professional quality suite of Rake tasks to help automate the process of building a .NET based system. All tasks are built using a test-first approach through rspec, and all tests are included in the Albacore gem.
|
4
|
+
|
5
|
+
## How To Install Albacore From Gemcutter Gems:
|
6
|
+
|
7
|
+
If you would like to install the current, stable release of Albacore, you can do so easily through the Gemcutter gem server. Follow these simple instructions and you will be good to go.
|
8
|
+
|
9
|
+
**Step 1:** Setup Gemcutter as a gem source
|
10
|
+
|
11
|
+
> gem source -a http://gemcutter.org
|
12
|
+
|
13
|
+
(note: you only need to do this once for any given computer that is going to install gems from gemcutter.)
|
14
|
+
|
15
|
+
**Step 2:** Install the Albacore gem
|
16
|
+
|
17
|
+
> gem install albacore
|
18
|
+
|
19
|
+
(note: as of v0.0.7, the "albacore" gem is spelled with a lowercase "a".)
|
20
|
+
|
21
|
+
## How To Manually Build And Install The Albacore Gem
|
22
|
+
|
23
|
+
If you would like to install the latest source code for Albacore, and get all the new features and functionality (possibly in an unstable form), you can manually build and install the Albacore gem. Follow these simple instructions and you will be good to go.
|
24
|
+
|
25
|
+
**Step 1:** Clone Albacore
|
26
|
+
|
27
|
+
Use your Github account to fork Albacore, or clone it directly from my public clone URL.
|
28
|
+
|
29
|
+
> git clone git://github.com/derickbailey/Albacore.git Albacore
|
30
|
+
|
31
|
+
**Step 2:** Build the gem
|
32
|
+
|
33
|
+
In your local clone of Albacore, use the jeweler rake tasks to build the latest version of the Albacore code into a gem.
|
34
|
+
|
35
|
+
> rake jeweler:gemspec
|
36
|
+
>
|
37
|
+
> rake jeweler:build
|
38
|
+
|
39
|
+
this will produce an 'albacore-#.#.#.gem' file in the 'pkg' folder, where '#.#.#' is the version number. For example 'albacore-0.0.7.gem'.
|
40
|
+
|
41
|
+
**Step 3:** Install the gem
|
42
|
+
|
43
|
+
After building the gem, you can install it from your local file system.
|
44
|
+
|
45
|
+
> gem install -l pkg/albacore-#.#.#.gem
|
46
|
+
|
47
|
+
where '#.#.#' is the version number of the gem. For example 'albacore-0.0.7.gem'
|
48
|
+
|
49
|
+
## How To Use Albacore
|
50
|
+
|
51
|
+
After installing Albacore, you only need to
|
52
|
+
|
53
|
+
require 'albacore'
|
54
|
+
|
55
|
+
in your rakefile. This will allow you to use the tasks that Albacore includes.
|
56
|
+
|
57
|
+
desc "Run a sample build using the MSBuildTask"
|
58
|
+
msbuildtask do |msb|
|
59
|
+
msb.properties = {:configuration => :Debug}
|
60
|
+
msb.targets [:Clean, :Build]
|
61
|
+
msb.solution = "spec/support/TestSolution/TestSolution.sln"
|
62
|
+
end
|
63
|
+
|
64
|
+
Beyond the simple example, check out the [Albacore Wiki](http://wiki.github.com/derickbailey/Albacore) for detailed instructions on how to use the built in tasks and their options.
|
65
|
+
|
66
|
+
## How To Contribute, Collaborate, Communicate
|
67
|
+
|
68
|
+
If you'd like to get involved with the Albacore framework, we have a discussion group over at google: **[AlbacoreDev](http://groups.google.com/group/albacoredev)**
|
69
|
+
|
70
|
+
Anyone can fork the main repository and submit patches, as well. And lastly, the [wiki](http://wiki.github.com/derickbailey/Albacore) and [issues list](http://github.com/derickbailey/Albacore/issues) are also open for additions, edits, and discussion.
|
71
|
+
|
72
|
+
## Contributors
|
73
|
+
|
74
|
+
Many thanks for contributions to Albacore are due (in alphabetical order):
|
75
|
+
|
76
|
+
* [Andreone](http://github.com/Andreone): Significant Wiki contributions, questions and contributions on the google group
|
77
|
+
* [Ben Hall](http://github.com/benhall): Primary contributor. SSH, SFTP, ZipDirectory, Rename, YAML auto config, Wiki pages, and many other great additions
|
78
|
+
* [Brian Donahue](http://github.com/briandonahue): Inspiration and initial code for the ExpandTemplates task
|
79
|
+
* [Hibri Marzook](http://github.com/hibri): the PLink and NDepend tasks
|
80
|
+
* [James Gregory](http://github.com/jagregory): the Docu task
|
81
|
+
* [Kevin Colyar](http://github.com/kevincolyar): Testing and updating of MSBuild to work with Cygwin
|
82
|
+
* [Mark Wilkins](http://github.com/markwilk): VB.NET Language Generator For The AssemblyInfo Task
|
83
|
+
* [Sean Biefeld](http://github.com/seanbiefeld): MSpecTestRunner for NCoverConsole
|
84
|
+
* [Steven Harman](http://github.com/stevenharman): Finding some wicked bugs, patching nunit test runner, and the nant task
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/install_dependencies.rb
CHANGED
@@ -11,12 +11,12 @@ end
|
|
11
11
|
|
12
12
|
def install(lib)
|
13
13
|
begin
|
14
|
-
|
14
|
+
matches = Gem.source_index.find_name(lib)
|
15
15
|
if matches.empty?
|
16
|
-
|
17
|
-
|
16
|
+
puts "Installing #{lib}"
|
17
|
+
Gem::GemRunner.new.run ['install', lib]
|
18
18
|
else
|
19
|
-
|
19
|
+
puts "Found #{lib} gem - skipping"
|
20
20
|
end
|
21
21
|
rescue Gem::SystemExitException => e
|
22
22
|
end
|
@@ -24,12 +24,12 @@ end
|
|
24
24
|
|
25
25
|
def add_source(url)
|
26
26
|
begin
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
27
|
+
if Gem.sources.include?(url)
|
28
|
+
puts "Found #{url} gem source = skipping"
|
29
|
+
else
|
30
|
+
puts "Adding #{url} gem source."
|
31
|
+
Gem::GemRunner.new.run ['sources', '-a', url]
|
32
|
+
end
|
33
33
|
rescue Gem::SystemExitException => e
|
34
34
|
end
|
35
35
|
end
|
data/lib/albacore.rb
CHANGED
@@ -5,6 +5,14 @@ $: << File.expand_path(File.join(File.dirname(__FILE__), "rake"))
|
|
5
5
|
|
6
6
|
require 'logging'
|
7
7
|
|
8
|
+
runtime_is_ironruby = (!defined?(IRONRUBY_VERSION).nil?)
|
9
|
+
|
8
10
|
Dir.glob(File.join(File.expand_path(File.dirname(__FILE__)), 'rake/support/*.rb')).each {|f| require f }
|
9
|
-
|
10
|
-
Dir.glob(File.join(File.expand_path(File.dirname(__FILE__)), '
|
11
|
+
|
12
|
+
Dir.glob(File.join(File.expand_path(File.dirname(__FILE__)), 'rake/*.rb')).reject{ |f|
|
13
|
+
f if runtime_is_ironruby && (f.include?("ssh") || f.include?("sftp"))
|
14
|
+
}.each {|f| require f }
|
15
|
+
|
16
|
+
Dir.glob(File.join(File.expand_path(File.dirname(__FILE__)), 'albacore/*.rb')).reject{ |f|
|
17
|
+
f if runtime_is_ironruby && (f.include?("ssh") || f.include?("sftp"))
|
18
|
+
}.each {|f| require f }
|
@@ -1,104 +1,104 @@
|
|
1
1
|
require 'albacore/support/albacore_helper'
|
2
|
+
require 'albacore/assemblyinfolanguages/csharpengine'
|
3
|
+
require 'albacore/assemblyinfolanguages/vbnetengine'
|
2
4
|
|
3
5
|
class AssemblyInfo
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
6
|
+
extend AttrMethods
|
7
|
+
include Failure
|
8
|
+
include YAMLConfig
|
9
|
+
|
10
|
+
attr_accessor :version, :title, :description, :output_file, :custom_attributes
|
11
|
+
attr_accessor :copyright, :com_visible, :com_guid, :company_name, :product_name
|
12
|
+
attr_accessor :file_version, :trademark, :lang_engine
|
13
|
+
|
14
|
+
attr_array :namespaces
|
15
|
+
attr_hash :custom_attributes
|
16
|
+
|
17
|
+
def initialize
|
18
|
+
@namespaces = []
|
19
|
+
super()
|
20
|
+
end
|
21
|
+
|
22
|
+
def write
|
23
|
+
@lang_engine = CSharpEngine.new unless check_lang_engine
|
24
|
+
write_assemblyinfo @output_file
|
25
|
+
end
|
26
|
+
|
27
|
+
def write_assemblyinfo(assemblyinfo_file)
|
28
|
+
valid = check_output_file assemblyinfo_file
|
29
|
+
return if !valid
|
30
|
+
|
31
|
+
asm_data = build_assembly_info_data
|
25
32
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
@custom_attributes.each do |key, value|
|
99
|
-
attributes << build_attribute(key, value)
|
100
|
-
end
|
101
|
-
attributes
|
102
|
-
end
|
103
|
-
|
104
|
-
end
|
33
|
+
@logger.info "Generating Assembly Info File At: " + File.expand_path(assemblyinfo_file)
|
34
|
+
File.open(assemblyinfo_file, 'w') do |f|
|
35
|
+
f.write asm_data
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def check_output_file(file)
|
40
|
+
return true if file
|
41
|
+
fail_with_message 'output_file cannot be nil'
|
42
|
+
return false
|
43
|
+
end
|
44
|
+
|
45
|
+
def check_lang_engine
|
46
|
+
return !@lang_engine.nil?
|
47
|
+
end
|
48
|
+
|
49
|
+
def build_assembly_info_data
|
50
|
+
asm_data = build_using_statements + "\n"
|
51
|
+
|
52
|
+
asm_data << build_attribute("AssemblyTitle", @title) if @title != nil
|
53
|
+
asm_data << build_attribute("AssemblyDescription", @description) if @description != nil
|
54
|
+
asm_data << build_attribute("AssemblyCompany", @company_name) if @company_name != nil
|
55
|
+
asm_data << build_attribute("AssemblyProduct", @product_name) if @product_name != nil
|
56
|
+
|
57
|
+
asm_data << build_attribute("AssemblyCopyright", @copyright) if @copyright != nil
|
58
|
+
asm_data << build_attribute("AssemblyTrademark", @trademark) if @trademark != nil
|
59
|
+
|
60
|
+
asm_data << build_attribute("ComVisible", @com_visible) if @com_visible != nil
|
61
|
+
asm_data << build_attribute("Guid", @com_guid) if @com_guid != nil
|
62
|
+
|
63
|
+
asm_data << build_attribute("AssemblyVersion", @version) if @version != nil
|
64
|
+
asm_data << build_attribute("AssemblyFileVersion", @file_version) if @file_version != nil
|
65
|
+
|
66
|
+
asm_data << "\n"
|
67
|
+
if @custom_attributes != nil
|
68
|
+
attributes = build_custom_attributes()
|
69
|
+
asm_data << attributes.join
|
70
|
+
asm_data << "\n"
|
71
|
+
end
|
72
|
+
|
73
|
+
asm_data
|
74
|
+
end
|
75
|
+
|
76
|
+
def build_using_statements
|
77
|
+
@namespaces = [] if @namespaces.nil?
|
78
|
+
|
79
|
+
@namespaces << "System.Reflection"
|
80
|
+
@namespaces << "System.Runtime.InteropServices"
|
81
|
+
|
82
|
+
ns = ''
|
83
|
+
@namespaces.each do |n|
|
84
|
+
ns << @lang_engine.build_using_statement(n)
|
85
|
+
end
|
86
|
+
|
87
|
+
ns
|
88
|
+
end
|
89
|
+
|
90
|
+
def build_attribute(attr_name, attr_data)
|
91
|
+
attribute = @lang_engine.build_attribute(attr_name, attr_data)
|
92
|
+
@logger.debug "Build Assembly Info Attribute: " + attribute
|
93
|
+
attribute
|
94
|
+
end
|
95
|
+
|
96
|
+
def build_custom_attributes()
|
97
|
+
attributes = []
|
98
|
+
@custom_attributes.each do |key, value|
|
99
|
+
attributes << build_attribute(key, value)
|
100
|
+
end
|
101
|
+
attributes
|
102
|
+
end
|
103
|
+
|
104
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CSharpEngine
|
2
|
+
def build_attribute(attr_name, attr_data)
|
3
|
+
attribute = "[assembly: #{attr_name}("
|
4
|
+
attribute << "#{attr_data.inspect}" if attr_data != nil
|
5
|
+
attribute << ")]\n"
|
6
|
+
|
7
|
+
attribute
|
8
|
+
end
|
9
|
+
|
10
|
+
def build_using_statement(namespace)
|
11
|
+
"using #{namespace};\n"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class VbNetEngine
|
2
|
+
def build_attribute(attr_name, attr_data)
|
3
|
+
attribute = "<assembly: #{attr_name}("
|
4
|
+
attribute << "#{attr_data.inspect}" if attr_data != nil
|
5
|
+
attribute << ")>\n"
|
6
|
+
|
7
|
+
attribute
|
8
|
+
end
|
9
|
+
|
10
|
+
def build_using_statement(namespace)
|
11
|
+
"Imports #{namespace}\n"
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|