buildr-mirah 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,13 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.6.3"
12
+ gem "rcov", ">= 0"
13
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Thomas Lee
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # buildr-mirah
2
+
3
+ Use buildr to build Mirah code.
4
+
5
+ ## Status
6
+
7
+ Pre-Alpha
8
+
9
+ ## Overview
10
+
11
+ This is currently just a personal experiment with Flex, Bison and LLVM.
12
+
13
+ ## Prerequisites
14
+
15
+ * GNU flex 2.5.x+
16
+ * GNU bison 2.4.x+
17
+ * GNU make 3.81+
18
+ * gcc 4.4.x+
19
+ * libcheck 0.9.8+
20
+ * llvm 2.7+
21
+
22
+ ## Installation
23
+
24
+ 1. Download the source: **git clone thomaslee/vcx**
25
+ 2. Check **$PREFIX** looks sane in the Makefile
26
+ 3. Build vcx: **cd vcx && make**
27
+ 4. Run the tests: **make check**
28
+ 5. If all the tests pass, install it: **make install**
29
+
30
+ ## Usage
31
+
32
+ vcx <source.vcx
33
+
34
+ ## License
35
+
36
+ This software is available to you under the terms of the
37
+ [GNU General Public License v3](http://www.gnu.org/licenses/gpl.html).
38
+
39
+ ## Support
40
+
41
+ Please log defects and feature requests using the github issue tracker.
42
+
43
+ ## About
44
+
45
+ vcx was written by [Tom Lee](http://tomlee.co).
46
+
47
+ Follow me on [Twitter](http://www.twitter.com/tglee),
48
+ [LinkedIn](http://au.linkedin.com/pub/thomas-lee/2/386/629).
49
+
50
+
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = buildr-mirah
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to buildr-mirah
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Thomas Lee. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "buildr-mirah"
18
+ gem.homepage = "http://github.com/thomaslee/buildr-mirah"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Use buildr to compile your mirah projects}
21
+ gem.description = gem.summary
22
+ gem.email = "me@tomlee.co"
23
+ gem.authors = ["Thomas Lee"]
24
+ gem.files.include "lib/buildr/mirah.rb"
25
+ # dependencies defined in Gemfile
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rake/testtask'
30
+ Rake::TestTask.new(:test) do |test|
31
+ test.libs << 'lib' << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+
36
+ require 'rcov/rcovtask'
37
+ Rcov::RcovTask.new do |test|
38
+ test.libs << 'test'
39
+ test.pattern = 'test/**/test_*.rb'
40
+ test.verbose = true
41
+ test.rcov_opts << '--exclude "gems/*"'
42
+ end
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "buildr-mirah #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,57 @@
1
+ module Buildr::Mirah
2
+ class Mirahc < Compiler::Base
3
+ REQUIRES = ArtifactNamespace.for(self) do |ns|
4
+ ns.mirah! "org.mirah:mirah-complete:jar:>=0.0.7"
5
+ end
6
+
7
+ CLASSNAME = "org.mirah.MirahCommand"
8
+ OPTIONS = [:classpath, :dir]
9
+
10
+ class << self
11
+ def dependencies
12
+ REQUIRES.artifacts
13
+ end
14
+
15
+ def applies_to?(project, task)
16
+ paths = task.sources + [sources].flatten.map do |src|
17
+ Array(project.path_to(:source, task.usage, src.to_sym))
18
+ end
19
+ paths.flatten!
20
+ paths.any? { |path| !Dir["#{path}/**/*.mirah"].empty? }
21
+ end
22
+ end
23
+
24
+ specify :language => :mirah,
25
+ :sources => [:mirah],
26
+ :source_ext => [:mirah],
27
+ :target => "classes",
28
+ :target_ext => "class",
29
+ :packaging => :jar
30
+
31
+ def compile(sources, target, dependencies)
32
+ return if Buildr.application.options.dryrun
33
+ Buildr.ant "mirahc" do |ant|
34
+ refid = "mirahc-classpath"
35
+ ant.path(:id => refid) do
36
+ dependencies.each { |dep| ant.pathelement :location => dep }
37
+ end
38
+ java_options = {
39
+ :classname => "org.mirah.MirahCommand",
40
+ :classpathref => refid,
41
+ :fork => true,
42
+ :failonerror => true,
43
+ }
44
+ ant.java(java_options) do
45
+ ant.arg(:value => "compile")
46
+ options.to_hash.only(*OPTIONS).each_pair do |key, value|
47
+ ant.arg(:value => "--#{key.to_s}")
48
+ ant.arg(:value => value)
49
+ end
50
+ sources.each { |src| ant.arg(:value => src) }
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ Buildr::Compiler.compilers << Buildr::Mirah::Mirahc
57
+
File without changes
data/test/helper.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'buildr-mirah'
16
+
17
+ class Test::Unit::TestCase
18
+ end
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: buildr-mirah
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.1.0
6
+ platform: ruby
7
+ authors:
8
+ - Thomas Lee
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-07-04 00:00:00 +10:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: shoulda
18
+ version_requirements: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ requirement: *id001
25
+ prerelease: false
26
+ type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ version_requirements: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 1.0.0
35
+ requirement: *id002
36
+ prerelease: false
37
+ type: :development
38
+ - !ruby/object:Gem::Dependency
39
+ name: jeweler
40
+ version_requirements: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.6.3
46
+ requirement: *id003
47
+ prerelease: false
48
+ type: :development
49
+ - !ruby/object:Gem::Dependency
50
+ name: rcov
51
+ version_requirements: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ requirement: *id004
58
+ prerelease: false
59
+ type: :development
60
+ description: Use buildr to compile your mirah projects
61
+ email: me@tomlee.co
62
+ executables: []
63
+
64
+ extensions: []
65
+
66
+ extra_rdoc_files:
67
+ - LICENSE.txt
68
+ - README.md
69
+ - README.rdoc
70
+ files:
71
+ - .document
72
+ - Gemfile
73
+ - LICENSE.txt
74
+ - README.rdoc
75
+ - Rakefile
76
+ - VERSION
77
+ - lib/buildr-mirah.rb
78
+ - lib/buildr/mirah.rb
79
+ - test/helper.rb
80
+ - README.md
81
+ has_rdoc: true
82
+ homepage: http://github.com/thomaslee/buildr-mirah
83
+ licenses:
84
+ - MIT
85
+ post_install_message:
86
+ rdoc_options: []
87
+
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ hash: 2
96
+ segments:
97
+ - 0
98
+ version: "0"
99
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: "0"
105
+ requirements: []
106
+
107
+ rubyforge_project:
108
+ rubygems_version: 1.5.1
109
+ signing_key:
110
+ specification_version: 3
111
+ summary: Use buildr to compile your mirah projects
112
+ test_files: []
113
+