fresno 0.0.2-java → 0.0.3-java
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -0
- data/Rakefile +150 -0
- data/fresno.gemspec +88 -0
- data/lib/fresno.rb +7 -0
- data/lib/fresno/app_generator.rb +59 -0
- data/lib/fresno/generator_data/BSD_FOR_WPILIB +24 -0
- data/lib/fresno/generator_data/MITLICENSE +7 -0
- data/lib/fresno/generator_data/README.md.template +9 -0
- data/lib/fresno/generator_data/build.properties.template +1 -0
- data/lib/fresno/generator_data/build.xml.template +85 -0
- data/lib/fresno/generator_data/command.mirah.template +1 -0
- data/lib/fresno/generator_data/gitignore.template +2 -0
- data/lib/fresno/generator_data/iterative.mirah.template +25 -0
- data/lib/fresno/generator_data/netbeans.template +95 -0
- data/lib/fresno/generator_data/simple.mirah.template +23 -0
- data/src/extensions/fields.mirah +32 -0
- data/src/fresno.mirah +1 -0
- metadata +20 -3
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
#############################################################################
|
6
|
+
#
|
7
|
+
# Helper functions
|
8
|
+
#
|
9
|
+
#############################################################################
|
10
|
+
|
11
|
+
def name
|
12
|
+
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
+
end
|
14
|
+
|
15
|
+
def version
|
16
|
+
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
|
+
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
|
+
end
|
19
|
+
|
20
|
+
def date
|
21
|
+
Date.today.to_s
|
22
|
+
end
|
23
|
+
|
24
|
+
def rubyforge_project
|
25
|
+
name
|
26
|
+
end
|
27
|
+
|
28
|
+
def gemspec_file
|
29
|
+
"#{name}.gemspec"
|
30
|
+
end
|
31
|
+
|
32
|
+
def gem_file
|
33
|
+
"#{name}-#{version}.gem"
|
34
|
+
end
|
35
|
+
|
36
|
+
def replace_header(head, header_name)
|
37
|
+
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
38
|
+
end
|
39
|
+
|
40
|
+
#############################################################################
|
41
|
+
#
|
42
|
+
# Standard tasks
|
43
|
+
#
|
44
|
+
#############################################################################
|
45
|
+
|
46
|
+
task :default => :test
|
47
|
+
|
48
|
+
require 'rake/testtask'
|
49
|
+
Rake::TestTask.new(:test) do |test|
|
50
|
+
test.libs << 'lib' << 'test'
|
51
|
+
test.pattern = 'test/**/test_*.rb'
|
52
|
+
test.verbose = true
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Generate RCov test coverage and open in your browser"
|
56
|
+
task :coverage do
|
57
|
+
require 'rcov'
|
58
|
+
sh "rm -fr coverage"
|
59
|
+
sh "rcov test/test_*.rb"
|
60
|
+
sh "open coverage/index.html"
|
61
|
+
end
|
62
|
+
|
63
|
+
require 'rake/rdoctask'
|
64
|
+
Rake::RDocTask.new do |rdoc|
|
65
|
+
rdoc.rdoc_dir = 'rdoc'
|
66
|
+
rdoc.title = "#{name} #{version}"
|
67
|
+
rdoc.rdoc_files.include('README*')
|
68
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
69
|
+
end
|
70
|
+
|
71
|
+
desc "Open an irb session preloaded with this library"
|
72
|
+
task :console do
|
73
|
+
sh "irb -rubygems -r ./lib/#{name}.rb"
|
74
|
+
end
|
75
|
+
|
76
|
+
#############################################################################
|
77
|
+
#
|
78
|
+
# Custom tasks (add your own tasks here)
|
79
|
+
#
|
80
|
+
#############################################################################
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
#############################################################################
|
85
|
+
#
|
86
|
+
# Packaging tasks
|
87
|
+
#
|
88
|
+
#############################################################################
|
89
|
+
|
90
|
+
desc "Create tag v#{version} and build and push #{gem_file} to Rubygems"
|
91
|
+
task :release => :build do
|
92
|
+
unless `git branch` =~ /^\* master$/
|
93
|
+
puts "You must be on the master branch to release!"
|
94
|
+
exit!
|
95
|
+
end
|
96
|
+
sh "git commit --allow-empty -a -m 'Release #{version}'"
|
97
|
+
sh "git tag v#{version}"
|
98
|
+
sh "git push origin master"
|
99
|
+
sh "git push origin v#{version}"
|
100
|
+
sh "gem push pkg/#{name}-#{version}.gem"
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "Build #{gem_file} into the pkg directory"
|
104
|
+
task :build => :gemspec do
|
105
|
+
sh "mkdir -p pkg"
|
106
|
+
sh "gem build #{gemspec_file}"
|
107
|
+
sh "mv #{gem_file} pkg"
|
108
|
+
end
|
109
|
+
|
110
|
+
desc "Generate #{gemspec_file}"
|
111
|
+
task :gemspec => :validate do
|
112
|
+
# read spec file and split out manifest section
|
113
|
+
spec = File.read(gemspec_file)
|
114
|
+
head, manifest, tail = spec.split(" # = MANIFEST =\n")
|
115
|
+
|
116
|
+
# replace name version and date
|
117
|
+
replace_header(head, :name)
|
118
|
+
replace_header(head, :version)
|
119
|
+
replace_header(head, :date)
|
120
|
+
#comment this out if your rubyforge_project has a different name
|
121
|
+
replace_header(head, :rubyforge_project)
|
122
|
+
|
123
|
+
# determine file list from git ls-files
|
124
|
+
files = `git ls-files`.
|
125
|
+
split("\n").
|
126
|
+
sort.
|
127
|
+
reject { |file| file =~ /^\./ }.
|
128
|
+
reject { |file| file =~ /^(rdoc|pkg)/ }.
|
129
|
+
map { |file| " #{file}" }.
|
130
|
+
join("\n")
|
131
|
+
|
132
|
+
# piece file back together and write
|
133
|
+
manifest = " s.files = %w[\n#{files}\n ]\n"
|
134
|
+
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
|
135
|
+
File.open(gemspec_file, 'w') { |io| io.write(spec) }
|
136
|
+
puts "Updated #{gemspec_file}"
|
137
|
+
end
|
138
|
+
|
139
|
+
desc "Validate #{gemspec_file}"
|
140
|
+
task :validate do
|
141
|
+
libfiles = Dir['lib/*'] - ["lib/#{name}.rb", "lib/#{name}"]
|
142
|
+
unless libfiles.empty?
|
143
|
+
puts "Directory `lib` should only contain a `#{name}.rb` file and `#{name}` dir."
|
144
|
+
exit!
|
145
|
+
end
|
146
|
+
unless Dir['VERSION*'].empty?
|
147
|
+
puts "A `VERSION` file at root level violates Gem best practices."
|
148
|
+
exit!
|
149
|
+
end
|
150
|
+
end
|
data/fresno.gemspec
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
## This is the rakegem gemspec template. Make sure you read and understand
|
2
|
+
## all of the comments. Some sections require modification, and others can
|
3
|
+
## be deleted if you don't need them. Once you understand the contents of
|
4
|
+
## this file, feel free to delete any comments that begin with two hash marks.
|
5
|
+
## You can find comprehensive Gem::Specification documentation, at
|
6
|
+
## http://docs.rubygems.org/read/chapter/20
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.specification_version = 2 if s.respond_to? :specification_version=
|
9
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
|
+
s.rubygems_version = '1.3.5'
|
11
|
+
s.platform = 'java'
|
12
|
+
|
13
|
+
## Leave these as is they will be modified for you by the rake gemspec task.
|
14
|
+
## If your rubyforge_project name is different, then edit it and comment out
|
15
|
+
## the sub! line in the Rakefile
|
16
|
+
s.name = 'fresno'
|
17
|
+
s.version = '0.0.3'
|
18
|
+
s.date = '2012-11-10'
|
19
|
+
s.rubyforge_project = 'fresno'
|
20
|
+
|
21
|
+
## Make sure your summary is short. The description may be as long
|
22
|
+
## as you like.
|
23
|
+
s.summary = "Framework for scripting FRC bots."
|
24
|
+
s.description = "Framework for scripting FRC bots with Mirah."
|
25
|
+
|
26
|
+
## List the primary authors. If there are a bunch of authors, it's probably
|
27
|
+
## better to set the email to an email list or something. If you don't have
|
28
|
+
## a custom homepage, consider using your GitHub URL or the like.
|
29
|
+
s.authors = ["Jeremy McAnally"]
|
30
|
+
s.email = 'jeremy@github.com'
|
31
|
+
s.homepage = 'http://github.com/jm/fresno'
|
32
|
+
|
33
|
+
## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
|
34
|
+
## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
|
35
|
+
s.require_paths = %w[lib]
|
36
|
+
|
37
|
+
## This sections is only necessary if you have C extensions.
|
38
|
+
# s.require_paths << 'ext'
|
39
|
+
# s.extensions = %w[ext/extconf.rb]
|
40
|
+
|
41
|
+
## If your gem includes any executables, list them here.
|
42
|
+
s.executables = ["fresno"]
|
43
|
+
|
44
|
+
## Specify any RDoc options here. You'll want to add your README and
|
45
|
+
## LICENSE files to the extra_rdoc_files list.
|
46
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
47
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
48
|
+
|
49
|
+
## List your runtime dependencies here. Runtime dependencies are those
|
50
|
+
## that are needed for an end user to actually USE your code.
|
51
|
+
s.add_dependency('mirah')
|
52
|
+
|
53
|
+
## List your development dependencies here. Development dependencies are
|
54
|
+
## those that are only needed during development
|
55
|
+
s.add_development_dependency('contest')
|
56
|
+
|
57
|
+
## Leave this section as-is. It will be automatically generated from the
|
58
|
+
## contents of your Git repository via the gemspec task. DO NOT REMOVE
|
59
|
+
## THE MANIFEST COMMENTS, they are used as delimiters by the task.
|
60
|
+
# = MANIFEST =
|
61
|
+
s.files = %w[
|
62
|
+
Gemfile
|
63
|
+
LICENSE
|
64
|
+
README.md
|
65
|
+
Rakefile
|
66
|
+
bin/fresno
|
67
|
+
fresno.gemspec
|
68
|
+
lib/fresno.rb
|
69
|
+
lib/fresno/app_generator.rb
|
70
|
+
lib/fresno/generator_data/BSD_FOR_WPILIB
|
71
|
+
lib/fresno/generator_data/MITLICENSE
|
72
|
+
lib/fresno/generator_data/README.md.template
|
73
|
+
lib/fresno/generator_data/build.properties.template
|
74
|
+
lib/fresno/generator_data/build.xml.template
|
75
|
+
lib/fresno/generator_data/command.mirah.template
|
76
|
+
lib/fresno/generator_data/gitignore.template
|
77
|
+
lib/fresno/generator_data/iterative.mirah.template
|
78
|
+
lib/fresno/generator_data/netbeans.template
|
79
|
+
lib/fresno/generator_data/simple.mirah.template
|
80
|
+
src/extensions/fields.mirah
|
81
|
+
src/fresno.mirah
|
82
|
+
]
|
83
|
+
# = MANIFEST =
|
84
|
+
|
85
|
+
## Test files will be grabbed from the file list. Make sure the path glob
|
86
|
+
## matches what you actually use.
|
87
|
+
s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
|
88
|
+
end
|
data/lib/fresno.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
module Fresno
|
4
|
+
class AppGenerator < Thor
|
5
|
+
include Thor::Actions
|
6
|
+
|
7
|
+
def self.source_root
|
8
|
+
@source_root ||= File.join(File.dirname(__FILE__), 'generator_data')
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(args=[], options={}, config={})
|
12
|
+
@args = args
|
13
|
+
@options = options
|
14
|
+
@config = config
|
15
|
+
end
|
16
|
+
|
17
|
+
no_tasks do
|
18
|
+
def generate(name)
|
19
|
+
@name = name
|
20
|
+
puts "Generating new project in `#{name}`..."
|
21
|
+
puts
|
22
|
+
|
23
|
+
# Where are these files going?
|
24
|
+
self.destination_root = File.join(Dir.pwd, name)
|
25
|
+
|
26
|
+
# Build files for Ant
|
27
|
+
template('build.xml.template', "build.xml")
|
28
|
+
template('build.properties.template', "build.properties")
|
29
|
+
|
30
|
+
# Which project template are we starting with?
|
31
|
+
robot_filename = "src/#{@name.capitalize}Robot.mirah"
|
32
|
+
if @options["command"]
|
33
|
+
template('command.mirah.template', robot_filename)
|
34
|
+
elsif @options["simple"]
|
35
|
+
template('simple.mirah.template', robot_filename)
|
36
|
+
else
|
37
|
+
template('iterative.mirah.template', robot_filename)
|
38
|
+
end
|
39
|
+
|
40
|
+
# IDE MADNESS
|
41
|
+
if @options["netbeans"]
|
42
|
+
template('netbeans.template', "netbeans/project.xml")
|
43
|
+
end
|
44
|
+
|
45
|
+
# Licenses!
|
46
|
+
copy_file "MITLICENSE", "LICENSE"
|
47
|
+
copy_file "BSD_FOR_WPILIB", "WPILIB_LICENSE"
|
48
|
+
|
49
|
+
# Git goodness
|
50
|
+
copy_file "gitignore.template", ".gitignore"
|
51
|
+
|
52
|
+
template('README.md.template', "README.md")
|
53
|
+
|
54
|
+
puts
|
55
|
+
puts "All done!"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
* Copyright (c) 2009 FIRST
|
2
|
+
* All rights reserved.
|
3
|
+
*
|
4
|
+
* Redistribution and use in source and binary forms, with or without
|
5
|
+
* modification, are permitted provided that the following conditions are met:
|
6
|
+
* * Redistributions of source code must retain the above copyright
|
7
|
+
* notice, this list of conditions and the following disclaimer.
|
8
|
+
* * Redistributions in binary form must reproduce the above copyright
|
9
|
+
* notice, this list of conditions and the following disclaimer in the
|
10
|
+
* documentation and/or other materials provided with the distribution.
|
11
|
+
* * Neither the name of the FIRST nor the
|
12
|
+
* names of its contributors may be used to endorse or promote products
|
13
|
+
* derived from this software without specific prior written permission.
|
14
|
+
*
|
15
|
+
* THIS SOFTWARE IS PROVIDED BY FIRST AND CONTRIBUTORS``AS IS'' AND ANY
|
16
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
17
|
+
* WARRANTIES OF MERCHANTABILITY NONINFRINGEMENT AND FITNESS FOR A PARTICULAR
|
18
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL FIRST OR CONTRIBUTORS BE LIABLE FOR
|
19
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
20
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
21
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
22
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
23
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
24
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) <%= Time.now.year %> [[YOUR NAME HERE!]]
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1 @@
|
|
1
|
+
user.classpath=${wpilibj.home}/src
|
@@ -0,0 +1,85 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
|
3
|
+
<!--
|
4
|
+
|
5
|
+
Some useful command line properties:
|
6
|
+
|
7
|
+
-Dbasestation.addr=1234 set the address of the basestation
|
8
|
+
-DremoteId=1234 set the target for remote run/deploy/debug-proxy-run
|
9
|
+
-Dsquawk.startup.class=com.example.MyStartUp
|
10
|
+
set an alternative startup class name
|
11
|
+
-Dspotport=COM2 set the port name for communicating with the SPOT
|
12
|
+
-Djar.file=example.jar set the jar file for jar-app, jar-deploy and make-host-jar
|
13
|
+
-Dmidlet=2 select a midlet to run for selectapplication
|
14
|
+
or deploy targets (defaults to 1)
|
15
|
+
-Dutility.jars=utils.jar a classpath separator delimited list of jars to be
|
16
|
+
included with the application
|
17
|
+
|
18
|
+
-->
|
19
|
+
|
20
|
+
<project basedir="." default="help" name="<%= @name.capitalize %>Project">
|
21
|
+
<!--
|
22
|
+
|
23
|
+
If you want to change your source directory, uncomment the
|
24
|
+
following:
|
25
|
+
|
26
|
+
<property name="src.dir" value="mysrc"/>
|
27
|
+
|
28
|
+
-->
|
29
|
+
|
30
|
+
<property name="user.properties.file" value="build.properties"/>
|
31
|
+
<property file="${user.home}/.sunspotfrc.properties"/>
|
32
|
+
|
33
|
+
<!--
|
34
|
+
|
35
|
+
This setup requires the master Sun SPOT build file, but if you
|
36
|
+
don't have the property file set for some reason, you can use
|
37
|
+
the following property to specify it explicitly:
|
38
|
+
|
39
|
+
<property name="sunspot.home" value="/opt/sunspot"/>
|
40
|
+
|
41
|
+
-->
|
42
|
+
|
43
|
+
<import file="${sunspot.home}/build.xml"/>
|
44
|
+
|
45
|
+
<!--
|
46
|
+
|
47
|
+
This file imports the master build file for compiling and deploying sunspot
|
48
|
+
applications. This file provides hooks for the user build file, so that
|
49
|
+
you can accomplish almost anything without having to rewrite any of the
|
50
|
+
build procedures. However, if need be, you can just look at the imported
|
51
|
+
build file to determine how exactly any step is accomplished.
|
52
|
+
|
53
|
+
There exist several targets which are by default empty and which can be
|
54
|
+
used for execution of your tasks. These targets are usually executed
|
55
|
+
before and after some main targets. They are defined as follows:
|
56
|
+
|
57
|
+
For each target above (except help),
|
58
|
+
|
59
|
+
-pre-<target>: called before the target
|
60
|
+
-post-<target>: called after the target
|
61
|
+
|
62
|
+
For example, inserting an echo statement after compilation could look like this:
|
63
|
+
|
64
|
+
<target name="-post-compile">
|
65
|
+
<echo>Compile finished!</echo>
|
66
|
+
</target>
|
67
|
+
|
68
|
+
For more information on using ant, see http://ant.apache.org.
|
69
|
+
|
70
|
+
-->
|
71
|
+
|
72
|
+
<!--
|
73
|
+
|
74
|
+
Compile the Mirah files down to Java.
|
75
|
+
|
76
|
+
-->
|
77
|
+
<target name="-pre-compile">
|
78
|
+
<exec executable="mirahc" dir="src">
|
79
|
+
<arg value="--java" />
|
80
|
+
<arg line="--classpath ${sunspot.classpath}:${sunspot.bootclasspath}" />
|
81
|
+
<arg value="." />
|
82
|
+
</exec>
|
83
|
+
</target>
|
84
|
+
|
85
|
+
</project>
|
@@ -0,0 +1 @@
|
|
1
|
+
# TODO
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#
|
2
|
+
# <%= @name.capitalize %>Robot
|
3
|
+
# Iterative robot class
|
4
|
+
#
|
5
|
+
# Based on IterativeRobotTemplate that is
|
6
|
+
# Copyright (c) FIRST 2008. All Rights Reserved.
|
7
|
+
#
|
8
|
+
package org.fresnoframework.<%= @name.downcase %>
|
9
|
+
|
10
|
+
import edu.wpi.first.wpilibj.IterativeRobot
|
11
|
+
|
12
|
+
class <%= @name.capitalize %>Robot < IterativeRobot
|
13
|
+
def robotInit:void
|
14
|
+
end
|
15
|
+
|
16
|
+
# Called periodically during autonomous control
|
17
|
+
def autonomousPeriodic:void
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
# Called periodically during operator control
|
22
|
+
def teleopPeriodic:void
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
|
4
|
+
This is a sample netbeans project file for a Sun Spot Application project.
|
5
|
+
You may edit it freely, it doesn't affect the ant-powered build.
|
6
|
+
|
7
|
+
-->
|
8
|
+
|
9
|
+
<project xmlns="http://www.netbeans.org/ns/project/1">
|
10
|
+
|
11
|
+
<type>org.netbeans.modules.ant.freeform</type>
|
12
|
+
<configuration>
|
13
|
+
<general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
|
14
|
+
<name><%= @name.capitalize %>RobotProject</name>
|
15
|
+
<properties>
|
16
|
+
<property-file>${user.home}/.sunspotfrc.properties</property-file>
|
17
|
+
<property-file>build.properties</property-file>
|
18
|
+
<property-file>${sunspot.home}/default.properties</property-file>
|
19
|
+
</properties>
|
20
|
+
<folders>
|
21
|
+
<source-folder>
|
22
|
+
<label>src</label>
|
23
|
+
<type>java</type>
|
24
|
+
<location>src</location>
|
25
|
+
</source-folder>
|
26
|
+
</folders>
|
27
|
+
<ide-actions>
|
28
|
+
<action name="build">
|
29
|
+
<target>jar-app</target>
|
30
|
+
</action>
|
31
|
+
<action name="clean">
|
32
|
+
<target>clean</target>
|
33
|
+
</action>
|
34
|
+
<action name="run">
|
35
|
+
<target>deploy</target>
|
36
|
+
<target>run</target>
|
37
|
+
</action>
|
38
|
+
<action name="rebuild">
|
39
|
+
<target>clean</target>
|
40
|
+
<target>jar-app</target>
|
41
|
+
</action>
|
42
|
+
<action name="debug">
|
43
|
+
<target>deploy</target>
|
44
|
+
<target>debug-run</target>
|
45
|
+
</action>
|
46
|
+
<action name="javadoc">
|
47
|
+
<target>javadoc</target>
|
48
|
+
</action>
|
49
|
+
</ide-actions>
|
50
|
+
<export>
|
51
|
+
<type>folder</type>
|
52
|
+
<location>build</location>
|
53
|
+
<build-target>jar-app</build-target>
|
54
|
+
</export>
|
55
|
+
<view>
|
56
|
+
<items>
|
57
|
+
<source-folder style="packages">
|
58
|
+
<label>src</label>
|
59
|
+
<location>src</location>
|
60
|
+
</source-folder>
|
61
|
+
<source-file>
|
62
|
+
<location>build.xml</location>
|
63
|
+
</source-file>
|
64
|
+
</items>
|
65
|
+
<context-menu>
|
66
|
+
<ide-action name="build"/>
|
67
|
+
<ide-action name="clean"/>
|
68
|
+
<ide-action name="run"/>
|
69
|
+
<ide-action name="rebuild"/>
|
70
|
+
<ide-action name="debug"/>
|
71
|
+
<ide-action name="javadoc"/>
|
72
|
+
<action>
|
73
|
+
<label>Sun SPOT-deploy</label>
|
74
|
+
<target>deploy</target>
|
75
|
+
</action>
|
76
|
+
<action>
|
77
|
+
<label>Sun SPOT-jar-deploy</label>
|
78
|
+
<target>jar-deploy</target>
|
79
|
+
</action>
|
80
|
+
<separator/>
|
81
|
+
</context-menu>
|
82
|
+
</view>
|
83
|
+
<subprojects/>
|
84
|
+
</general-data>
|
85
|
+
<java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/1">
|
86
|
+
<compilation-unit>
|
87
|
+
<package-root>src</package-root>
|
88
|
+
<classpath mode="boot">${sunspot.bootclasspath}</classpath>
|
89
|
+
<classpath mode="compile">${wpilibj.home}/classes.jar</classpath>
|
90
|
+
<built-to>build</built-to>
|
91
|
+
<source-level>1.4</source-level>
|
92
|
+
</compilation-unit>
|
93
|
+
</java-data>
|
94
|
+
</configuration>
|
95
|
+
</project>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
# <%= @name.capitalize %>Robot
|
3
|
+
# Simple robot class
|
4
|
+
#
|
5
|
+
# Based on SimpleRobotTemplate that is
|
6
|
+
# Copyright (c) FIRST 2008. All Rights Reserved.
|
7
|
+
#
|
8
|
+
package org.fresnoframework.<%= @name.downcase %>
|
9
|
+
|
10
|
+
import edu.wpi.first.wpilibj.SimpleRobot
|
11
|
+
|
12
|
+
class <%= @name.capitalize %>Robot < SimpleRobot
|
13
|
+
# Called when the robot enters autonomous controller
|
14
|
+
def autonomous:void
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
# Called when the robot enters operator control
|
19
|
+
def operatorControl:void
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
package org.fresnoframework.extensions.fields
|
2
|
+
|
3
|
+
# Add the ability to have fields a la attr_accessor in Ruby
|
4
|
+
# Implementation based on: http://www.mirah.org/wiki/Macros
|
5
|
+
#
|
6
|
+
# class Robot
|
7
|
+
# implements Fields
|
8
|
+
#
|
9
|
+
# field :name, :string
|
10
|
+
# field :team, :int
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# r = Robot.new
|
14
|
+
# r.name = "Mr. Awesometron 9000"
|
15
|
+
# puts r
|
16
|
+
# # => "Mr. Awesometron 9000"
|
17
|
+
#
|
18
|
+
interface Fields do
|
19
|
+
macro def field(name_node, type)
|
20
|
+
name = name_node.string_value
|
21
|
+
|
22
|
+
quote do
|
23
|
+
def `name`
|
24
|
+
@`name`
|
25
|
+
end
|
26
|
+
|
27
|
+
def `"#{name}_set"`(value:`type`)
|
28
|
+
@`name` = value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/src/fresno.mirah
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# TODO: Start adding convenience classes
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: fresno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- Jeremy McAnally
|
@@ -45,9 +45,26 @@ extra_rdoc_files:
|
|
45
45
|
- README.md
|
46
46
|
- LICENSE
|
47
47
|
files:
|
48
|
-
-
|
49
|
-
- README.md
|
48
|
+
- Gemfile
|
50
49
|
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- bin/fresno
|
53
|
+
- fresno.gemspec
|
54
|
+
- lib/fresno.rb
|
55
|
+
- lib/fresno/app_generator.rb
|
56
|
+
- lib/fresno/generator_data/BSD_FOR_WPILIB
|
57
|
+
- lib/fresno/generator_data/MITLICENSE
|
58
|
+
- lib/fresno/generator_data/README.md.template
|
59
|
+
- lib/fresno/generator_data/build.properties.template
|
60
|
+
- lib/fresno/generator_data/build.xml.template
|
61
|
+
- lib/fresno/generator_data/command.mirah.template
|
62
|
+
- lib/fresno/generator_data/gitignore.template
|
63
|
+
- lib/fresno/generator_data/iterative.mirah.template
|
64
|
+
- lib/fresno/generator_data/netbeans.template
|
65
|
+
- lib/fresno/generator_data/simple.mirah.template
|
66
|
+
- src/extensions/fields.mirah
|
67
|
+
- src/fresno.mirah
|
51
68
|
has_rdoc: true
|
52
69
|
homepage: http://github.com/jm/fresno
|
53
70
|
licenses: []
|