jruby-launcher 1.1.1-java → 1.1.2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/COPYING +826 -826
- data/Makefile +122 -122
- data/README.md +64 -64
- data/Rakefile +51 -51
- data/argnames.h +35 -35
- data/argparser.cpp +668 -667
- data/argparser.h +78 -78
- data/extconf.rb +7 -7
- data/inc/Makefile-conf.mk +76 -76
- data/inc/Makefile-impl.mk +107 -107
- data/inc/Makefile-rules.mk +40 -40
- data/jruby.cpp +77 -77
- data/jrubyexe.cpp +84 -84
- data/jvmlauncher.cpp +459 -454
- data/jvmlauncher.h +143 -143
- data/lib/jruby-launcher.rb +3 -3
- data/lib/rubygems/defaults/jruby_native.rb +4 -4
- data/nbexecloader.h +43 -43
- data/ng.c +730 -730
- data/platformlauncher.cpp +252 -252
- data/platformlauncher.h +73 -73
- data/rb_w32_cmdvector.h +287 -287
- data/resources/jruby.rc +25 -25
- data/spec/launcher_spec.rb +262 -258
- data/spec/spec_helper.rb +81 -81
- data/strlcpy.c +72 -72
- data/unixlauncher.cpp +100 -100
- data/unixlauncher.h +22 -22
- data/utilsfuncs.cpp +279 -279
- data/utilsfuncs.h +85 -85
- data/utilsfuncswin.cpp +229 -229
- data/version.h +1 -1
- metadata +3 -3
data/Makefile
CHANGED
@@ -1,122 +1,122 @@
|
|
1
|
-
# These line gets substituted with the actual Config::CONFIG items location by extconf.rb
|
2
|
-
PREFIX = notspecified
|
3
|
-
BINDIR = $(PREFIX)/bin
|
4
|
-
INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
|
5
|
-
INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
|
6
|
-
OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
|
7
|
-
|
8
|
-
ifeq (true,$(shell test -x $(BINDIR)/jruby && echo true))
|
9
|
-
RAKE=$(BINDIR)/jruby -S rake
|
10
|
-
else
|
11
|
-
RAKE=rake
|
12
|
-
endif
|
13
|
-
|
14
|
-
build: .build-post
|
15
|
-
|
16
|
-
.build-pre:
|
17
|
-
|
18
|
-
.build-post: .build-impl build-exe
|
19
|
-
|
20
|
-
build-exe:
|
21
|
-
@if [ "$(findstring mingw, $(CONF))" ]; then \
|
22
|
-
${MAKE} -f ${SUB_CONFMK} SUBPROJECTS=${SUBPROJECTS} jruby.exe jrubyw.exe; \
|
23
|
-
if [ -d ../jruby ]; then cp jruby.exe jrubyw.exe jruby.dll ../jruby/bin/; fi; \
|
24
|
-
if [ -d D:/work/jruby-dev/jruby ]; then cp jruby.exe jrubyw.exe jruby.dll D:/work/jruby-dev/jruby/bin/; fi; \
|
25
|
-
fi
|
26
|
-
|
27
|
-
jruby.res: resources/jruby.rc
|
28
|
-
windres $^ -O coff -o $@
|
29
|
-
|
30
|
-
jruby.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
|
31
|
-
g++ $(CXXFLAGS) $^ -s -o $@ $(LDLIBSOPTIONS) -static
|
32
|
-
|
33
|
-
jrubyw.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
|
34
|
-
g++ $(CXXFLAGS) -DJRUBYW -mwindows $^ -s -o $@ $(LDLIBSOPTIONS) -static
|
35
|
-
|
36
|
-
install:
|
37
|
-
@if [ ! -f ./jruby ]; then echo "Please run 'make' first."; exit 1; fi
|
38
|
-
@if [ x$(BINDIR) = xnotspecified/bin ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
|
39
|
-
@if [ ! -w $(BINDIR) ]; then echo "'$(BINDIR)' does not exist or cannot write to '$(BINDIR)'."; exit 1; fi
|
40
|
-
@if [ -f $(BINDIR)/jruby -a ! -w $(BINDIR)/jruby ]; then echo "Cannot write to '$(BINDIR)/jruby'."; exit 1; fi
|
41
|
-
cp ./jruby $(BINDIR)/jruby
|
42
|
-
@if [ x$(PREFIX) = xnotspecified ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
|
43
|
-
@if [ ! -w $(INSTALLDIR) ]; then \
|
44
|
-
if [ ! -w $(OLDINSTALLDIR) ]; then \
|
45
|
-
if [ ! -w $(INSTALLDIR9000) ]; then \
|
46
|
-
echo "Neither '$(INSTALLDIR9000)' nor '$(INSTALLDIR)' nor '$(OLDINSTALLDIR)' exist and are writable"; exit 1; \
|
47
|
-
else \
|
48
|
-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000)"; \
|
49
|
-
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000); \
|
50
|
-
fi; \
|
51
|
-
else \
|
52
|
-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR)"; \
|
53
|
-
cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR); \
|
54
|
-
fi; \
|
55
|
-
else \
|
56
|
-
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR)"; \
|
57
|
-
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR); \
|
58
|
-
fi;
|
59
|
-
|
60
|
-
test:
|
61
|
-
$(RAKE)
|
62
|
-
|
63
|
-
# Universal binary on OSX
|
64
|
-
FAT_ARCHES=i386 ppc x86_64
|
65
|
-
|
66
|
-
fat: $(FAT_ARCHES)
|
67
|
-
lipo -create $(foreach arch,$(FAT_ARCHES),build/unix/Darwin-$(arch)/jruby-launcher) -output jruby
|
68
|
-
$(RAKE)
|
69
|
-
|
70
|
-
$(FAT_ARCHES):
|
71
|
-
$(MAKE) -f $(SUB_CONFMK) CND_PLATFORM=Darwin-$@ CFLAGS="-arch $@" build/unix/Darwin-$@/jruby-launcher
|
72
|
-
|
73
|
-
clean: .clean-post
|
74
|
-
|
75
|
-
.clean-pre:
|
76
|
-
-rm -rf build/*
|
77
|
-
|
78
|
-
.clean-post: .clean-impl
|
79
|
-
rm -f *.exe *.res
|
80
|
-
|
81
|
-
clobber: .clobber-post
|
82
|
-
|
83
|
-
.clobber-pre:
|
84
|
-
|
85
|
-
.clobber-post: .clobber-impl
|
86
|
-
|
87
|
-
all: .all-post
|
88
|
-
|
89
|
-
.all-pre:
|
90
|
-
|
91
|
-
.all-post: .all-impl
|
92
|
-
|
93
|
-
help: .help-post
|
94
|
-
|
95
|
-
.help-pre:
|
96
|
-
|
97
|
-
.help-post: .help-impl
|
98
|
-
|
99
|
-
# Use the manually-maintained inc/*.mk makefiles.
|
100
|
-
# Pass NETBEANS=true on the command-line to use NB's generated
|
101
|
-
# nbproject/*.mk
|
102
|
-
|
103
|
-
ifdef NETBEANS
|
104
|
-
SUB_IMPLMK=nbproject/Makefile-impl.mk
|
105
|
-
else
|
106
|
-
SUB_IMPLMK=inc/Makefile-impl.mk
|
107
|
-
SUB_CONFMK=inc/Makefile-rules.mk
|
108
|
-
endif
|
109
|
-
|
110
|
-
# include project implementation makefile
|
111
|
-
include $(SUB_IMPLMK)
|
112
|
-
|
113
|
-
# Pick conf based on OS. for mingw64, must manually override for now.
|
114
|
-
ifeq ($(OS),Windows_NT)
|
115
|
-
CONF=mingw
|
116
|
-
else
|
117
|
-
CONF=unix
|
118
|
-
endif
|
119
|
-
|
120
|
-
ifdef NETBEANS
|
121
|
-
SUB_CONFMK=nbproject/Makefile-${CONF}.mk
|
122
|
-
endif
|
1
|
+
# These line gets substituted with the actual Config::CONFIG items location by extconf.rb
|
2
|
+
PREFIX = notspecified
|
3
|
+
BINDIR = $(PREFIX)/bin
|
4
|
+
INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
|
5
|
+
INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
|
6
|
+
OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
|
7
|
+
|
8
|
+
ifeq (true,$(shell test -x $(BINDIR)/jruby && echo true))
|
9
|
+
RAKE=$(BINDIR)/jruby -S rake
|
10
|
+
else
|
11
|
+
RAKE=rake
|
12
|
+
endif
|
13
|
+
|
14
|
+
build: .build-post
|
15
|
+
|
16
|
+
.build-pre:
|
17
|
+
|
18
|
+
.build-post: .build-impl build-exe
|
19
|
+
|
20
|
+
build-exe:
|
21
|
+
@if [ "$(findstring mingw, $(CONF))" ]; then \
|
22
|
+
${MAKE} -f ${SUB_CONFMK} SUBPROJECTS=${SUBPROJECTS} jruby.exe jrubyw.exe; \
|
23
|
+
if [ -d ../jruby ]; then cp jruby.exe jrubyw.exe jruby.dll ../jruby/bin/; fi; \
|
24
|
+
if [ -d D:/work/jruby-dev/jruby ]; then cp jruby.exe jrubyw.exe jruby.dll D:/work/jruby-dev/jruby/bin/; fi; \
|
25
|
+
fi
|
26
|
+
|
27
|
+
jruby.res: resources/jruby.rc
|
28
|
+
windres $^ -O coff -o $@
|
29
|
+
|
30
|
+
jruby.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
|
31
|
+
g++ $(CXXFLAGS) $^ -s -o $@ $(LDLIBSOPTIONS) -static
|
32
|
+
|
33
|
+
jrubyw.exe: jrubyexe.cpp nbexecloader.h utilsfuncs.cpp utilsfuncswin.cpp jruby.res
|
34
|
+
g++ $(CXXFLAGS) -DJRUBYW -mwindows $^ -s -o $@ $(LDLIBSOPTIONS) -static
|
35
|
+
|
36
|
+
install:
|
37
|
+
@if [ ! -f ./jruby ]; then echo "Please run 'make' first."; exit 1; fi
|
38
|
+
@if [ x$(BINDIR) = xnotspecified/bin ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
|
39
|
+
@if [ ! -w $(BINDIR) ]; then echo "'$(BINDIR)' does not exist or cannot write to '$(BINDIR)'."; exit 1; fi
|
40
|
+
@if [ -f $(BINDIR)/jruby -a ! -w $(BINDIR)/jruby ]; then echo "Cannot write to '$(BINDIR)/jruby'."; exit 1; fi
|
41
|
+
cp ./jruby $(BINDIR)/jruby
|
42
|
+
@if [ x$(PREFIX) = xnotspecified ]; then echo "Please define where to install by passing PREFIX=<jruby-home>."; exit 1; fi
|
43
|
+
@if [ ! -w $(INSTALLDIR) ]; then \
|
44
|
+
if [ ! -w $(OLDINSTALLDIR) ]; then \
|
45
|
+
if [ ! -w $(INSTALLDIR9000) ]; then \
|
46
|
+
echo "Neither '$(INSTALLDIR9000)' nor '$(INSTALLDIR)' nor '$(OLDINSTALLDIR)' exist and are writable"; exit 1; \
|
47
|
+
else \
|
48
|
+
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000)"; \
|
49
|
+
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR9000); \
|
50
|
+
fi; \
|
51
|
+
else \
|
52
|
+
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR)"; \
|
53
|
+
cp ./lib/rubygems/defaults/jruby_native.rb $(OLDINSTALLDIR); \
|
54
|
+
fi; \
|
55
|
+
else \
|
56
|
+
echo "cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR)"; \
|
57
|
+
cp ./lib/rubygems/defaults/jruby_native.rb $(INSTALLDIR); \
|
58
|
+
fi;
|
59
|
+
|
60
|
+
test:
|
61
|
+
$(RAKE)
|
62
|
+
|
63
|
+
# Universal binary on OSX
|
64
|
+
FAT_ARCHES=i386 ppc x86_64
|
65
|
+
|
66
|
+
fat: $(FAT_ARCHES)
|
67
|
+
lipo -create $(foreach arch,$(FAT_ARCHES),build/unix/Darwin-$(arch)/jruby-launcher) -output jruby
|
68
|
+
$(RAKE)
|
69
|
+
|
70
|
+
$(FAT_ARCHES):
|
71
|
+
$(MAKE) -f $(SUB_CONFMK) CND_PLATFORM=Darwin-$@ CFLAGS="-arch $@" build/unix/Darwin-$@/jruby-launcher
|
72
|
+
|
73
|
+
clean: .clean-post
|
74
|
+
|
75
|
+
.clean-pre:
|
76
|
+
-rm -rf build/*
|
77
|
+
|
78
|
+
.clean-post: .clean-impl
|
79
|
+
rm -f *.exe *.res
|
80
|
+
|
81
|
+
clobber: .clobber-post
|
82
|
+
|
83
|
+
.clobber-pre:
|
84
|
+
|
85
|
+
.clobber-post: .clobber-impl
|
86
|
+
|
87
|
+
all: .all-post
|
88
|
+
|
89
|
+
.all-pre:
|
90
|
+
|
91
|
+
.all-post: .all-impl
|
92
|
+
|
93
|
+
help: .help-post
|
94
|
+
|
95
|
+
.help-pre:
|
96
|
+
|
97
|
+
.help-post: .help-impl
|
98
|
+
|
99
|
+
# Use the manually-maintained inc/*.mk makefiles.
|
100
|
+
# Pass NETBEANS=true on the command-line to use NB's generated
|
101
|
+
# nbproject/*.mk
|
102
|
+
|
103
|
+
ifdef NETBEANS
|
104
|
+
SUB_IMPLMK=nbproject/Makefile-impl.mk
|
105
|
+
else
|
106
|
+
SUB_IMPLMK=inc/Makefile-impl.mk
|
107
|
+
SUB_CONFMK=inc/Makefile-rules.mk
|
108
|
+
endif
|
109
|
+
|
110
|
+
# include project implementation makefile
|
111
|
+
include $(SUB_IMPLMK)
|
112
|
+
|
113
|
+
# Pick conf based on OS. for mingw64, must manually override for now.
|
114
|
+
ifeq ($(OS),Windows_NT)
|
115
|
+
CONF=mingw
|
116
|
+
else
|
117
|
+
CONF=unix
|
118
|
+
endif
|
119
|
+
|
120
|
+
ifdef NETBEANS
|
121
|
+
SUB_CONFMK=nbproject/Makefile-${CONF}.mk
|
122
|
+
endif
|
data/README.md
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
# JRuby Native Launcher
|
2
|
-
|
3
|
-
## Motivation
|
4
|
-
|
5
|
-
Maintaning `JRuby.BAT` was, well, to put it mildly, unpleasant. We had
|
6
|
-
tens of bugs due to BAT limitations, we had weird behaviors depending
|
7
|
-
on the version of Windows, we had a bunch of regressions.
|
8
|
-
|
9
|
-
See http://jira.codehaus.org/browse/JRUBY-4100 for more details.
|
10
|
-
|
11
|
-
On UNIX platforms, we had problems because a shell-script can't be put
|
12
|
-
as a path in the shebang and couldn't take arguments. (`#!/usr/bin/env
|
13
|
-
jruby -w`)
|
14
|
-
|
15
|
-
We also wanted to DRY up argument handling, even if it meant ditching
|
16
|
-
shell script and writing in lowest-common-denominator C++ (!).
|
17
|
-
|
18
|
-
## Compile
|
19
|
-
|
20
|
-
On UNIX, you should be able to just type `make` and a `jruby` binary
|
21
|
-
will be created in the project directory. Copy this to
|
22
|
-
`$JRUBY_HOME/bin` (or wherever your `jruby` executable is installed). On
|
23
|
-
Windows, you should also be able to type `make` if
|
24
|
-
you have the MinGW compiler toolkit installed.
|
25
|
-
|
26
|
-
Or, open the project in Netbeans 6.8 (with C/C++ plugin installed). If
|
27
|
-
Netbeans warns that no compilers found, follow the instructions and
|
28
|
-
install the required compilers. Currenty, we support MinGW. More info
|
29
|
-
here:
|
30
|
-
|
31
|
-
http://netbeans.org/community/releases/68/cpp-setup-instructions.html
|
32
|
-
|
33
|
-
Then, just build it, and you're ready to go. `jruby.exe`, `jrubyw.exe`
|
34
|
-
and
|
35
|
-
`jruby.dll` will be created, they need to be copied into
|
36
|
-
`$JRUBY_HOME/bin`
|
37
|
-
directory.
|
38
|
-
|
39
|
-
Both, 32-bit and 64-bit compilers are supported. Great version of
|
40
|
-
64-bit mingw can be found here: http://www.cadforte.com/system64.html
|
41
|
-
|
42
|
-
To build 64-bit version of the launcher, use the following from the
|
43
|
-
command line:
|
44
|
-
|
45
|
-
make CONF=mingw64
|
46
|
-
|
47
|
-
## Run
|
48
|
-
|
49
|
-
The launcher provides a great logger, use it like this:
|
50
|
-
|
51
|
-
jruby -Xtrace LOG_FILE.log ....
|
52
|
-
|
53
|
-
## TODO
|
54
|
-
|
55
|
-
See `TODO.txt` file for things that need to be done before this launcher
|
56
|
-
could replace `jruby.bat`.
|
57
|
-
|
58
|
-
## Thanks
|
59
|
-
|
60
|
-
The original code is by Netbeans project.
|
61
|
-
|
62
|
-
## License
|
63
|
-
|
64
|
-
Read the `COPYING` file.
|
1
|
+
# JRuby Native Launcher
|
2
|
+
|
3
|
+
## Motivation
|
4
|
+
|
5
|
+
Maintaning `JRuby.BAT` was, well, to put it mildly, unpleasant. We had
|
6
|
+
tens of bugs due to BAT limitations, we had weird behaviors depending
|
7
|
+
on the version of Windows, we had a bunch of regressions.
|
8
|
+
|
9
|
+
See http://jira.codehaus.org/browse/JRUBY-4100 for more details.
|
10
|
+
|
11
|
+
On UNIX platforms, we had problems because a shell-script can't be put
|
12
|
+
as a path in the shebang and couldn't take arguments. (`#!/usr/bin/env
|
13
|
+
jruby -w`)
|
14
|
+
|
15
|
+
We also wanted to DRY up argument handling, even if it meant ditching
|
16
|
+
shell script and writing in lowest-common-denominator C++ (!).
|
17
|
+
|
18
|
+
## Compile
|
19
|
+
|
20
|
+
On UNIX, you should be able to just type `make` and a `jruby` binary
|
21
|
+
will be created in the project directory. Copy this to
|
22
|
+
`$JRUBY_HOME/bin` (or wherever your `jruby` executable is installed). On
|
23
|
+
Windows, you should also be able to type `make` if
|
24
|
+
you have the MinGW compiler toolkit installed.
|
25
|
+
|
26
|
+
Or, open the project in Netbeans 6.8 (with C/C++ plugin installed). If
|
27
|
+
Netbeans warns that no compilers found, follow the instructions and
|
28
|
+
install the required compilers. Currenty, we support MinGW. More info
|
29
|
+
here:
|
30
|
+
|
31
|
+
http://netbeans.org/community/releases/68/cpp-setup-instructions.html
|
32
|
+
|
33
|
+
Then, just build it, and you're ready to go. `jruby.exe`, `jrubyw.exe`
|
34
|
+
and
|
35
|
+
`jruby.dll` will be created, they need to be copied into
|
36
|
+
`$JRUBY_HOME/bin`
|
37
|
+
directory.
|
38
|
+
|
39
|
+
Both, 32-bit and 64-bit compilers are supported. Great version of
|
40
|
+
64-bit mingw can be found here: http://www.cadforte.com/system64.html
|
41
|
+
|
42
|
+
To build 64-bit version of the launcher, use the following from the
|
43
|
+
command line:
|
44
|
+
|
45
|
+
make CONF=mingw64
|
46
|
+
|
47
|
+
## Run
|
48
|
+
|
49
|
+
The launcher provides a great logger, use it like this:
|
50
|
+
|
51
|
+
jruby -Xtrace LOG_FILE.log ....
|
52
|
+
|
53
|
+
## TODO
|
54
|
+
|
55
|
+
See `TODO.txt` file for things that need to be done before this launcher
|
56
|
+
could replace `jruby.bat`.
|
57
|
+
|
58
|
+
## Thanks
|
59
|
+
|
60
|
+
The original code is by Netbeans project.
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
Read the `COPYING` file.
|
data/Rakefile
CHANGED
@@ -1,51 +1,51 @@
|
|
1
|
-
require 'rubygems/package_task'
|
2
|
-
require 'date'
|
3
|
-
|
4
|
-
begin
|
5
|
-
gem 'rspec'
|
6
|
-
require 'rspec/core/rake_task'
|
7
|
-
desc "Runs Java Integration Specs"
|
8
|
-
RSpec::Core::RakeTask.new
|
9
|
-
task :default => :spec
|
10
|
-
rescue LoadError
|
11
|
-
task :default do
|
12
|
-
puts "rspec 2.0.0 or higher is not installed; skipping jruby-launcher specs"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
desc "Generate gemspec file"
|
17
|
-
task :gemspec => './lib/jruby-launcher.rb' do
|
18
|
-
@gemspec ||= Gem::Specification.new do |s|
|
19
|
-
load './lib/jruby-launcher.rb'
|
20
|
-
s.name = %q{jruby-launcher}
|
21
|
-
s.platform = Gem::Platform.new("java")
|
22
|
-
s.version = JRubyLauncher::VERSION
|
23
|
-
s.authors = ["Nick Sieger", "Vladimir Sizikov"]
|
24
|
-
s.date = Date.today.to_s
|
25
|
-
s.description = %q{Builds and installs a native launcher for JRuby on your system}
|
26
|
-
s.summary = %q{Native launcher for JRuby}
|
27
|
-
s.email = ["nick@nicksieger.com", "vsizikov@gmail.com"]
|
28
|
-
s.extensions = ["extconf.rb"]
|
29
|
-
s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*"]
|
30
|
-
s.homepage = %q{http://jruby.org}
|
31
|
-
s.rubyforge_project = %q{jruby-extras}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "Create gem file"
|
36
|
-
task :package => [:update_version, :gemspec, :spec] do
|
37
|
-
Gem::PackageTask.new(@gemspec) do |pkg|
|
38
|
-
end
|
39
|
-
Rake::Task['gem'].invoke
|
40
|
-
end
|
41
|
-
|
42
|
-
desc "Update version.h based on information in lib/jruby-launcher.rb"
|
43
|
-
task :update_version do
|
44
|
-
load File.join(File.dirname(__FILE__), "lib", "jruby-launcher.rb")
|
45
|
-
version_file = File.join(File.dirname(__FILE__), "version.h")
|
46
|
-
version_file_content = File.read(version_file)
|
47
|
-
version_file_content.gsub! /JRUBY_LAUNCHER_VERSION\s+"[^"]+"/, "JRUBY_LAUNCHER_VERSION \"#{JRubyLauncher::VERSION}\""
|
48
|
-
File.open(version_file, "w") do |f|
|
49
|
-
f.puts version_file_content
|
50
|
-
end
|
51
|
-
end
|
1
|
+
require 'rubygems/package_task'
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
begin
|
5
|
+
gem 'rspec'
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
desc "Runs Java Integration Specs"
|
8
|
+
RSpec::Core::RakeTask.new
|
9
|
+
task :default => :spec
|
10
|
+
rescue LoadError
|
11
|
+
task :default do
|
12
|
+
puts "rspec 2.0.0 or higher is not installed; skipping jruby-launcher specs"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Generate gemspec file"
|
17
|
+
task :gemspec => './lib/jruby-launcher.rb' do
|
18
|
+
@gemspec ||= Gem::Specification.new do |s|
|
19
|
+
load './lib/jruby-launcher.rb'
|
20
|
+
s.name = %q{jruby-launcher}
|
21
|
+
s.platform = Gem::Platform.new("java")
|
22
|
+
s.version = JRubyLauncher::VERSION
|
23
|
+
s.authors = ["Nick Sieger", "Vladimir Sizikov"]
|
24
|
+
s.date = Date.today.to_s
|
25
|
+
s.description = %q{Builds and installs a native launcher for JRuby on your system}
|
26
|
+
s.summary = %q{Native launcher for JRuby}
|
27
|
+
s.email = ["nick@nicksieger.com", "vsizikov@gmail.com"]
|
28
|
+
s.extensions = ["extconf.rb"]
|
29
|
+
s.files = FileList["COPYING", "README.md", "Makefile", "Rakefile", "*.c", "*.cpp", "*.h", "inc/*.*", "**/*.rb", "resources/*.*"]
|
30
|
+
s.homepage = %q{http://jruby.org}
|
31
|
+
s.rubyforge_project = %q{jruby-extras}
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Create gem file"
|
36
|
+
task :package => [:update_version, :gemspec, :spec] do
|
37
|
+
Gem::PackageTask.new(@gemspec) do |pkg|
|
38
|
+
end
|
39
|
+
Rake::Task['gem'].invoke
|
40
|
+
end
|
41
|
+
|
42
|
+
desc "Update version.h based on information in lib/jruby-launcher.rb"
|
43
|
+
task :update_version do
|
44
|
+
load File.join(File.dirname(__FILE__), "lib", "jruby-launcher.rb")
|
45
|
+
version_file = File.join(File.dirname(__FILE__), "version.h")
|
46
|
+
version_file_content = File.read(version_file)
|
47
|
+
version_file_content.gsub! /JRUBY_LAUNCHER_VERSION\s+"[^"]+"/, "JRUBY_LAUNCHER_VERSION \"#{JRubyLauncher::VERSION}\""
|
48
|
+
File.open(version_file, "w") do |f|
|
49
|
+
f.puts version_file_content
|
50
|
+
end
|
51
|
+
end
|