iron_hammer 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ $hoe = Hoe.spec 'iron_hammer' do
14
14
  self.rubyforge_name = self.name
15
15
  self.extra_deps = [['rubyzip2','>= 2.0.1'],
16
16
  ['builder', '>= 2.1.2']]
17
- self.version = '1.0.6'
17
+ self.version = '1.0.7'
18
18
  end
19
19
 
20
20
  require 'newgem/tasks'
data/bin/bump ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'rake'
5
+
6
+ folder = ENV['IRON_HAMMER_HOME'] || File.join(ENV['USERPROFILE'], '.IronHammer')
7
+
8
+ sh "rake -f \"#{folder}\\rakefile.rb\" iron:version:bump:#{ARGV.join ' '}"
9
+
data/bin/ivy ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'rake'
5
+
6
+ folder = ENV['IRON_HAMMER_HOME'] || File.join(ENV['USERPROFILE'], '.IronHammer')
7
+
8
+ unless ENV['IRON_HAMMER_HOME']
9
+ puts "IRON_HAMMER_HOME environment variable not found! Generating default config on #{folder}"
10
+ puts "You'll need to download apache ivy from http://ant.apache.org/ivy/download.cgi"
11
+ puts "and copy ivy-x.x.x.jar to #{folder}\\ivy.jar"
12
+ puts "You can also edit #{folder}\\rakefile.rb and change any settings you want"
13
+
14
+ FileUtils.mkpath folder
15
+ sh "setx IRON_HAMMER_HOME \"#{folder}\""
16
+ File.open(File.join(folder, 'rakefile.rb'), 'w') do |f|
17
+ f.write <<EOF
18
+ require 'rubygems'
19
+
20
+ #VISUAL_STUDIO_PATH = ENV['VISUAL_STUDIO_PATH'] || 'C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE'
21
+ IVY_JAR = "#{ENV['IRON_HAMMER_HOME']}\\ivy.jar"
22
+ IVY_SETTINGS = "#{ENV['IRON_HAMMER_HOME']}\\ivysettings.xml"
23
+ #ORGANISATION = 'Your company'
24
+
25
+ require 'iron_hammer/tasks'
26
+ EOF
27
+ end
28
+ File.open(File.join(folder, 'ivysettings.xml'), 'w') do |f|
29
+ f.write <<EOF
30
+ <ivysettings>
31
+ <settings defaultResolver="default" />
32
+ <caches defaultCacheDir="#{folder}/Ivy/Cache"/>
33
+ <resolvers>
34
+ <filesystem name="default">
35
+ <ivy pattern="#{folder}/Ivy/Repository/[organisation]/[module]/ivys/ivy-[revision].xml"/>
36
+ <artifact pattern="#{folder}/Ivy/Repository/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
37
+ </filesystem>
38
+ </resolvers>
39
+ </ivysettings>
40
+ EOF
41
+ end
42
+ end
43
+
44
+ sh "rake -f \"#{folder}\\rakefile.rb\" iron:ivy:#{ARGV.join ' '}"
45
+
@@ -3,8 +3,8 @@ require 'iron_hammer/utils/windows'
3
3
  module IronHammer
4
4
  module Utils
5
5
  class DotNetEnvironment
6
- attr_accessor :framework_path
7
- attr_accessor :visual_studio_path
6
+ attr_accessor :framework_path
7
+ attr_accessor :visual_studio_path
8
8
 
9
9
  def initialize params={}
10
10
  @framework_path = params[:framework_path] || default_framework_path
@@ -14,29 +14,30 @@ module IronHammer
14
14
  def msbuild
15
15
  [@framework_path, 'msbuild.exe'].patheticalize
16
16
  end
17
-
17
+
18
18
  def mstest
19
19
  [@visual_studio_path, 'mstest.exe'].patheticalize
20
20
  end
21
-
21
+
22
22
  private
23
23
  def default_framework_path
24
24
  [
25
- ENV['SystemRoot'] || (IronHammer::Defaults::SYSTEM_ROOT),
26
- 'Microsoft.NET',
27
- 'Framework',
25
+ ENV['SystemRoot'] || (IronHammer::Defaults::SYSTEM_ROOT),
26
+ 'Microsoft.NET',
27
+ 'Framework',
28
28
  'v3.5'
29
29
  ].patheticalize
30
30
  end
31
-
31
+
32
32
  def default_visual_studio_path
33
33
  [
34
- ENV['ProgramFiles'] || IronHammer::Defaults::PROGRAM_FILES,
35
- 'Microsoft Visual Studio 2008',
36
- 'Common7',
34
+ ENV['ProgramFiles'] || IronHammer::Defaults::PROGRAM_FILES,
35
+ 'Microsoft Visual Studio 9.0',
36
+ 'Common7',
37
37
  'IDE'
38
38
  ].patheticalize
39
39
  end
40
40
  end unless defined? DotNetEnvironment
41
41
  end
42
42
  end
43
+
@@ -51,7 +51,7 @@ module IronHammer
51
51
  "java -jar #{@config.ivy_jar}
52
52
  -ivy #{ivy_file}
53
53
  -settings #{@config.ivy_settings}
54
- -retrieve Libraries/[artifact]-[revision].[ext]".gsub(/\s+/, ' ')
54
+ -retrieve Libraries/[revision]/[artifact].[ext]".gsub(/\s+/, ' ')
55
55
  end
56
56
 
57
57
  def publish ivy_file
@@ -74,14 +74,14 @@ module IronHammer
74
74
  references = doc.get_elements(ProjectFile::REFERENCE_PATH)
75
75
  references.each do |reference|
76
76
  artifact = artifact_for reference
77
- artifact.scan(/-(.*)\.(dll|exe)/) do |version, extension|
77
+ artifact.scan(/Libraries\/(.*)\/(.*)/) do |version, extension|
78
78
  includes = reference.attribute('Include').value
79
79
  includes.gsub!(/Version=(.*?)(,|$)/, "Version=#{version}\\2")
80
80
  reference.add_attribute('Include', includes)
81
81
  end
82
82
  reference.elements['SpecificVersion'] = REXML::Element.new('SpecificVersion').add_text('false')
83
83
  reference.elements['HintPath'] = REXML::Element.new('HintPath').
84
- add_text([relative, 'Libraries', "#{artifact}"].flatten.patheticalize)
84
+ add_text([relative, "#{artifact.gsub(/\//, '\\')}"].flatten.patheticalize)
85
85
  end
86
86
 
87
87
  FileSystem.write! :path => @project.path, :name => @project.csproj, :content => doc.to_s
@@ -94,8 +94,7 @@ module IronHammer
94
94
  private
95
95
  def artifact_for reference
96
96
  dependency = Dependency.from_reference reference
97
- libraries_dir = Dir.new('Libraries')
98
- libraries_dir.find {|f| f.match "^#{dependency.name}-(.*)\\.(dll|exe)"}
97
+ Dir["Libraries/**/#{dependency.name}.{dll,exe}"].last
99
98
  end
100
99
  end
101
100
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_hammer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mozair Alves do Carmo Junior
@@ -67,8 +67,9 @@ description: "Iron Hammer gathers together three components to help automate the
67
67
  email:
68
68
  - macskeptic@gmail.com
69
69
  - lucasmrtuner@gmail.com
70
- executables: []
71
-
70
+ executables:
71
+ - ivy
72
+ - bump
72
73
  extensions: []
73
74
 
74
75
  extra_rdoc_files:
@@ -77,6 +78,8 @@ files:
77
78
  - PostInstall.txt
78
79
  - README.rdoc
79
80
  - Rakefile
81
+ - bin/ivy
82
+ - bin/bump
80
83
  - lib/iron_hammer.rb
81
84
  - lib/iron_hammer/anvil.rb
82
85
  - lib/iron_hammer/default_binaries_behavior.rb