Sha256: 5b524f17831df18ca632146ca71ca6104ad5044eceaf707cc5e956790d28883d

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require "generators/swift/version"

require 'minke/generators/register'
require 'minke/generators/config'

module Minke
  module Generators
    module Swift
      # Register the template with minke
      config = Minke::Generators::Config.new
      config.name = 'minke-generator-swift'
      config.template_location = File.expand_path(File.dirname(__FILE__)) + '/swift/scaffold'

      config.build_settings = Minke::Generators::BuildSettings.new

      config.build_settings.build_commands = Minke::Generators::BuildCommands.new.tap do |bc|
        bc.fetch = [['/bin/bash', '-c', 'swift build --fetch'], ['/bin/bash', '-c', 'find Packages/ -type d -name Tests | xargs rm -rf']]
        bc.build = [['/bin/bash', '-c', 'swift build -Xcc -fblocks']]
        bc.test  = [['/bin/bash', '-c', 'swift test']]
      end

      config.build_settings.docker_settings = Minke::Generators::DockerSettings.new.tap do |bs|
        bs.image = 'ibmcom/kitura-ubuntu'
        bs.binds = ["<%= src_root %>/src:/src"]
        bs.working_directory = '/src'
      end

      Minke::Generators.register config
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
minke-generator-swift-0.1.0 lib/generators/swift.rb