protected int runPluginScript ( final PluginStepContext executionContext , final PrintStream outputStream , final PrintStream errorStream , final Framework framework , final Map < String , Object > configuration ) throws IOException , InterruptedException , ConfigurationException { Description pluginDesc = getDescription ( ) ; final DataContext localDataContext = createScriptDataContext ( framework , executionContext . getFrameworkProject ( ) , executionContext . getDataContext ( ) ) ; Map < String , Object > instanceData = new HashMap <> ( configuration ) ; Map < String , String > data = MapData . toStringStringMap ( instanceData ) ; loadContentConversionPropertyValues ( data , executionContext . getExecutionContext ( ) , pluginDesc . getProperties ( ) ) ; localDataContext . merge ( new BaseDataContext ( "config" , data ) ) ; final String [ ] finalargs = createScriptArgs ( localDataContext ) ; executionContext . getLogger ( ) . log ( 3 , "[" + getProvider ( ) . getName ( ) + "] executing: " + Arrays . asList ( finalargs ) ) ; Map < String , String > envMap = new HashMap <> ( ) ; if ( isMergeEnvVars ( ) ) { envMap . putAll ( getScriptExecHelper ( ) . loadLocalEnvironment ( ) ) ; } envMap . putAll ( DataContextUtils . generateEnvVarsFromContext ( localDataContext ) ) ; return getScriptExecHelper ( ) . runLocalCommand ( finalargs , envMap , null , outputStream , errorStream ) ; }
Runs the script configured for the script plugin and channels the output to two streams .