We are trying to compile CSpice using the C plugin. The compilation died because it created an ar command line that was too long for the shell since it used absolute paths for every filename. Can the C plugin be configured to use relative (short) paths instead when it calls ar? Or, can you think of a better way to compile this library?
Here’s the relevant line from --info output. I’ve replaced the absolute path to projectDir with
14:38:44.345 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/usr/bin/ar''. Working directory: <absolute-path> Command: /usr/bin/ar -rcs <absolute-path>/build/binaries/cspiceStaticLibrary/release/libcspice.a <absolute-path>/build/objectFiles/cspiceStaticLibrary/release/cspiceC/abort_.o <absolute-path>/build/objectFiles/cspiceStaticLibrary/release/cspiceC/accept.o …
And here is the excerpt from the --debug output:
14:38:44.413 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Cannot run program "/usr/bin/ar" (in directory "<absolute-path>/spice"): error=7, Argument list too long
14:38:44.413 [ERROR] [org.gradle.BuildExceptionReporter]
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
Relevant except from build.gradle:
apply plugin: 'c'
sourceSets {
cspice {}
}
sources {
cspice {
c {
source {
srcDir "$buildDir/mice/src/cspice"
include "**/*.c"
}
}
}
}
And finally:
$ gradle --version
------------------------------------------------------------
Gradle 1.11
------------------------------------------------------------
Build time:
2014-02-11 11:34:39 UTC
Build number: none
Revision:
a831fa866d46cbee94e61a09af15f9dd95987421
Groovy:
1.8.6
Ant:
Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy:
2.2.0
JVM:
1.6.0_65 (Apple Inc. 20.65-b04-462)
OS:
Mac OS X 10.7.5 x86_64