Kenneth Kousen wrote:
>
> then the generateTestDb task runs every time, despite the fact I have the
> inputs and outputs properties set. What am I missing?
>
Seems to be a known problem with JavaExec. But you can always use "onlyIf {
!myFile.exists() }".
--
Peter Niederwieser
Principal Enginee
hit the same issue a while back.
Check out this thread. There is a workaround suggested
http://gradle.1045684.n5.nabble.com/javaexec-task-type-and-inputs-files-outputs-files-td4305023.html
Cheers
Magnus
On 2011-08-07 15:44:09 + Kenneth Kousen wrote:
>
> On Sun,
By the way, before you say that I'm mixing up the configuration phase with
the execution phase, if I simply change my task to:
task generateTestDb(dependsOn:classes, type:JavaExec) << {
srcFile = file("src/main/groovy/service/populate_stadium_data.groovy")
destFile = file("$buildDir/baseba
On Sun, Aug 7, 2011 at 2:01 AM, Peter Niederwieser wrote:
>
> Kenneth Kousen wrote:
> >
> > I only want to execute the task if the test database does not exist.
> >
>
> You can add an output to the task, or use Task.onlyIf{}, or use
> Project.exec().
>
I understand that in principle, but if my bu
Kenneth Kousen wrote:
>
> I only want to execute the task if the test database does not exist.
>
You can add an output to the task, or use Task.onlyIf{}, or use
Project.exec().
--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockfra
This actually worked:
task generateTestDb(dependsOn:classes, type:JavaExec) {
main = 'service.populate_stadium_data'
classpath sourceSets.main.runtimeClasspath
}
The only problem is that it runs every time. I only want to execute the task
if the test database does not exist. The examples
Kenneth Kousen wrote:
>
> As I say, it works in isolation, just not as part of the gradle script.
>
The fact that it works in isolation doesn't say anything about whether it
works in other class loader environments (like Gradle's).
Kenneth Kousen wrote:
>
> The script is src/main/groovy, jus
Hi again,
On Sat, Aug 6, 2011 at 10:17 AM, Peter Niederwieser wrote:
>
> Kenneth Kousen wrote:
> >
> > The problem is that when I run the populateStadiumDb task, I now get:
> >
> > * What went wrong:
> > Execution failed for task ':generateTestDb'.
> > Cause: java.lang.ClassNotFoundException: org
Kenneth Kousen wrote:
>
> The problem is that when I run the populateStadiumDb task, I now get:
>
> * What went wrong:
> Execution failed for task ':generateTestDb'.
> Cause: java.lang.ClassNotFoundException: org.h2.Driver
> Cause: org.h2.Driver
>
> That's strange, because the gradle dependenci
Kenneth Kousen wrote:
>
>> Even better, introduce your own configuration (e.g. 'script') and use
>> that.
>
> Um, how do I do that? Can you point me to an example?
>
configurations {
script
}
dependencies {
script ...
}
But if the script also needs the current project's code, the solutio
I thought it might be easier to just post the whole gradle.build file, so
here it is. It's still evolving (I plan to put the generateTestDb task in
the main build sequence), but this is what it looks like now:
apply plugin:'groovy'
apply plugin:'war'
apply plugin:'eclipse-wtp'
import org.codehaus
I'm definitely getting closer, but I still have a strange error.
Here's an excerpt from my gradle.build file:
task generateTestDb {
srcFile = file("src/main/groovy/service/populate_stadium_data.groovy")
destFile = file("$buildDir/baseball.h2.db")
inputs.file srcFile
outputs.file d
On 05/08/2011, at 3:18 AM, Kenneth Kousen wrote:
> Hi Peter,
>
> Thanks for the help, but I still don't quite have it. Here's the idea: I have
> a web application whose data resides in a database. I have a script that
> generates that database, which uses some of the classes in my domain.
>
>
Hi Peter,
Thanks for the help, but I still don't quite have it. Here's the idea: I
have a web application whose data resides in a database. I have a script
that generates that database, which uses some of the classes in my domain.
What I want to do is to execute that script as part of the build p
Kenneth Kousen wrote:
>
> I tried using a CompilerConfiguration:
>
> def config = new
> org.codehaus.groovy.control.CompilerConfiguration(classpath:sourceSets.main.runtimeClasspath)
> new GroovyShell(new Binding(), config).evaluate(script)
>
> but again the classes in the script aren't found.
>
15 matches
Mail list logo