[GRADLE-1733] Internal error Created: 08/Aug/11 Updated: 04/Jan/13 Resolved: 12/Aug/11 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 1.0-milestone-4 |
Fix Version/s: | None |
Type: | Bug | ||
Reporter: | Konrad Hinsen | Assignee: | Peter Niederwieser |
Resolution: | Not A Bug | Votes: | 0 |
Attachments: | build.gradle |
Description |
When running "gradle build" with the attached build.gradle, I get an "internal error". The project that is being built is available for download at https://bitbucket.org/khinsen/active_papers/overview. Just replace the build.gradle from that project by the one attached. Here's the complete error message: FAILURE: Build aborted because of an internal error.
|
Comments |
Comment by Peter Niederwieser [ 12/Aug/11 ] |
Your custom task class has a few problems: 1. You don't have to do doLast inside a @TaskAction because you already are in an action. You can't even do it because actions have to be added at configuration time, not at execution time. This causes the exception. 2. Likewise, inputs and outputs have to be declared at configuration time. For task classes this is usually done with annotations. Here is a slightly improved version of your class that hopefully solves these problems (disclaimer: I haven't tested it): class MakeLibraryTask extends DefaultTask { @InputFile File someFile = project.jar.archivePath // intended as replacement for "inputs.file project.jar.archivePath"; not sure what it's needed for @OutputDirectory File destDir = new File(project.buildDir, 'active_papers') String paper = 'active_paper.h5' def libs = [] @TaskAction def makeLibrary() { libFile = new File(destDir, paper) destDir.mkdirs() project.javaexec { classpath = project.project(':active_paper_cltool').sourceSets.main.runtimeClasspath main = 'active_papers.cltool' args = ['make_library', libFile.absolutePath] + filemap(libs) } } } |
Comment by Konrad Hinsen [ 16/Aug/11 ] |
Thanks for your suggestions, they helped me to get my custom task class working! I had suspected that my custom task class was the cause of the error message, but since Gradle told me explicitly to file a bug report, I did. |