|
1 | 1 | require 'rake/clean' |
2 | 2 | require 'tempfile' |
3 | 3 | require 'rbconfig' |
4 | | -include FileUtils |
5 | 4 |
|
6 | | -PROJECT_VERSION = '1.0_beta2' |
| 5 | +PROJECT_VERSION = '1.0' |
7 | 6 | BUILD_DATE = Time.now.utc.strftime '%B %d, %Y (%H:%M GMT)' |
8 | 7 | MANIFEST = |
9 | 8 | "Library: JRuby for Max |
|
57 | 56 | task :package => [:jar] do |
58 | 57 | puts "Preparing distribution" |
59 | 58 | package_lib = "#{PACKAGE}/#{LIB}" |
60 | | - mkdir DIST |
61 | | - mkdir PACKAGE |
62 | | - mkdir package_lib |
| 59 | + mkdir_p DIST |
| 60 | + mkdir_p package_lib |
63 | 61 |
|
64 | 62 | # Collect the files |
65 | 63 | FileList['*.txt', '*.example'].each do |filename| |
|
84 | 82 |
|
85 | 83 | desc 'Build distribution archive' |
86 | 84 | task :dist => [:replace_vars] do |
87 | | - mkdir DIST |
| 85 | + mkdir_p DIST |
88 | 86 | archive = "#{PROJ}.zip" |
89 | 87 | puts "Archiving distribution: #{DIST}/#{archive}" |
90 | 88 |
|
91 | 89 | # NOTE: this only works on OS X. It might work with the correct Cygwin setup on Windows but I never tested this. |
92 | | - `cd #{DIST} && zip -l -m -r #{archive} #{PROJ}` |
| 90 | + `cd #{DIST} && zip -l -m -r #{archive} #{PROJ} -x "*.DS_Store"` |
93 | 91 | # The -l option converts newlines to crlf, which should display correctly on both OS X and Windows. |
94 | 92 | # Otherwise, since I write these txt files on OS X, newlines would disappear when viewed in Notepad on Windows. |
95 | 93 | end |
@@ -123,21 +121,14 @@ def java classpath, main_class, args |
123 | 121 | end |
124 | 122 |
|
125 | 123 | def javac classpath, src_files, dst_folder |
126 | | - mkdir dst_folder |
| 124 | + mkdir_p dst_folder |
127 | 125 | `javac -classpath #{classpath.join CLASSPATH_SEPARATOR} -d #{dst_folder} -g -source 1.5 -target 1.5 #{src_files}` |
128 | 126 | end |
129 | 127 |
|
130 | 128 | def jar filename, manifest, dst_folder |
131 | 129 | `jar cvfm #{filename} #{manifest.path} -C #{dst_folder} .` |
132 | 130 | end |
133 | 131 |
|
134 | | -# I find it annoying that I always have to check if a directory exists |
135 | | -# before creating it, so I monkey patch mkdir() to handle it automatically: |
136 | | -alias original_mkdir mkdir |
137 | | -def mkdir(dir) |
138 | | - original_mkdir dir if not File.exist? dir |
139 | | -end |
140 | | - |
141 | 132 |
|
142 | 133 | class FileList |
143 | 134 | # Replaces all occurrences of token with value |
|
0 commit comments