This message was deleted.
# plugin-development
s
This message was deleted.
a
Copy code
register<Exec>(taskName) {
    group = groupName
    if (isRegisterCommand) {
        // required to register queries correctly.
        dependsOn(anotherTask)
    }
    workingDir(project.projectDir)
    logger.log(<http://LogLevel.INFO|LogLevel.INFO>, "Working Directory: ${this.workingDir.absolutePath}")
    if (!outputOnly) {
        logger.log(<http://LogLevel.INFO|LogLevel.INFO>, "Executing -> $execName ${argsList.joinToString()}")
        executable(execName)
        setArgs(argsList)
    } else {
        logger.log(LogLevel.WARN, "Skipping -> $execName ${argsList.joinToString()}")
        executable(DEFAULT_EXEC)
    }
}
this looks like it should work. any insights?
all i get is:
Copy code
Caused by: java.io.IOException: Cannot run program $execName (in directory "/Users/**/project/example"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
	... 9 more
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 11 more
directory exists (its a gradle submodule)
c
Check your arguments - interpolated variables and globs are shell constructs and aren’t expanded by exec.
Copy code
java.io.IOException: Cannot run program $execName (in directory "/Users/**/project/example"
a
sorry those are just there as placeholders for the real name
for context, this all worked with same set of arguments previously. project im calling from uses gradle 8.0. while plugin is built with pre 8.0 gradle. so im not sure if theres also version compatibility here
c
ugh, munging the error message in a way that indicates a problem isn’t cool. Anyhow, it clearly doesn’t like your executable. Are you sure it exists in the given directory? Its an error 2 - not found - so either the directory or the exec name are invalid.
a
yep running on command line at the directory works just fine
(i print out the exact command it runs, so i can copy paste into terminal)
c
is the executable assumed to be on a (possibly different) PATH, or is it referenced as an absolute path?
(different from command line)
a
/usr/local/bin/$exectutable
when i do
which
command ill run a
which
command instead to see if its a path issue too