logo

class

build::CompileFan

sys::Obj
  build::Task
    build::CompileFan
  1  //
  2  // Copyright (c) 2006, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   4 Nov 06  Brian Frank  Creation
  7  //
  8  
  9  using compiler
 10  
 11  **
 12  ** Run the fan compiler to produce a Fan pod.
 13  **
 14  class CompileFan : Task
 15  {
 16    new make(BuildPod script)
 17      : super(script)
 18    {
 19    }
 20  
 21    override Void run()
 22    {
 23      script := script as BuildPod
 24  
 25      input := CompilerInput.make
 26      input.inputLoc    = Location.makeFile(script.scriptFile)
 27      input.podName     = script.podName
 28      input.version     = script.version
 29      input.description = script.description
 30      input.podFacets   = script.podFacets
 31      input.depends     = script.parseDepends
 32      input.dependsDir  = script.resolveDir(script.dependsDir, true)
 33      input.log         = log
 34      input.includeDoc  = includeDoc
 35      input.includeSrc  = includeSrc
 36      input.mode        = CompilerInputMode.file
 37      input.homeDir     = script.scriptDir
 38      input.srcDirs     = script.resolveDirs(script.srcDirs)
 39      input.resDirs     = script.resolveDirs(script.resDirs)
 40      input.outDir      = script.libFanDir
 41      input.output      = CompilerOutputMode.podFile
 42  
 43      try
 44      {
 45        Compiler.make(input).compile
 46      }
 47      catch (CompilerErr err)
 48       {
 49        // all errors should already be logged by Compiler
 50        throw FatalBuildErr.make
 51      }
 52      catch (Err err)
 53      {
 54        log.error("Internal compiler error")
 55        err.trace
 56        throw FatalBuildErr.make
 57      }
 58    }
 59  
 60    Bool includeDoc := false
 61    Bool includeSrc := false
 62  }