• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Ant to gradle migration

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Im trying to migrate my code from ant to gradle and imported my build.xml in build.gradle and some of my tasks work fine.
However there are some tasks when i run them it says

Execution failed for task ':compile'.
> srcdir attribute must be set!

Pasting a snippet of my Build.xml and the compile task below is failing.

<project basedir="." default="deploy-copy" name="FitNesse">
<property name="fitnesse.target" value="/deploy/test-fitnesse"/>

<patternset id="test.patternset">
<include name="**/*Test*.java"/>
</patternset>
<propertyset id="test.propertyset">
<propertyref name="basedir"/>
<propertyref name="test.patternset"/>
</propertyset>


<fileset id="classpath.fitnesse" dir="./libs">
<include name="antlr-2.7.7.jar"/>
<include name="asm-4.1.jar"/>
<include name="asm-analysis-4.1.jar"/>
<include name="asm-commons-4.1.jar"/>
<include name="asm-tree-4.1.jar"/

><target name="compile" description="Compile the Qkn java sources" depends="clean">
<mkdir dir="build/classes"/>
<javac includeantruntime="false"/>
<javac srcdir="src/main/java" destdir="build/classes" debug="on">
<classpath refid="classpath.compile"/>
<compilerarg value="-processorpath"/>
<compilerarg value="-AmethodConstraintsSupported=true"/>
</javac>
</target>


Source folder structure
/src/main/java/com/xebia/incubator/xebium

I had changed my src folder structure from ant "src" to a gradle project "/src/main/java/com/xebia/incubator/xebium".

Please help. I'm kind of blocked.

Thanks,
abhi
 
Abhishek mura
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Somebody please help me on this...
 
Marshal
Posts: 26912
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhishek mura wrote:Execution failed for task ':compile'.
> srcdir attribute must be set!



I'm no Gradle expert, but if I got an error message which says "srcdir attribute must be set", the first thing I would try would be to set the srcdir attribute. I notice that your "compile" task doesn't have any such attribute, too, so it shouldn't be too hard to put one in. So why don't you try that? Let us know if you continue to have problems.
 
Abhishek mura
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the srcdir attribute added to the task already..
<javac srcdir="src/main/java" destdir="build/classes" debug="on">
 
Paul Clapham
Marshal
Posts: 26912
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(Still in non-expert mode:) Why are there two <javac> elements? Only one of them has a srcdir attribute.
 
Abhishek mura
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well should not matter, i tried with single javac element, and i still get the same error on srcdir
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic