Skip to content

Commit 3ef2df2

Browse files
committed
Initial project setup
0 parents  commit 3ef2df2

8 files changed

+429
-0
lines changed

.analysis_options

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Specify analysis options.
2+
#
3+
# Until there are meta linter rules, each desired lint must be explicitly enabled.
4+
# See: https://github.com/dart-lang/linter/issues/288
5+
#
6+
# For a list of lints, see: http://dart-lang.github.io/linter/lints/
7+
# See the configuration guide for more
8+
# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer
9+
#
10+
# NOTE: Please keep this file in sync with
11+
# https://github.com/flutter/flutter/blob/master/.analysis_options
12+
13+
analyzer:
14+
language:
15+
enableStrictCallChecks: true
16+
enableSuperMixins: true
17+
enableAssertInitializer: true
18+
strong-mode:
19+
implicit-dynamic: false
20+
errors:
21+
# treat missing required parameters as a warning (not a hint)
22+
missing_required_param: warning
23+
# treat missing returns as a warning (not a hint)
24+
missing_return: warning
25+
# allow having TODOs in the code
26+
todo: ignore
27+
exclude:
28+
- 'bin/cache/**'
29+
# the following two are relative to the stocks example and the flutter package respectively
30+
# see https://github.com/dart-lang/sdk/issues/28463
31+
- 'lib/i18n/stock_messages_*.dart'
32+
- 'lib/src/http/**'
33+
34+
linter:
35+
rules:
36+
# these rules are documented on and in the same order as
37+
# the Dart Lint rules page to make maintenance easier
38+
# http://dart-lang.github.io/linter/lints/
39+
40+
# === error rules ===
41+
- avoid_empty_else
42+
- avoid_slow_async_io
43+
- cancel_subscriptions
44+
# - close_sinks # https://github.com/flutter/flutter/issues/5789
45+
# - comment_references # blocked on https://github.com/dart-lang/dartdoc/issues/1153
46+
- control_flow_in_finally
47+
- empty_statements
48+
- hash_and_equals
49+
# - invariant_booleans # https://github.com/flutter/flutter/issues/5790
50+
- iterable_contains_unrelated_type
51+
- list_remove_unrelated_type
52+
# - literal_only_boolean_expressions # https://github.com/flutter/flutter/issues/5791
53+
- no_adjacent_strings_in_list
54+
- no_duplicate_case_values
55+
- test_types_in_equals
56+
- throw_in_finally
57+
- unrelated_type_equality_checks
58+
- valid_regexps
59+
60+
# === style rules ===
61+
- always_declare_return_types
62+
# - always_put_control_body_on_new_line
63+
- always_require_non_null_named_parameters
64+
- always_specify_types
65+
- annotate_overrides
66+
# - avoid_annotating_with_dynamic # not yet tested
67+
- avoid_as
68+
# - avoid_catches_without_on_clauses # not yet tested
69+
# - avoid_catching_errors # not yet tested
70+
# - avoid_classes_with_only_static_members # not yet tested
71+
# - avoid_function_literals_in_foreach_calls # not yet tested
72+
- avoid_init_to_null
73+
- avoid_null_checks_in_equality_operators
74+
# - avoid_positional_boolean_parameters # not yet tested
75+
- avoid_return_types_on_setters
76+
# - avoid_returning_null # not yet tested
77+
# - avoid_returning_this # not yet tested
78+
# - avoid_setters_without_getters # not yet tested
79+
# - avoid_types_on_closure_parameters # not yet tested
80+
- await_only_futures
81+
- camel_case_types
82+
# - cascade_invocations # not yet tested
83+
# - constant_identifier_names # https://github.com/dart-lang/linter/issues/204
84+
- directives_ordering
85+
- empty_catches
86+
- empty_constructor_bodies
87+
- implementation_imports
88+
# - join_return_with_assignment # not yet tested
89+
- library_names
90+
- library_prefixes
91+
- non_constant_identifier_names
92+
# - omit_local_variable_types # opposite of always_specify_types
93+
# - one_member_abstracts # too many false positives
94+
# - only_throw_errors # https://github.com/flutter/flutter/issues/5792
95+
- overridden_fields
96+
- package_api_docs
97+
- package_prefixed_library_names
98+
# - parameter_assignments # we do this commonly
99+
- prefer_adjacent_string_concatenation
100+
- prefer_collection_literals
101+
# - prefer_conditional_assignment # not yet tested
102+
- prefer_const_constructors
103+
# - prefer_constructors_over_static_methods # not yet tested
104+
- prefer_contains
105+
# - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods
106+
# - prefer_final_fields # https://github.com/dart-lang/linter/issues/506
107+
- prefer_final_locals
108+
# - prefer_foreach # not yet tested
109+
# - prefer_function_declarations_over_variables # not yet tested
110+
- prefer_initializing_formals
111+
# - prefer_interpolation_to_compose_strings # not yet tested
112+
- prefer_is_empty
113+
- prefer_is_not_empty
114+
# - public_member_api_docs # this is the only difference from .analysis_options_repo
115+
# - recursive_getters # https://github.com/dart-lang/linter/issues/452
116+
- slash_for_doc_comments
117+
- sort_constructors_first
118+
- sort_unnamed_constructors_first
119+
- super_goes_last
120+
# - type_annotate_public_apis # subset of always_specify_types
121+
- type_init_formals
122+
# - unawaited_futures # https://github.com/flutter/flutter/issues/5793
123+
- unnecessary_brace_in_string_interps
124+
- unnecessary_getters_setters
125+
# - unnecessary_lambdas # https://github.com/dart-lang/linter/issues/498
126+
- unnecessary_null_aware_assignments
127+
- unnecessary_null_in_if_null_operators
128+
# - unnecessary_overrides # https://github.com/dart-lang/linter/issues/626 and https://github.com/dart-lang/linter/issues/627
129+
- unnecessary_this
130+
- use_rethrow_when_possible
131+
# - use_setters_to_change_properties # not yet tested
132+
# - use_string_buffers # https://github.com/dart-lang/linter/pull/664
133+
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
134+
135+
# === pub rules ===
136+
- package_names

.gitattributes

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Always perform LF normalization on these files
5+
*.dart text
6+
*.gradle text
7+
*.html text
8+
*.java text
9+
*.json text
10+
*.md text
11+
*.py text
12+
*.sh text
13+
*.txt text
14+
*.xml text
15+
*.yaml text
16+
17+
# Make sure that these Windows files always have CRLF line endings in checkout
18+
*.bat text eol=crlf
19+
*.ps1 text eol=crlf
20+
21+
# Never perform LF normalization on these files
22+
*.ico binary
23+
*.jar binary
24+
*.png binary
25+
*.zip binary

.gitignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
.atom/
3+
.idea
4+
.packages
5+
.pub/
6+
pubspec.lock
7+
8+
Podfile.lock
9+
Pods/
10+
GeneratedPluginRegistrant.h
11+
GeneratedPluginRegistrant.m
12+
13+
GeneratedPluginRegistrant.java
14+

.travis.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
matrix:
2+
include:
3+
# Job 1) Run analyzer
4+
- os: linux
5+
env:
6+
- SHARD=Analyze
7+
sudo: false
8+
addons:
9+
apt:
10+
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
11+
sources:
12+
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
13+
packages:
14+
- libstdc++6
15+
- fonts-droid
16+
before_script:
17+
- git clone https://github.com/flutter/flutter.git --depth 1
18+
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
19+
- flutter doctor
20+
- pub global activate flutter_plugin_tools
21+
script:
22+
- ./script/plugin_tools.sh analyze
23+
# Job 2) Check format and run tests
24+
- os: linux
25+
env:
26+
- SHARD=Format+Test
27+
jdk: oraclejdk8
28+
sudo: false
29+
addons:
30+
apt:
31+
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
32+
sources:
33+
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
34+
- llvm-toolchain-precise # for clang-format-5.0
35+
packages:
36+
- libstdc++6
37+
- fonts-droid
38+
- clang-format-5.0
39+
before_script:
40+
- git clone https://github.com/flutter/flutter.git --depth 1
41+
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
42+
- flutter doctor
43+
- pub global activate flutter_plugin_tools
44+
script:
45+
- ./script/plugin_tools.sh format --travis --clang-format=clang-format-5.0
46+
- ./script/plugin_tools.sh test
47+
# Job 3) Build example APKs
48+
- os: linux
49+
env:
50+
- SHARD=Build-example-APKs
51+
jdk: oraclejdk8
52+
sudo: false
53+
addons:
54+
apt:
55+
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18
56+
sources:
57+
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
58+
packages:
59+
- lib32stdc++6 # https://github.com/flutter/flutter/issues/6207
60+
- libstdc++6
61+
- fonts-droid
62+
before_script:
63+
- wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
64+
- mkdir android-sdk
65+
- unzip -qq sdk-tools-linux-3859397.zip -d android-sdk
66+
- export ANDROID_HOME=`pwd`/android-sdk
67+
- export PATH=`pwd`/android-sdk/tools/bin:$PATH
68+
- mkdir -p /home/travis/.android # silence sdkmanager warning
69+
- echo 'count=0' > /home/travis/.android/repositories.cfg # silence sdkmanager warning
70+
- echo y | sdkmanager "tools"
71+
- echo y | sdkmanager "platform-tools"
72+
- echo y | sdkmanager "build-tools;25.0.3"
73+
- echo y | sdkmanager "platforms;android-25"
74+
- echo y | sdkmanager "extras;android;m2repository"
75+
- echo y | sdkmanager "extras;google;m2repository"
76+
- echo y | sdkmanager "patcher;v4"
77+
- sdkmanager --list
78+
- wget http://services.gradle.org/distributions/gradle-3.5-bin.zip
79+
- unzip -qq gradle-3.5-bin.zip
80+
- export GRADLE_HOME=$PWD/gradle-3.5
81+
- export PATH=$GRADLE_HOME/bin:$PATH
82+
- gradle -v
83+
- git clone https://github.com/flutter/flutter.git --depth 1
84+
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
85+
- flutter doctor
86+
- pub global activate flutter_plugin_tools
87+
script:
88+
- ./script/plugin_tools.sh build-examples --apk
89+
# Job 4) Build example IPAs
90+
- os: osx
91+
env:
92+
- SHARD=Build-example-IPAs
93+
language: generic
94+
osx_image: xcode8.3
95+
before_script:
96+
- pip install six
97+
- brew update
98+
- brew install --HEAD libimobiledevice
99+
- brew install ideviceinstaller
100+
- brew install ios-deploy
101+
- git clone https://github.com/flutter/flutter.git --depth 1
102+
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
103+
- flutter doctor
104+
- pub global activate flutter_plugin_tools
105+
script:
106+
- ./script/plugin_tools.sh build-examples --ipa
107+
108+
cache:
109+
directories:
110+
- $HOME/.pub-cache

AUTHORS

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed to the
2+
# Flutter plugins repository. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

CONTRIBUTING.md

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
Contributing to Flutter Plugins
2+
===============================
3+
4+
_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_
5+
6+
Things you will need
7+
--------------------
8+
9+
* Linux, Mac OS X, or Windows.
10+
* git (used for source version control).
11+
* An ssh client (used to authenticate with GitHub).
12+
13+
Getting the code and configuring your environment
14+
-------------------------------------------------
15+
16+
* Ensure all the dependencies described in the previous section are installed.
17+
* Fork `https://github.com/google/flutter.plugins` into your own GitHub account.
18+
If you already have a fork and are now installing a development environment on
19+
a new machine, make sure you've updated your fork so that you don't use stale
20+
configuration options from long ago.
21+
* If you haven't configured your machine with an SSH key that's known to github, then
22+
follow [GitHub's directions](https://help.github.com/articles/generating-ssh-keys/)
23+
to generate an SSH key.
24+
* `git clone [email protected]:<your_name_here>/flutter.plugins.git`
25+
* `cd plugins`
26+
* `git remote add upstream [email protected]:google/flutter.plugins.git`
27+
(So that you fetch from the master repository, not your clone, when running
28+
`git fetch` et al.)
29+
30+
Running the examples
31+
--------------------
32+
33+
To run an example with a prebuilt binary from the cloud, switch to that
34+
example's directory, run `pub get` to make sure its dependencies have been
35+
downloaded, and use `flutter run`. Make sure you have a device connected over
36+
USB and debugging enabled on that device.
37+
38+
* `cd packages/<pkg>/example`
39+
* `flutter run`
40+
41+
Contributing code
42+
-----------------
43+
44+
We gladly accept contributions via GitHub pull requests.
45+
46+
Please peruse our
47+
[style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo) and
48+
[design principles](https://flutter.io/design-principles/) before
49+
working on anything non-trivial. These guidelines are intended to
50+
keep the code consistent and avoid common pitfalls.
51+
52+
To start working on a patch:
53+
54+
* `git fetch upstream`
55+
* `git checkout upstream/master -b <name_of_your_branch>`
56+
* Hack away.
57+
* `git commit -a -m "<your informative commit message>"`
58+
* `git push origin <name_of_your_branch>`
59+
60+
To send us a pull request:
61+
62+
* `git pull-request` (if you are using [Hub](http://github.com/github/hub/)) or
63+
go to `https://github.com/google/flutter.plugins` and click the
64+
"Compare & pull request" button
65+
66+
Please make sure all your checkins have detailed commit messages explaining the patch.
67+
68+
Once you've gotten an LGTM from a project maintainer and once your PR has received
69+
the green light from all our automated testing (Travis, Appveyor, etc), submit your
70+
changes to the `master` branch using one of the following methods:
71+
72+
* Wait for one of the project maintainers to submit it for you.
73+
* Click the green "Merge pull request" button on the GitHub UI of your pull
74+
request (requires commit access).
75+
76+
You must complete the
77+
[Contributor License Agreement](https://cla.developers.google.com/clas).
78+
You can do this online, and it only takes a minute.
79+
If you've never submitted code before, you must add your (or your
80+
organization's) name and contact info to the [AUTHORS](AUTHORS) file.

0 commit comments

Comments
 (0)