There's a javaexec task, try using that
(http://www.gradle.org/latest/docs/javadoc/org/gradle/api/tasks/JavaExec.html)

On Tue, Aug 3, 2010 at 08:23,  <[email protected]> wrote:
> I'm more surprised that the compile step puts it in build/classes/main/foo/
> and besides in what directory the compilation will finally be, I'm wondering
> if I try to execute a class in a task that this failes (see my task
> 'run-project').
>
>
>
> -----Original Message-----
> From: Jason Porter <[email protected]>
> To: user <[email protected]>
> Sent: Tue, Aug 3, 2010 4:13 pm
> Subject: Re: [gradle-user] Compiling source code goes in wrong build dir
>
> On Tue, Aug 3, 2010 at 02:26,  <[email protected]> wrote:
>
>
>> mhm... if I run 'gradle jar' it does put the compiled classes in the
>> correct
>
>
>> directory structure ?!
>
>
>
>
>
> Yes, it's in the correct location in the jar.  The reason for
>
>
> separating things out is so you don't have bleed through any classes
>
>
> in a polyglot environment or with tests.  It's a very common thing.
>
>
>
>
>
>> -----Original Message-----
>
>
>> From: mremersoncod <[email protected]>
>
>
>> To: user <[email protected]>
>
>
>> Sent: Tue, Aug 3, 2010 10:08 am
>
>
>> Subject: [gradle-user] Compiling source code goes in wrong build dir
>
>
>>
>
>
>> Hi,
>
>
>>
>
>
>> I have a simple groovy project with sources in src/main/groovy. Lets say
>
>
>> they are all in a package called 'foo'.
>
>
>>
>
>
>> If I run compileGroovy without any additional configuration the classes
>> end
>
>
>> up in
>
>
>>
>
>
>> build/classes/main/foo/
>
>
>>
>
>
>> why is the main in there ?
>
>
>>
>
>
>>
>
>
>> Also - how can I run a class from a build.gradle ?
>
>
>>
>
>
>> this is my build.gradle:
>
>
>>
>
>
>> apply plugin:'groovy'
>
>
>>
>
>
>> buildscript{
>
>
>>   apply {
>
>
>>     apply from:
>
>
>>
>> 'http://myserver:port/artifactory/repo/de/configuration/1.0/configuration-1.0.gradle';
>
>
>>   }
>
>
>> }
>
>
>>
>
>
>> dependencies {
>
>
>>     groovy group:'org.codehaus.groovy', name:'groovy-all', version:'1.7.4'
>
>
>> }
>
>
>>
>
>
>> task 'run-project' << {
>
>
>>     new foo.AGroovy()
>
>
>> }
>
>
>>
>
>
>> I assumed that per default if the compiled class is in build/classes it
>> will
>
>
>> run. But also if the compiled class is under
>> build/classes/foo/AGroovy.class
>
>
>> running 'gradle run-proejct' fails with 'unable to resolve....'
>
>
>>
>
>
>> What do I have to configure to run from a build script ?
>
>
>>
>
>
>> Thanks
>
>
>>
>
>
>
>
>
>
>
>
>
>
>
> --
>
>
> Jason Porter
>
>
> http://lightguard-jp.blogspot.com
>
>
> http://twitter.com/lightguardjp
>
>
>
>
>
> Software Engineer
>
>
> Open Source Advocate
>
>
>
>
>
> PGP key id: 926CCFF5
>
>
> PGP key available at: keyserver.net, pgp.mit.edu
>
>
>
>
>
> ---------------------------------------------------------------------
>
>
> To unsubscribe from this list, please visit:
>
>
>
>
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>
>
>
>
>
>
>
>
>



-- 
Jason Porter
http://lightguard-jp.blogspot.com
http://twitter.com/lightguardjp

Software Engineer
Open Source Advocate

PGP key id: 926CCFF5
PGP key available at: keyserver.net, pgp.mit.edu

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to