You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@buildr.apache.org by Nikos Maris <ni...@gmail.com> on 2010/09/30 12:58:15 UTC

call jruby from ant

I was asked to call buildr from ant (eclipse) and generally make some things
work out-of-the-box, so that others that will use my buildfile, won't need
to move jar files around or configure anything.

I would like jruby to run on the same JVM instance as eclipse. The java ant
task does that by default but what are the necessary arguments (classpath,
etc)? As the bsf thing needs downloading the jar etc, it is not an option.

----------------build.xml---------------------
<?xml version="1.0"?>
<project default="main" basedir=".">
<target name="main">
 <exec executable="C:\jruby-1.5.2\bin\jruby.bat">
<arg value="-J-classpath" />
 <arg value="'C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar'" />
<arg value="-S" />
 <arg value="buildr" />
<arg value="hi" />
 </exec>
</target>
</project>
----------------buildfile---------------------
Project.local_task :hi
define 'MyProject' do
task :hi do |task| puts "buildr says hello"; end
end

thank you for your time,
Nikos

Re: [jruby-user] call jruby from ant

Posted by Antoine Toulme <an...@lunar-ocean.com>.
I guess you need 2 scripts:
-one to start jetty
-one to kill jetty.

That should do it.

On Thu, Sep 30, 2010 at 08:33, Nikos Maris <ni...@gmail.com> wrote:

> Can I run jruby on the same JVM instance as ant? Starting a server from
> external tools and then killing the script, kills the script but not the
> jruby process.
> http://jira.codehaus.org/browse/JETTY-208
>
> Also from this mailing list:
> http://www.mail-archive.com/users@buildr.apache.org/msg00119.html
> Starting-stopping a server from console:
> Alternatively, in a single console:
> $ buildr jetty:start &
> $ buildr deploy-app
> And again this free up the console so you can do more work while your app
> is
> running inside Jetty. To stop the server:
> $ buildr jetty:stop
>
> On Thu, Sep 30, 2010 at 6:09 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:
>
>> I'm pretty sure that Ant doesn't run in the same instance as Eclipse (just
>> tried, the debug view shows that a new JVM is created).
>> Rather than using Ant, you can run programs directly in External Tools.
>>
>> Antoine
>>
>> On Thu, Sep 30, 2010 at 03:58, Nikos Maris <ni...@gmail.com> wrote:
>>
>> > I was asked to call buildr from ant (eclipse) and generally make some
>> > things work out-of-the-box, so that others that will use my buildfile,
>> won't
>> > need to move jar files around or configure anything.
>> >
>> > I would like jruby to run on the same JVM instance as eclipse. The java
>> ant
>> > task does that by default but what are the necessary arguments
>> (classpath,
>> > etc)? As the bsf thing needs downloading the jar etc, it is not an
>> option.
>> >
>> > ----------------build.xml---------------------
>> > <?xml version="1.0"?>
>> > <project default="main" basedir=".">
>> > <target name="main">
>> >  <exec executable="C:\jruby-1.5.2\bin\jruby.bat">
>> > <arg value="-J-classpath" />
>> >  <arg value="'C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar'" />
>> > <arg value="-S" />
>> >  <arg value="buildr" />
>> > <arg value="hi" />
>> >  </exec>
>> > </target>
>> > </project>
>> > ----------------buildfile---------------------
>> > Project.local_task :hi
>> > define 'MyProject' do
>> > task :hi do |task| puts "buildr says hello"; end
>> > end
>> >
>> > thank you for your time,
>> > Nikos
>> >
>>
>
>

Re: [jruby-user] call jruby from ant

Posted by Nikos Maris <ni...@gmail.com>.
Can I run jruby on the same JVM instance as ant? Starting a server from
external tools and then killing the script, kills the script but not the
jruby process.
http://jira.codehaus.org/browse/JETTY-208

Also from this mailing list:
http://www.mail-archive.com/users@buildr.apache.org/msg00119.html
Starting-stopping a server from console:
Alternatively, in a single console:
$ buildr jetty:start &
$ buildr deploy-app
And again this free up the console so you can do more work while your app is
running inside Jetty. To stop the server:
$ buildr jetty:stop

On Thu, Sep 30, 2010 at 6:09 PM, Antoine Toulme <an...@lunar-ocean.com>wrote:

> I'm pretty sure that Ant doesn't run in the same instance as Eclipse (just
> tried, the debug view shows that a new JVM is created).
> Rather than using Ant, you can run programs directly in External Tools.
>
> Antoine
>
> On Thu, Sep 30, 2010 at 03:58, Nikos Maris <ni...@gmail.com> wrote:
>
> > I was asked to call buildr from ant (eclipse) and generally make some
> > things work out-of-the-box, so that others that will use my buildfile,
> won't
> > need to move jar files around or configure anything.
> >
> > I would like jruby to run on the same JVM instance as eclipse. The java
> ant
> > task does that by default but what are the necessary arguments
> (classpath,
> > etc)? As the bsf thing needs downloading the jar etc, it is not an
> option.
> >
> > ----------------build.xml---------------------
> > <?xml version="1.0"?>
> > <project default="main" basedir=".">
> > <target name="main">
> >  <exec executable="C:\jruby-1.5.2\bin\jruby.bat">
> > <arg value="-J-classpath" />
> >  <arg value="'C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar'" />
> > <arg value="-S" />
> >  <arg value="buildr" />
> > <arg value="hi" />
> >  </exec>
> > </target>
> > </project>
> > ----------------buildfile---------------------
> > Project.local_task :hi
> > define 'MyProject' do
> > task :hi do |task| puts "buildr says hello"; end
> > end
> >
> > thank you for your time,
> > Nikos
> >
>

Re: [jruby-user] call jruby from ant

Posted by Antoine Toulme <an...@lunar-ocean.com>.
I'm pretty sure that Ant doesn't run in the same instance as Eclipse (just
tried, the debug view shows that a new JVM is created).
Rather than using Ant, you can run programs directly in External Tools.

Antoine

On Thu, Sep 30, 2010 at 03:58, Nikos Maris <ni...@gmail.com> wrote:

> I was asked to call buildr from ant (eclipse) and generally make some
> things work out-of-the-box, so that others that will use my buildfile, won't
> need to move jar files around or configure anything.
>
> I would like jruby to run on the same JVM instance as eclipse. The java ant
> task does that by default but what are the necessary arguments (classpath,
> etc)? As the bsf thing needs downloading the jar etc, it is not an option.
>
> ----------------build.xml---------------------
> <?xml version="1.0"?>
> <project default="main" basedir=".">
> <target name="main">
>  <exec executable="C:\jruby-1.5.2\bin\jruby.bat">
> <arg value="-J-classpath" />
>  <arg value="'C:\Program Files\Java\jdk1.6.0_21\lib\tools.jar'" />
> <arg value="-S" />
>  <arg value="buildr" />
> <arg value="hi" />
>  </exec>
> </target>
> </project>
> ----------------buildfile---------------------
> Project.local_task :hi
> define 'MyProject' do
> task :hi do |task| puts "buildr says hello"; end
> end
>
> thank you for your time,
> Nikos
>