sprout-mxml-bundle 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +0 -0
- data/lib/sprout/generators/project/project_generator.rb +29 -0
- data/lib/sprout/generators/project/templates/MainClass.mxml +20 -0
- data/lib/sprout/generators/project/templates/MainStyle.css +4 -0
- data/lib/sprout/generators/project/templates/ProjectSprouts.png +0 -0
- data/lib/sprout/generators/project/templates/README.txt +56 -0
- data/lib/sprout/generators/project/templates/TestRunner.mxml +18 -0
- data/lib/sprout/generators/project/templates/generate +21 -0
- data/lib/sprout/generators/project/templates/rakefile.rb +92 -0
- data/lib/sprout/mxml/version.rb +12 -0
- data/lib/sprout/mxml.rb +6 -0
- data/rakefile.rb +56 -0
- metadata +97 -0
data/README
ADDED
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
class ProjectGenerator < Sprout::Generator::NamedBase # :nodoc:
|
3
|
+
|
4
|
+
def manifest
|
5
|
+
record do |m|
|
6
|
+
base = class_name
|
7
|
+
m.directory base
|
8
|
+
m.directory File.join(base, 'assets/skins', project_name)
|
9
|
+
m.directory File.join(base, 'bin')
|
10
|
+
m.directory File.join(base, 'css')
|
11
|
+
m.directory File.join(base, 'skins/default')
|
12
|
+
m.directory File.join(base, 'lib')
|
13
|
+
m.directory File.join(base, 'script')
|
14
|
+
m.directory File.join(base, 'src')
|
15
|
+
m.directory File.join(base, 'test')
|
16
|
+
|
17
|
+
m.file 'ProjectSprouts.png', File.join(base, 'assets/skins', project_name, 'ProjectSprouts.png')
|
18
|
+
m.template 'rakefile.rb', File.join(base, "rakefile.rb")
|
19
|
+
m.template 'README.txt', File.join(base, "README.txt")
|
20
|
+
|
21
|
+
m.template 'generate', File.join(base, 'script', "generate"), :chmod => 0755
|
22
|
+
|
23
|
+
m.template 'MainStyle.css', File.join(base, 'css', "#{class_name}.css")
|
24
|
+
m.template 'MainClass.mxml', File.join(base, 'src', "#{class_name}.mxml")
|
25
|
+
m.template 'TestRunner.mxml', File.join(base, 'src', "#{class_name}Runner.mxml")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<mx:Application
|
3
|
+
xmlns:mx="http://www.adobe.com/2006/mxml"
|
4
|
+
backgroundImage=""
|
5
|
+
backgroundColor="#FFFFFF"
|
6
|
+
creationComplete="creationCompleteHandler(event)"
|
7
|
+
>
|
8
|
+
<mx:Script>
|
9
|
+
<![CDATA[
|
10
|
+
|
11
|
+
private function creationCompleteHandler(event:Event):void {
|
12
|
+
trace(">> CreationComplete");
|
13
|
+
}
|
14
|
+
]]>
|
15
|
+
</mx:Script>
|
16
|
+
|
17
|
+
<!-- Import StyleSheet -->
|
18
|
+
<mx:Style source="../css/<%= project_name %>.css" />
|
19
|
+
<mx:Container styleName="SproutLogo" width="100%" height="100%" />
|
20
|
+
</mx:Application>
|
Binary file
|
@@ -0,0 +1,56 @@
|
|
1
|
+
|
2
|
+
########################################
|
3
|
+
This project was generated using Sprouts
|
4
|
+
http://code.google.com/p/projectsprouts/
|
5
|
+
|
6
|
+
Please report any bugs to:
|
7
|
+
http://code.google.com/p/projectsprouts/issues/list
|
8
|
+
|
9
|
+
Please feel free to ask questions at:
|
10
|
+
http://groups.google.com/group/projectsprouts
|
11
|
+
|
12
|
+
########################################
|
13
|
+
Using your favorite terminal, cd to this directory have fun!
|
14
|
+
|
15
|
+
########################################
|
16
|
+
To create a new ActionScript class, TestCase and rebuild all project TestSuites:
|
17
|
+
|
18
|
+
script/generate class -s utils.MathUtil
|
19
|
+
|
20
|
+
########################################
|
21
|
+
To create a new Interface begin the name with I + Capital letter (eg: ISomeName)
|
22
|
+
or end the name with 'able'
|
23
|
+
|
24
|
+
Name begins with Capital 'I' followed by another capital letter
|
25
|
+
script/generate class utils.ISomeName
|
26
|
+
|
27
|
+
or
|
28
|
+
|
29
|
+
Name ends with 'able'
|
30
|
+
script/generate class utils.Observable
|
31
|
+
|
32
|
+
or
|
33
|
+
|
34
|
+
Explicitly identify interface creation
|
35
|
+
script/generate interface utils.SomeInterface
|
36
|
+
|
37
|
+
########################################
|
38
|
+
To create a new TestCase only, enter the following:
|
39
|
+
|
40
|
+
script/generate test utils.SomeTest
|
41
|
+
|
42
|
+
########################################
|
43
|
+
To compile and launch your application:
|
44
|
+
|
45
|
+
rake
|
46
|
+
|
47
|
+
########################################
|
48
|
+
To compile and launch your test suites:
|
49
|
+
|
50
|
+
rake test
|
51
|
+
|
52
|
+
########################################
|
53
|
+
To see all available rake tasks:
|
54
|
+
|
55
|
+
rake -T
|
56
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<FlexRunner
|
3
|
+
xmlns="asunit.textui.*"
|
4
|
+
xmlns:mx="http://www.adobe.com/2006/mxml"
|
5
|
+
creationComplete="runTests()"
|
6
|
+
>
|
7
|
+
<!-- Import Application Styles -->
|
8
|
+
<mx:Style source="../css/<%= project_name %>.css" />
|
9
|
+
<mx:Script>
|
10
|
+
<![CDATA[
|
11
|
+
import asunit.textui.TestRunner;
|
12
|
+
|
13
|
+
public function runTests():void {
|
14
|
+
start(AllTests, null, TestRunner.SHOW_TRACE);
|
15
|
+
}
|
16
|
+
]]>
|
17
|
+
</mx:Script>
|
18
|
+
</FlexRunner>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'sprout'
|
4
|
+
sprout 'sprout-as3-bundle'
|
5
|
+
|
6
|
+
# Add a class name if TestSuites were generated
|
7
|
+
if(ARGV.size == 1 && ARGV[0] == 'suite')
|
8
|
+
ARGV << 'AllTests'
|
9
|
+
end
|
10
|
+
|
11
|
+
# Insert class type by default
|
12
|
+
if(ARGV.size == 1)
|
13
|
+
ARGV.unshift('class')
|
14
|
+
end
|
15
|
+
|
16
|
+
# Execute generators like this:
|
17
|
+
# script/generate class utils.MathUtil
|
18
|
+
# script/generate suite
|
19
|
+
# script/generate test utils.MathUtilTest
|
20
|
+
|
21
|
+
Sprout::Sprout.generate('as3', ARGV.shift, ARGV, File.dirname(File.dirname(__FILE__)))
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require 'sprout'
|
2
|
+
# Optionally load gems from the leading edge:
|
3
|
+
# set_sources 'http://gems.projectsprouts.org'
|
4
|
+
sprout 'as3'
|
5
|
+
|
6
|
+
############################################
|
7
|
+
# Uncomment and modify any of the following:
|
8
|
+
Sprout::ProjectModel.setup do |model|
|
9
|
+
model.project_name = '<%= project_name %>'
|
10
|
+
# Default Values:
|
11
|
+
# model.src_dir = 'src'
|
12
|
+
# model.lib_dir = 'lib'
|
13
|
+
# model.swc_dir = 'lib'
|
14
|
+
# model.bin_dir = 'bin'
|
15
|
+
# model.test_dir = 'test'
|
16
|
+
# model.asset_dir = 'assets'
|
17
|
+
model.language = 'as3'
|
18
|
+
model.output = "#{model.bin_dir}/<%= project_name %>.swf"
|
19
|
+
model.test_output = "#{model.bin_dir}/<%= project_name %>Runner.swf"
|
20
|
+
end
|
21
|
+
|
22
|
+
model = Sprout::ProjectModel.instance
|
23
|
+
|
24
|
+
############################################
|
25
|
+
# Set up remote library tasks
|
26
|
+
# the task name will be converted to a string
|
27
|
+
# and modified as follows sprout-#{name}-library
|
28
|
+
# unless you pass t.gem_name = 'full-sprout-name'
|
29
|
+
# For libraries that contain source code, the
|
30
|
+
# task name will also be the folder name that
|
31
|
+
# will be added to ProjectModel.lib_dir
|
32
|
+
# For a complete list of available sprout gems:
|
33
|
+
# http://rubyforge.org/frs/?group_id=3688
|
34
|
+
# You can also search that list directly from a
|
35
|
+
# terminal as follows:
|
36
|
+
# gem search -r sprout-*library
|
37
|
+
|
38
|
+
library :asunit3
|
39
|
+
library :corelib
|
40
|
+
|
41
|
+
############################################
|
42
|
+
# Launch the application using the Flash Player
|
43
|
+
# NOTE: double-quoted strings in ruby enable
|
44
|
+
# runtime expression evaluation using the
|
45
|
+
# following syntax:
|
46
|
+
# "Some String with: #{variable}"
|
47
|
+
|
48
|
+
desc "Compile and run main application"
|
49
|
+
flashplayer :run => model.output
|
50
|
+
|
51
|
+
# Make 'run' the default task
|
52
|
+
task :default => :run
|
53
|
+
|
54
|
+
############################################
|
55
|
+
# Launch the test suites using the Flash Player
|
56
|
+
|
57
|
+
desc "Compile and run test suites"
|
58
|
+
flashplayer :test => model.test_output
|
59
|
+
|
60
|
+
############################################
|
61
|
+
# Compile your application using mxmlc
|
62
|
+
# Any library tasks that are set as
|
63
|
+
# dependencies will automatically be added
|
64
|
+
# to the compiler source or swc paths
|
65
|
+
|
66
|
+
desc "Compile application"
|
67
|
+
mxmlc model.output => :corelib do |t|
|
68
|
+
t.warnings = true
|
69
|
+
t.default_background_color = 0xFFFFFF
|
70
|
+
t.default_frame_rate = 24
|
71
|
+
t.default_size = '600 400'
|
72
|
+
t.input = "#{model.src_dir}/<%= project_name %>.mxml"
|
73
|
+
t.source_path << model.asset_dir
|
74
|
+
# t.source_path << "#{model.lib_dir}/non-sprout-src-library"
|
75
|
+
# t.library_path << "#{model.lib_dir}/non-sprout.swc"
|
76
|
+
end
|
77
|
+
|
78
|
+
############################################
|
79
|
+
# Compile test harness using mxmlc
|
80
|
+
|
81
|
+
desc "Compile test harness"
|
82
|
+
mxmlc model.test_output => [:asunit3, :corelib] do |t|
|
83
|
+
t.warnings = true
|
84
|
+
t.default_background_color = '#FFFFFF'
|
85
|
+
t.default_frame_rate = 24
|
86
|
+
t.verbose_stacktraces = true
|
87
|
+
t.default_size = "800 450"
|
88
|
+
t.input = "#{model.src_dir}/<%= project_name %>Runner.mxml"
|
89
|
+
t.source_path << model.src_dir
|
90
|
+
t.source_path << model.test_dir
|
91
|
+
t.source_path << model.asset_dir
|
92
|
+
end
|
data/lib/sprout/mxml.rb
ADDED
data/rakefile.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'rake/gempackagetask'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'lib/sprout/mxml/version'
|
5
|
+
|
6
|
+
SPROUT_HOME = ENV['SPROUT_HOME']
|
7
|
+
PROJECT = 'sprout'
|
8
|
+
NAME = 'sprout-mxml-bundle'
|
9
|
+
SUMMARY = 'Project and Code Generators for Flex Development'
|
10
|
+
GEM_VERSION = Sprout::MXML::VERSION::STRING
|
11
|
+
AUTHOR = 'Pattern Park'
|
12
|
+
EMAIL = 'projectsprouts@googlegroups.com'
|
13
|
+
HOMEPAGE = 'http://www.projectsprouts.org'
|
14
|
+
DESCRIPTION = "Code Generation and Rake Tasks for MXML Development"
|
15
|
+
HOMEPATH = "http://#{PROJECT}.rubyforge.org"
|
16
|
+
RELEASE_TYPES = ["gem"]
|
17
|
+
|
18
|
+
require File.join(SPROUT_HOME, 'sprout/script/build_helpers')
|
19
|
+
|
20
|
+
PKG_LIST = FileList['[a-zA-Z]*',
|
21
|
+
'lib/**/*'
|
22
|
+
]
|
23
|
+
|
24
|
+
PKG_LIST.exclude('.svn')
|
25
|
+
PKG_LIST.exclude('artifacts')
|
26
|
+
PKG_LIST.each do |file|
|
27
|
+
task :package => file
|
28
|
+
end
|
29
|
+
|
30
|
+
spec = Gem::Specification.new do |s|
|
31
|
+
s.platform = Gem::Platform::RUBY
|
32
|
+
s.summary = SUMMARY
|
33
|
+
s.description = DESCRIPTION
|
34
|
+
s.name = NAME
|
35
|
+
s.version = GEM_VERSION
|
36
|
+
s.author = AUTHOR
|
37
|
+
s.email = EMAIL
|
38
|
+
s.homepage = HOMEPAGE
|
39
|
+
s.rubyforge_project = PROJECT
|
40
|
+
s.require_path = 'lib'
|
41
|
+
s.autorequire = 'sprout/mxml'
|
42
|
+
s.has_rdoc = true
|
43
|
+
s.extra_rdoc_files = %w( README )
|
44
|
+
s.rdoc_options << '--main' << 'README'
|
45
|
+
s.rdoc_options << '--title' << DESCRIPTION
|
46
|
+
s.rdoc_options << '--line-numbers' << '--inline-source'
|
47
|
+
s.rdoc_options << '--charset' << 'utf-8'
|
48
|
+
s.rdoc_options << '-i' << '.'
|
49
|
+
s.files = PKG_LIST.to_a
|
50
|
+
|
51
|
+
s.add_dependency('sprout', '>= 0.7.158')
|
52
|
+
s.add_dependency('sprout-as3-bundle')
|
53
|
+
end
|
54
|
+
|
55
|
+
Rake::GemPackageTask.new(spec) do |p|
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sprout-mxml-bundle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pattern Park
|
8
|
+
autorequire: sprout/mxml
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-02-18 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sprout
|
17
|
+
version_requirement:
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.7.158
|
23
|
+
version:
|
24
|
+
- !ruby/object:Gem::Dependency
|
25
|
+
name: sprout-as3-bundle
|
26
|
+
version_requirement:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: "0"
|
32
|
+
version:
|
33
|
+
description: Code Generation and Rake Tasks for MXML Development
|
34
|
+
email: projectsprouts@googlegroups.com
|
35
|
+
executables: []
|
36
|
+
|
37
|
+
extensions: []
|
38
|
+
|
39
|
+
extra_rdoc_files:
|
40
|
+
- README
|
41
|
+
files:
|
42
|
+
- lib
|
43
|
+
- rakefile.rb
|
44
|
+
- README
|
45
|
+
- test
|
46
|
+
- lib/sprout
|
47
|
+
- lib/sprout/generators
|
48
|
+
- lib/sprout/generators/project
|
49
|
+
- lib/sprout/generators/project/project_generator.rb
|
50
|
+
- lib/sprout/generators/project/templates
|
51
|
+
- lib/sprout/generators/project/templates/generate
|
52
|
+
- lib/sprout/generators/project/templates/MainClass.mxml
|
53
|
+
- lib/sprout/generators/project/templates/MainStyle.css
|
54
|
+
- lib/sprout/generators/project/templates/ProjectSprouts.png
|
55
|
+
- lib/sprout/generators/project/templates/rakefile.rb
|
56
|
+
- lib/sprout/generators/project/templates/README.txt
|
57
|
+
- lib/sprout/generators/project/templates/TestRunner.mxml
|
58
|
+
- lib/sprout/mxml
|
59
|
+
- lib/sprout/mxml/version.rb
|
60
|
+
- lib/sprout/mxml.rb
|
61
|
+
has_rdoc: true
|
62
|
+
homepage: http://www.projectsprouts.org
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options:
|
65
|
+
- --main
|
66
|
+
- README
|
67
|
+
- --title
|
68
|
+
- Code Generation and Rake Tasks for MXML Development
|
69
|
+
- --line-numbers
|
70
|
+
- --inline-source
|
71
|
+
- --charset
|
72
|
+
- utf-8
|
73
|
+
- -i
|
74
|
+
- .
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: "0"
|
82
|
+
version:
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: "0"
|
88
|
+
version:
|
89
|
+
requirements: []
|
90
|
+
|
91
|
+
rubyforge_project: sprout
|
92
|
+
rubygems_version: 1.0.1
|
93
|
+
signing_key:
|
94
|
+
specification_version: 2
|
95
|
+
summary: Project and Code Generators for Flex Development
|
96
|
+
test_files: []
|
97
|
+
|