rakejava 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.markdown +58 -39
  2. data/lib/rakejava.rb +3 -3
  3. metadata +38 -27
@@ -4,30 +4,35 @@ RakeJava is a ruby gem for use with Rake. It lets you javac and jar Java files.
4
4
 
5
5
  1.3.6 makes JarFiles more robust so you can specify directories instead of the exhaustive list of files. It also enables JRuby support.
6
6
 
7
+ 1.3.7 fixes the jar task for Ruby >= 1.9
8
+
7
9
  ### Simple Example:
8
10
 
9
- require 'rakejava'
10
- require 'rake/clean'
11
11
 
12
- CLEAN.include 'build'
12
+ ```ruby
13
+ require 'rakejava'
14
+ require 'rake/clean'
15
+
16
+ CLEAN.include 'build'
17
+
18
+ task :default => "myproj.jar"
13
19
 
14
- task :default => "myproj.jar"
20
+ jar "myproj.jar" => :compile do |t|
21
+ t.files << JarFiles["build", "**/*.class"]
22
+ t.main_class = 'org.whathaveyou.Main'
23
+ t.manifest = {:version => '1.0.0'}
24
+ end
15
25
 
16
- jar "myproj.jar" => :compile do |t|
17
- t.files << JarFiles["build", "**/*.class"]
18
- t.main_class = 'org.whathaveyou.Main'
19
- t.manifest = {:version => '1.0.0'}
20
- end
26
+ javac :compile => "build" do |t|
27
+ t.src << Sources["src", "**/*.java"]
28
+ t.src << Sources["test", "*.java"]
29
+ t.classpath << Dir["lib/**/*.{zip,jar}"]
30
+ t.dest = 'build'
31
+ end
21
32
 
22
- javac :compile => "build" do |t|
23
- t.src << Sources["src", "**/*.java"]
24
- t.src << Sources["test", "*.java"]
25
- t.classpath << Dir["lib/**/*.{zip,jar}"]
26
- t.dest = 'build'
27
- end
33
+ directory "build"
34
+ ```
28
35
 
29
- directory "build"
30
-
31
36
  -------------------------
32
37
 
33
38
  # javac #
@@ -47,7 +52,9 @@ This task is a wrapper around Java's javac command and it supports most of the u
47
52
 
48
53
  A `Rake::FileList` where the first argument specified is the top of a source tree. Example:
49
54
 
50
- task.src << Sources["src", "**/*.java"]
55
+ ```ruby
56
+ task.src << Sources["src", "**/*.java"]
57
+ ```
51
58
 
52
59
  -------------------------
53
60
  # jar #
@@ -63,46 +70,58 @@ This task is a wrapper around Java's jar command and it supports all of its argu
63
70
 
64
71
  A `Rake::FileList` where the first argument specified is the top directory of a source of files to jar.
65
72
 
66
- t.files << JarFiles["build", "**/*.class", "**/*.properties"]
73
+ ```ruby
74
+ t.files << JarFiles["build", "**/*.class", "**/*.properties"]
75
+ ```
67
76
 
68
77
  ### sign_info ###
69
78
 
70
79
  Here's an example of using sign_info with the jar task:
71
80
 
72
- jar "myproj.jar" => :compile do |t|
73
- t.files << JarFiles["build", "**/*.class"]
74
- t.sign_info = {
75
- :store_type => 'pkcs12',
76
- :key_store => 'certs/keystore.p12',
77
- :store_pass => 'you-know-yours',
78
- :alias => 'you-know-yours'
79
- }
80
- end
81
+ ```ruby
82
+ jar "myproj.jar" => :compile do |t|
83
+ t.files << JarFiles["build", "**/*.class"]
84
+ t.sign_info = {
85
+ :store_type => 'pkcs12',
86
+ :key_store => 'certs/keystore.p12',
87
+ :store_pass => 'you-know-yours',
88
+ :alias => 'you-know-yours'
89
+ }
90
+ end
91
+ ```
81
92
 
82
93
  -------------------------
83
94
  # copy_to #
84
95
 
85
96
  This is a function that lets you copy files to a destination directory. What makes this interesting is that by default it won't copy files unless they're newer. Here's an example:
86
97
 
87
- task :copy_stuff do
88
- copy_to "/my/dest/dir" do |c|
89
- c.files << CopyFiles['build/java', '**/*.class'].exclude(/Test.class/)
90
- c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!.dest('lib')
91
- c.files << Dir['ext/**/*.jar']
92
- c.force # Normally, only newer files get copied
93
- end
94
- end
98
+ ```ruby
99
+ task :copy_stuff do
100
+ copy_to "/my/dest/dir" do |c|
101
+ c.files << CopyFiles['build/java', '**/*.class'].exclude(/Test.class/)
102
+ c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!.dest('lib')
103
+ c.files << Dir['ext/**/*.jar']
104
+ c.force # Normally, only newer files get copied
105
+ end
106
+ end
107
+ ```
95
108
 
96
109
  ### CopyFiles ###
97
110
 
98
111
  A `Rake::FileList` where the first argument is the parent directory of the files you want to specify for copying. The files will end up in the destination with the same relative path to their original parent.
99
112
 
100
- c.files << CopyFiles['lib', '**/*.{jar,zip}']
113
+ ```ruby
114
+ c.files << CopyFiles['lib', '**/*.{jar,zip}']
115
+ ```
101
116
 
102
117
  You can use `CopyFiles` to collect files and then dump them all into the target directory by using `flatten!()`.
103
118
 
104
- c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!
119
+ ```ruby
120
+ c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!
121
+ ```
105
122
 
106
123
  You can send all of the files specified in `CopyFiles` to a subdir of the target dir by using `dest()`.
107
124
 
108
- c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!.dest('my_lib')
125
+ ```ruby
126
+ c.files << CopyFiles['lib', '**/*.{jar,zip}'].flatten!.dest('my_lib')
127
+ ```
@@ -54,11 +54,11 @@ module RakeJavaUtil
54
54
  @winderz
55
55
  end
56
56
 
57
- def path_esc str_ary
57
+ def path_esc str
58
58
  if !winderz?
59
- str_ary.map { |str| str.gsub('$', '\$').gsub(' ', '\ ') }
59
+ str.gsub('$', '\$').gsub(' ', '\ ')
60
60
  else
61
- str_ary
61
+ str
62
62
  end
63
63
  end
64
64
 
metadata CHANGED
@@ -1,28 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rakejava
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 1.3.6
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 3
8
+ - 7
9
+ version: 1.3.7
6
10
  platform: ruby
7
11
  authors:
8
- - Tom Santos
12
+ - Tom Santos
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
16
 
13
- date: 2012-02-14 00:00:00 Z
17
+ date: 2013-05-10 00:00:00 -07:00
18
+ default_executable:
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rake
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 0.9.2
24
- type: :runtime
25
- version_requirements: *id001
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 9
30
+ - 2
31
+ version: 0.9.2
32
+ type: :runtime
33
+ version_requirements: *id001
26
34
  description: Rake tasks for building Java stuff (javac and jar)
27
35
  email: santos.tom@gmail.com
28
36
  executables: []
@@ -32,8 +40,9 @@ extensions: []
32
40
  extra_rdoc_files: []
33
41
 
34
42
  files:
35
- - README.markdown
36
- - lib/rakejava.rb
43
+ - README.markdown
44
+ - lib/rakejava.rb
45
+ has_rdoc: true
37
46
  homepage: http://github.com/tsantos/rakejava
38
47
  licenses: []
39
48
 
@@ -41,23 +50,25 @@ post_install_message:
41
50
  rdoc_options: []
42
51
 
43
52
  require_paths:
44
- - lib
53
+ - lib
45
54
  required_ruby_version: !ruby/object:Gem::Requirement
46
- none: false
47
55
  requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- version: "0"
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
60
+ version: "0"
51
61
  required_rubygems_version: !ruby/object:Gem::Requirement
52
- none: false
53
62
  requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 0
67
+ version: "0"
57
68
  requirements: []
58
69
 
59
70
  rubyforge_project:
60
- rubygems_version: 1.8.15
71
+ rubygems_version: 1.3.6
61
72
  signing_key:
62
73
  specification_version: 3
63
74
  summary: Rake tasks for building Java stuff (javac and jar)