Sha256: 08cef5e519e55a5e70b27ac0f6c21eca35d5cc3fc1b0c6a3251bcd10b7de347e

Contents?: true

Size: 955 Bytes

Versions: 2

Compression:

Stored size: 955 Bytes

Contents

require 'rake'
require 'rake/tasklib'

require 'netlinx/compile/script'

module NetLinx
  module Rake
    
    # Compile to deployable code from the source code files in the given workspace.
    class Compile < ::Rake::TaskLib
      
      attr_accessor :name
      
      def initialize name = :compile
        @name = name
        yield self if block_given?
        
        desc "Compile to deployable code from the source code files in the given workspace."
        
        task(name) do
          workspace = Dir.glob("*.apw").first
          
          puts "\n\nLaunching NetLinx compiler...\n\n"
          # TODO: Invoke compiler through API.
          #       Just call the netlinx-compile rake task in rake/erb.
          system "netlinx-compile --smart -s \"#{workspace}\""
          # NetLinx::Compile::Script.run argv: ['--smart', '-s', "\"#{workspace}\""]
        end
        
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
netlinx-compile-3.1.2 lib/netlinx/rake/compile/compile.rb
netlinx-compile-3.1.1 lib/netlinx/rake/compile/compile.rb