I can confirm that it doesn't work with 1.0-milestone-2.

Steps to reproduce:
1. Create a new WebApplication from scratch in NetBeans (6.9.1).
2. Create a new build.gradle file in your projects root directory.
3. Add 'ant.importBuild "build.xml"' in your build.gradle file.
4. Execute 'gradle default'.

I get this error with milestone-2:
[quote]
[509] gradle default
:-post-dist
:-pre-dist
:-copy-manifest
:-copy-persistence-xml
:-copy-webdir

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':-copy-webdir'.
Cause: /Users/elberry/NetBeansProjects/WebApplication1/${web.docbase.dir}
does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
[/quote]

I added some echo statements to the -copy-webdir target in
'nbproject/build-impl.xml' file to print out the missing properties:
[quote]
[ant:echo]
[ant:echo]           basedir=/Users/elberry/NetBeansProjects/WebApplication1
[ant:echo]           build.web.dir=${build.web.dir}
[ant:echo]           web.docbase.dir=${web.docbase.dir}
[ant:echo]
[/quote]

It seems like the properties aren't being picked up from the various
properties files NetBeans creates.

I tried softlinking 'gradle.properties' to the
'nbproject/project.properties' file with no success.

I also tried writing a little script to copy the properties from
'nbproject/project.properties' into ant.properties programmatically before
each task is run. This results in the default task succeeding, but
directories literally called '${build.dir}', and '${build.web.dir}' being
created instead of a 'build' directory.


On Mon, Apr 18, 2011 at 12:45 AM, Szczepan Faber <[email protected]> wrote:

> Hey,
>
> It is supported and it should work just fine. I have a build like that
> and it correctly pulls properties from file (I'm using latest gradle).
> I don't see anything wrong in your configuration, either. It feels the
> problem lies elsewhere. Can you create a temp task in your
> nbproject/build-impl.xml that just reads the properties and echoes
> them? Then try to execute it via gradle.
>
> Hope that helps!
> Szczepan
>
> On Sat, Apr 16, 2011 at 2:51 PM, Rob Stewart
> <[email protected]> wrote:
> > Hi,
> >
> > I am aware that there is no official support for Netbeans, but since
> > Netbeans uses ant, I thought that gradle would work.
> >
> > My build.gradle file contains:
> > ant.importBuild 'build.xml'
> >
> > The build.xml file in the root of a netbeans project contains:
> > <import file="nbproject/build-impl.xml"/>
> >
> > The nbproject/build-impl.xml file contains:
> > <target depends="-pre-init,-init-private,-init-libraries,-init-user"
> > name="-init-project">
> >        <property file="nbproject/project.properties"/>
> > </target>
> >
> > The nbproject/project.properties file contains:
> > web.docbase.dir=web
> >
> >
> > However, when I run `gradle default', the following error is thrown:
> > -----------------
> > Execution failed for task ':-copy-webdir'.
> > Cause: /home/foo/myproject/${web.docbase.dir} does not exist.
> >
> >
> > Am I missing something in my build.gradle file, or is this method of
> > importing build file in sub directories not supported in gradle's
> > ant.importBuild function?
> >
> > (Running `ant default' works fine.).
> >
> > --
> > Rob Stewart
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>


-- 
Learn from the past. Live in the present. Plan for the future.
Blog: http://eric-berry.blogspot.com
jEdit <http://www.jedit.org> - Programmer's Text Editor
Bazaar <http://bazaar.canonical.com> - Version Control for Humans

Reply via email to