# demo-options


#using module h:\psec\flows\run-gael\setup-run-gael.psm1;
#using module h:\psec\lib\lib-setup-run-gael.psm1;

set-strictmode -version 2.0


function defineFlowTask([Flow]$flow,[Task]$task) {
#--- define
  $def = new-module -asCustomObject -scriptBlock {
    #[string]$main       = 'org.srp.psec.TestArgsPsec'

    # shows how to present contextual variables
    function getTaskDesc([Task]$task) {
      $tfs = $task.tfs;
      [string]$desc        = @"
This is used to generate the PSEC documentation package.
"@
      return $desc;
    }

    function fetchJavaMain([Object]$task,[hashtable]$parms) {
      return 'org.srp.psec.docs.GenPsecDocs'
    }

    function fetchJavaClassStr([Object]$task,[hashtable]$parms) {
      return '$env:PSEC_V4_UTILS/srp-util/lib;$env:PSEC_V4_UTILS/srp-util/java-gen-prod/production/srp-util;$env:PSEC_V4_UTILS/gael-core/lib;$env:PSEC_V4_UTILS/gael-core/libaux;'
    }

    # ---------- define task parameters
    <#
    The $htOpts parms has the processed options.  It can be modified or used to do
    other changes to the setup.
    #>
      function params([Object]$task,[hashtable]$htOpts) {
        $tfs = $task.tfs;
        $htOpts.inpdir  = "$env:PSEC_V4_EXEC_DIR";

        Remove-Item -Recurse -Force  "$($task.execlocn)/out-htm/htm"
        Remove-Item -Recurse -Force  "$($task.execlocn)/out-htm/src"

        $htOpts.outdir  = "$($task.execlocn)/out-htm";
        $htOpts.debdir  = "$($task.execlocn)/out-deb";
        $htOpts.tpldir  = "$($task.execlocn)/src-gen-docs";
        $htOpts.libdir  = "$($env:PSEC_V4_LIB_DIR)"
        $htOpts.brief   = "$($task.statlocn)"
        $htOpts.verstr  = "$($tfs.globMap.devpGlobs.verstr)"
        return  $htOpts
      }

      # ---------- define task options
      function options([Task]$task) {
        $tfs = $task.tfs;
        $opts = @();
        #$($tfs.globMap.devpGlobs.verstr)        ##$opts += @{type='input';  parm='genbrf';  label='GenBrf';  place='number of brief.GenArr lines to generate'; regex='^[0-9]+$'}
        $opts  += @{type='check';  parm='objs';    label='objs';    place='turns on intermediate obj dump'}
        $opts  += @{type='input';  parm='verstr';  label='VerStr';  value="$($tfs.globMap.devpGlobs.verstr)"; readonly=$true;}
        ##$opts += @{type='radio';  parm='trap';    label='trap';    valset='*/*no trap,fail/gen FAIL,trap/gen TRAP'}
        ##$opts += @{type='combo';  parm='combo';   label='combo';   valset='*/*--none--,green,red/show red,blue/set blue'}
        hlogBoth("options build $($tfs.globMap.devpGlobs.verstr)");
        return  ,$opts
      }

      # ---------- the actual script
      function runScript([Task]$task, [hashtable]$parms, [hashtable]$status) {
        $tfs = $task.tfs;
        hlog("Running script $($task.name) $tfs")
      }

      Export-ModuleMember -Variable * -Function *

  }
  hlog("defineFlowTask $flow $task")

  return $def;
}



X
PSEC - Powershell Enhanced Capability
1.2.1
  src: psec-devp-gen-docs-gen-docs-def.psm1

Copyright © 2018-2021, 2022, Rexcel System Inc.