Skip to content

Commit 4af6903

Browse files
committed
bumped version to 1.0 and fixed 'rake dist' so it doesn't package up .DS_Store files
1 parent fdea134 commit 4af6903

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

Rakefile

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
require 'rake/clean'
22
require 'tempfile'
33
require 'rbconfig'
4-
include FileUtils
54

6-
PROJECT_VERSION = '1.0_beta2'
5+
PROJECT_VERSION = '1.0'
76
BUILD_DATE = Time.now.utc.strftime '%B %d, %Y (%H:%M GMT)'
87
MANIFEST =
98
"Library: JRuby for Max
@@ -57,9 +56,8 @@ end
5756
task :package => [:jar] do
5857
puts "Preparing distribution"
5958
package_lib = "#{PACKAGE}/#{LIB}"
60-
mkdir DIST
61-
mkdir PACKAGE
62-
mkdir package_lib
59+
mkdir_p DIST
60+
mkdir_p package_lib
6361

6462
# Collect the files
6563
FileList['*.txt', '*.example'].each do |filename|
@@ -84,12 +82,12 @@ end
8482

8583
desc 'Build distribution archive'
8684
task :dist => [:replace_vars] do
87-
mkdir DIST
85+
mkdir_p DIST
8886
archive = "#{PROJ}.zip"
8987
puts "Archiving distribution: #{DIST}/#{archive}"
9088

9189
# 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"`
9391
# The -l option converts newlines to crlf, which should display correctly on both OS X and Windows.
9492
# Otherwise, since I write these txt files on OS X, newlines would disappear when viewed in Notepad on Windows.
9593
end
@@ -123,21 +121,14 @@ def java classpath, main_class, args
123121
end
124122

125123
def javac classpath, src_files, dst_folder
126-
mkdir dst_folder
124+
mkdir_p dst_folder
127125
`javac -classpath #{classpath.join CLASSPATH_SEPARATOR} -d #{dst_folder} -g -source 1.5 -target 1.5 #{src_files}`
128126
end
129127

130128
def jar filename, manifest, dst_folder
131129
`jar cvfm #{filename} #{manifest.path} -C #{dst_folder} .`
132130
end
133131

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-
141132

142133
class FileList
143134
# Replaces all occurrences of token with value

0 commit comments

Comments
 (0)