This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152158 - Cannot build/run groovy script/application if sources anre nor in default src directory
Summary: Cannot build/run groovy script/application if sources anre nor in default src...
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 159250 162317 (view as bug list)
Depends on: 160122
Blocks:
  Show dependency tree
 
Reported: 2008-11-02 18:07 UTC by movk
Modified: 2009-04-18 14:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch that will fix the issue (4.93 KB, text/plain)
2009-03-18 14:46 UTC, Petr Hejl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description movk 2008-11-02 18:07:37 UTC
Steps to reproduce (NB 6.5 RC2 used):

1) Create directory c:/tmp/groovyt, add simple GroovyTest.groovy file into this directory. Content of the file:

class GroovyTest {
    static void main(String[] args) {
        println "GroovyTest"
    }
}

2) Start NB 6.5 RC2

3) create new java project (Java Application) named "groovyt", 
uncheck "Create Main Class", press Finish

4) Select Project properties, go to Build/Groovy, check "Enable Groovy"

5) Select Project properties, go to Sources , remove default "src" entry, 
press "add Folder", select (add) c:/tmp/groovyt

6) Clean and Build project -> error occurs telling that srcdir does not exist:
"C:\...\groovy-build.xml:16: srcdir "C:\...\groovyt\${src.dir}" does not exist!"

(Note: I had replaced the full path with "...")

In case groovy sources are placed into default src directory, 
program can be compiled and run correctly.
Comment 1 oliverbo 2008-12-25 19:10:30 UTC
It also doesn't work with multiple source directories, for example a source directory for Java and one for groovy code.

The issue is that groovy-build.xml is not generated correctly: the javac and depend macros just refer to the default
source directory, not to the ones set up int the project properties.

A simple work around is to copy the 'srcdir' attribute from the javac and depend macros in build-impl.xml over to
groovy-build.xml.
Comment 2 pniederw 2009-02-26 20:19:25 UTC
*** Issue 159250 has been marked as a duplicate of this issue. ***
Comment 3 Petr Hejl 2009-03-18 14:46:32 UTC
Created attachment 78379 [details]
patch that will fix the issue
Comment 4 Petr Hejl 2009-03-20 08:23:44 UTC
Fixed in web-main 7d0d716feac6.
Comment 5 Quality Engineering 2009-03-21 08:33:35 UTC
Integrated into 'main-golden', will be available in build *200903210201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7d0d716feac6
User: phejl@netbeans.org
Log: #152158 Cannot build/run groovy script/application if sources anre nor in default src directory
Comment 6 Petr Hejl 2009-04-18 14:42:00 UTC
*** Issue 162317 has been marked as a duplicate of this issue. ***