Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e50ebfc6
Unverified
Commit
e50ebfc6
authored
Feb 27, 2019
by
Jonah Williams
Committed by
GitHub
Feb 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove personal repo and replace with trivial example for smoke test (#28386)
parent
dd5559a5
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
73 additions
and
117 deletions
+73
-117
coffee_app.dart
dev/integration_tests/codegen/lib/coffee_app.dart
+0
-58
main.dart
dev/integration_tests/codegen/lib/main.dart
+2
-8
message.spec
dev/integration_tests/codegen/lib/message.spec
+1
-0
coffee.dart
dev/integration_tests/codegen/lib/src/coffee.dart
+0
-41
pubspec.yaml
dev/integration_tests/codegen/pubspec.yaml
+3
-10
main_test.dart
dev/integration_tests/codegen/test_driver/main_test.dart
+4
-0
build.yaml
dev/integration_tests/simple_codegen/build.yaml
+8
-0
builders.dart
dev/integration_tests/simple_codegen/lib/builders.dart
+18
-0
pubspec.yaml
dev/integration_tests/simple_codegen/pubspec.yaml
+37
-0
No files found.
dev/integration_tests/codegen/lib/coffee_app.dart
deleted
100644 → 0
View file @
dd5559a5
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:inject/inject.dart'
;
// This is a compile-time generated file and does not exist in source.
import
'coffee_app.inject.dart'
as
generated
;
// ignore: uri_does_not_exist
import
'src/coffee.dart'
;
@module
class
PourOverCoffeeModule
{
@provide
@brandName
String
provideBrand
()
=>
'Coffee by Flutter Inc.'
;
@provide
@modelName
String
provideModel
()
=>
'PourOverSupremeFiesta'
;
@provide
@asynchronous
Future
<
Heater
>
provideHeater
()
async
=>
Stove
();
@provide
Pump
providePump
(
Heater
heater
)
=>
NoOpPump
();
}
class
NoOpPump
extends
Pump
{
@override
void
pump
()
{
print
(
'nothing to pump...'
);
}
}
class
Stove
extends
Heater
{
@override
bool
get
isHot
=>
_isHot
;
bool
_isHot
=
false
;
@override
void
off
()
{
_isHot
=
true
;
}
@override
void
on
()
{
_isHot
=
true
;
}
}
@Injector
(<
Type
>[
PourOverCoffeeModule
])
abstract
class
CoffeeApp
{
static
final
Future
<
CoffeeApp
>
Function
(
PourOverCoffeeModule
)
create
=
generated
.
CoffeeApp
$Injector
.
create
;
@provide
CoffeeMaker
getCoffeeMaker
();
}
dev/integration_tests/codegen/lib/main.dart
View file @
e50ebfc6
...
...
@@ -4,18 +4,13 @@
import
'package:flutter/material.dart'
;
import
'package:flutter_driver/driver_extension.dart'
;
import
'coffee_app.dart'
;
import
'src/coffee.dart'
;
import
'message.dart'
as
generated
;
// ignore: uri_does_not_exist
Future
<
void
>
main
()
async
{
enableFlutterDriverExtension
();
coffeeApp
=
await
CoffeeApp
.
create
(
PourOverCoffeeModule
());
runApp
(
ExampleWidget
());
}
CoffeeApp
coffeeApp
;
class
ExampleWidget
extends
StatefulWidget
{
@override
_ExampleWidgetState
createState
()
=>
_ExampleWidgetState
();
...
...
@@ -34,9 +29,8 @@ class _ExampleWidgetState extends State<ExampleWidget> {
RaisedButton
(
child:
const
Text
(
'Press Button, Get Coffee'
),
onPressed:
()
async
{
final
CoffeeMaker
coffeeMaker
=
coffeeApp
.
getCoffeeMaker
();
setState
(()
{
_message
=
coffeeMaker
.
brew
()
;
_message
=
generated
.
message
;
});
},
),
...
...
dev/integration_tests/codegen/lib/message.spec
0 → 100644
View file @
e50ebfc6
final String message = 'Thanks for using PourOverSupremeFiesta by Coffee by Flutter Inc.';
dev/integration_tests/codegen/lib/src/coffee.dart
deleted
100644 → 0
View file @
dd5559a5
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'package:inject/inject.dart'
;
const
Qualifier
brandName
=
Qualifier
(
#brandName
);
const
Qualifier
modelName
=
Qualifier
(
#modelName
);
class
CoffeeMaker
{
@provide
CoffeeMaker
(
this
.
_heater
,
this
.
_pump
,
this
.
_brand
,
this
.
_model
);
final
Heater
_heater
;
final
Pump
_pump
;
@modelName
final
String
_model
;
@brandName
final
String
_brand
;
String
brew
()
{
_heater
.
on
();
_pump
.
pump
();
print
(
' [_]P coffee! [_]P'
);
final
String
message
=
'Thanks for using
$_model
by
$_brand
'
;
_heater
.
off
();
return
message
;
}
}
abstract
class
Heater
{
void
on
();
void
off
();
bool
get
isHot
;
}
abstract
class
Pump
{
void
pump
();
}
dev/integration_tests/codegen/pubspec.yaml
View file @
e50ebfc6
...
...
@@ -10,11 +10,6 @@ dependencies:
sdk
:
flutter
flutter_driver
:
sdk
:
flutter
# TODO(jonahwilliams): replace with pub version when everything is compatible
inject
:
git
:
url
:
https://github.com/jonahwilliams/inject.dart
path
:
package/inject
async
:
2.0.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
...
...
@@ -76,11 +71,9 @@ dev_dependencies:
yaml
:
2.1.15
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
builders
:
# TODO(jonahwilliams): replace with pub version when everything is compatible
inject_generator
:
git
:
url
:
https://github.com/jonahwilliams/inject.dart
path
:
package/inject_generator
# Note: path is relative from generated directory
simple_codegen
:
path
:
../../../simple_codegen
flutter
:
uses-material-design
:
true
...
...
dev/integration_tests/codegen/test_driver/main_test.dart
View file @
e50ebfc6
...
...
@@ -12,6 +12,10 @@ void main() {
driver
=
await
FlutterDriver
.
connect
();
});
tearDownAll
(()
async
{
await
driver
.
close
();
});
test
(
'Can execute generated code'
,
()
async
{
const
String
button
=
'Press Button, Get Coffee'
;
await
driver
.
tap
(
find
.
text
(
button
));
...
...
dev/integration_tests/simple_codegen/build.yaml
0 → 100644
View file @
e50ebfc6
# Read about `build.yaml` at https://pub.dartlang.org/packages/build_config
builders
:
simple
:
import
:
"
package:simple_codegen/builders.dart"
builder_factories
:
-
simpleBuilder
build_extensions
:
{
'
.spec'
:[
'
.dart'
]}
auto_apply
:
all_packages
dev/integration_tests/simple_codegen/lib/builders.dart
0 → 100644
View file @
e50ebfc6
import
'package:build/build.dart'
;
/// The builder factory used by the `build.yaml` script.
Builder
simpleBuilder
(
BuilderOptions
options
)
=>
SimpleBuilder
();
/// A trivial builder which copies the contents of a `spec` file into a `dart` file.
class
SimpleBuilder
extends
Builder
{
@override
Map
<
String
,
List
<
String
>>
get
buildExtensions
=>
const
<
String
,
List
<
String
>>{
'.spec'
:
<
String
>[
'.dart'
]};
@override
Future
<
void
>
build
(
BuildStep
buildStep
)
async
{
final
AssetId
output
=
buildStep
.
inputId
.
changeExtension
(
'.dart'
);
final
String
contents
=
await
buildStep
.
readAsString
(
buildStep
.
inputId
);
buildStep
.
writeAsString
(
output
,
contents
);
}
}
dev/integration_tests/simple_codegen/pubspec.yaml
0 → 100644
View file @
e50ebfc6
name
:
simple_codegen
description
:
A package for testing codegen
dependencies
:
build
:
1.1.1
analyzer
:
0.35.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
args
:
1.5.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
async
:
2.0.8
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
charcode
:
1.1.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
collection
:
1.14.11
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
convert
:
2.1.1
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
crypto
:
2.0.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib
:
0.14.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
front_end
:
0.1.12
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob
:
1.1.7
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
html
:
0.13.3+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
kernel
:
0.3.12
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
logging
:
0.11.3+2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
meta
:
1.1.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
package_config
:
1.0.5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
path
:
1.6.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
plugin
:
0.2.0+3
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
pub_semver
:
1.4.2
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
source_span
:
1.5.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
string_scanner
:
1.0.4
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
term_glyph
:
1.1.0
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
typed_data
:
1.1.6
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
utf
:
0.9.0+5
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
watcher
:
0.9.7+10
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
yaml
:
2.1.15
# THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
environment
:
# The pub client defaults to an <2.0.0 sdk constraint which we need to explicitly overwrite.
sdk
:
"
>=2.0.0-dev.68.0
<3.0.0"
# PUBSPEC CHECKSUM: 6ccf
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment