Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dart.googlesource.com-stagehand
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fuchsia-mirror
dart.googlesource.com-stagehand
Commits
82473084
Commit
82473084
authored
10 years ago
by
Seth Ladd
Browse files
Options
Downloads
Patches
Plain Diff
move shared files up to superclass
parent
472099fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/generators/helloworld.dart
+3
-7
3 additions, 7 deletions
lib/generators/helloworld.dart
lib/generators/webapp.dart
+5
-10
5 additions, 10 deletions
lib/generators/webapp.dart
lib/stagehand.dart
+8
-2
8 additions, 2 deletions
lib/stagehand.dart
with
16 additions
and
19 deletions
lib/generators/helloworld.dart
+
3
−
7
View file @
82473084
...
...
@@ -16,11 +16,9 @@ class HelloWorldGenerator extends Generator {
"A simple hello world command-line application."
,
categories:
const
[
'dart'
,
'helloworld'
])
{
_addFile
(
'.gitignore'
,
gitIgnoreContents
);
_addFile
(
'pubspec.yaml'
,
_pubspec
);
_addFile
(
'readme.md'
,
_readme
);
_addFile
(
'bin/helloworld.dart'
,
_helloworld
);
_addFile
(
'LICENSE'
,
license
);
addFile
(
'pubspec.yaml'
,
_pubspec
);
addFile
(
'readme.md'
,
_readme
);
addFile
(
'bin/helloworld.dart'
,
_helloworld
);
setEntrypoint
(
files
.
last
);
}
...
...
@@ -45,6 +43,4 @@ main() {
}
'''
;
TemplateFile
_addFile
(
String
path
,
String
contents
)
=
>
addFile
(
new
TemplateFile
(
path
,
contents
));
}
This diff is collapsed.
Click to expand it.
lib/generators/webapp.dart
+
5
−
10
View file @
82473084
...
...
@@ -17,18 +17,13 @@ class WebAppGenerator extends Generator {
"too much going on."
,
categories:
const
[
'dart'
,
'web'
])
{
_addFile
(
'.gitignore'
,
gitIgnoreContents
);
_addFile
(
'pubspec.yaml'
,
_pubspec
);
_addFile
(
'readme.md'
,
_readme
);
_addFile
(
'web/styles.css'
,
_styles
);
setEntrypoint
(
_addFile
(
'web/index.html'
,
_index
));
_addFile
(
'web/main.dart'
,
_main
);
_addFile
(
'LICENSE'
,
license
);
addFile
(
'pubspec.yaml'
,
_pubspec
);
addFile
(
'readme.md'
,
_readme
);
addFile
(
'web/styles.css'
,
_styles
);
setEntrypoint
(
addFile
(
'web/index.html'
,
_index
));
addFile
(
'web/main.dart'
,
_main
);
}
TemplateFile
_addFile
(
String
path
,
String
contents
)
=
>
addFile
(
new
TemplateFile
(
path
,
contents
));
String
get
_pubspec
=
>
'''
name: {{projectName}}
description: >
...
...
This diff is collapsed.
Click to expand it.
lib/stagehand.dart
+
8
−
2
View file @
82473084
...
...
@@ -38,7 +38,10 @@ abstract class Generator {
final
List
<
TemplateFile
>
files
=
[];
TemplateFile
_entrypoint
;
Generator
(
this
.
id
,
this
.
description
,
{
this
.
categories
:
const
[]});
Generator
(
this
.
id
,
this
.
description
,
{
this
.
categories
:
const
[]})
{
addFile
(
'.gitignore'
,
gitIgnoreContents
);
addFile
(
'LICENSE'
,
license
);
}
/**
* The entrypoint of the application; the main file for the project, which an
...
...
@@ -49,7 +52,7 @@ abstract class Generator {
/**
* TODO:
*/
TemplateFile
addFile
(
TemplateFile
file
)
{
TemplateFile
add
Template
File
(
TemplateFile
file
)
{
files
.
add
(
file
);
return
file
;
}
...
...
@@ -73,6 +76,9 @@ abstract class Generator {
int
numFiles
()
=
>
files
.
length
;
String
toString
()
=
>
'[
${id}
:
${description}
]'
;
TemplateFile
addFile
(
String
path
,
String
contents
)
=
>
addTemplateFile
(
new
TemplateFile
(
path
,
contents
));
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment