I haven't looked into the EnvInject plugin very deeply but from what I can see you have to create an additional "EnvInject build step" after your own build step in order to inject any potential environment variables into the next build step.
The problem with this is if you have both build steps and post build steps. If your build step fails for some reason any previous build steps will not be executed and thus also the EnvInject build step that is suppose to inject the environment variables into the build.
My plugin works like this:
Build step 1:
"
#!/bin/bash
# do some stuff...
# result = `some program`
echo "RESULT=$result" > $ENVFILE
"
Build step2:
"
# do some other stuff...
echo $RESULT
"
Post build step:
"
# do something with $RESULT
"
Regardless if build step 1 exits successfully or not, the post build step will always know about $RESULT.
When using the EnvInject, from my understanding, I would have to have another build step in between build step 1 and 2 to get $RESULT into build step 2. And if build step 1 fails, the EnvInject build step will not be executed and thus the post build step will not know about $RESULT.