feat: add cli sample
This commit is contained in:
9
cli_sample/.gitignore
vendored
Normal file
9
cli_sample/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Files and directories created by pub
|
||||||
|
.dart_tool/
|
||||||
|
.packages
|
||||||
|
|
||||||
|
# Conventional directory for build outputs
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Directory created by dartdoc
|
||||||
|
doc/api/
|
||||||
3
cli_sample/CHANGELOG.md
Normal file
3
cli_sample/CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## 1.0.0
|
||||||
|
|
||||||
|
- Initial version, created by Stagehand
|
||||||
5
cli_sample/README.md
Normal file
5
cli_sample/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
A sample command-line application with an entrypoint in `bin/`, library code
|
||||||
|
in `lib/`, and example unit test in `test/`.
|
||||||
|
|
||||||
|
Created from templates made available by Stagehand under a BSD-style
|
||||||
|
[license](https://github.com/dart-lang/stagehand/blob/master/LICENSE).
|
||||||
14
cli_sample/analysis_options.yaml
Normal file
14
cli_sample/analysis_options.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Defines a default set of lint rules enforced for
|
||||||
|
# projects at Google. For details and rationale,
|
||||||
|
# see https://github.com/dart-lang/pedantic#enabled-lints.
|
||||||
|
include: package:pedantic/analysis_options.yaml
|
||||||
|
|
||||||
|
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
|
||||||
|
# Uncomment to specify additional rules.
|
||||||
|
# linter:
|
||||||
|
# rules:
|
||||||
|
# - camel_case_types
|
||||||
|
|
||||||
|
analyzer:
|
||||||
|
# exclude:
|
||||||
|
# - path/to/excluded/files/**
|
||||||
5
cli_sample/bin/cli_sample.dart
Normal file
5
cli_sample/bin/cli_sample.dart
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import 'package:cli_sample/cli_sample.dart' as cli_sample;
|
||||||
|
|
||||||
|
void main(List<String> arguments) {
|
||||||
|
print('Hello world: ${cli_sample.calculate()}!');
|
||||||
|
}
|
||||||
3
cli_sample/lib/cli_sample.dart
Normal file
3
cli_sample/lib/cli_sample.dart
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
int calculate() {
|
||||||
|
return 6 * 7;
|
||||||
|
}
|
||||||
14
cli_sample/pubspec.yaml
Normal file
14
cli_sample/pubspec.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
name: cli_sample
|
||||||
|
description: A sample command-line application.
|
||||||
|
# version: 1.0.0
|
||||||
|
# homepage: https://www.example.com
|
||||||
|
|
||||||
|
environment:
|
||||||
|
sdk: '>=2.8.1 <3.0.0'
|
||||||
|
|
||||||
|
#dependencies:
|
||||||
|
# path: ^1.7.0
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
pedantic: ^1.9.0
|
||||||
|
test: ^1.14.4
|
||||||
8
cli_sample/test/cli_sample_test.dart
Normal file
8
cli_sample/test/cli_sample_test.dart
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import 'package:cli_sample/cli_sample.dart';
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
test('calculate', () {
|
||||||
|
expect(calculate(), 42);
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user