-
Notifications
You must be signed in to change notification settings - Fork 33
Merge package:platform
#404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
21891c3
Provide initial project structure
tvolkert 9b36c2d
Add `Platform` interface files (dart-lang/platform#1)
tvolkert bbba132
Add FakePlatform (dart-lang/platform#2)
tvolkert d3fff15
Add const constructors for Platform and LocalPlatform
tvolkert 39dc5d5
1.0.1 release
tvolkert 20cebd7
Add disclaimer
tvolkert 77cc161
Minor doc updates
tvolkert e041d33
Merge pull request dart-lang/platform#3 from tvolkert/docs
tvolkert fb24576
add ansiSupported (dart-lang/platform#4)
goderbauer 307f68d
Udpate to new io.stdin.supportsAnsiEscapes. (dart-lang/platform#5)
pq 6b3e707
Add .travis.yml (dart-lang/platform#6)
tvolkert b3d03d3
Bump version to 1.1.1 (dart-lang/platform#7)
tvolkert e2c09c9
Add pub shield. (dart-lang/platform#8)
pq 0e313d6
Added stdinSupportsAnsi and stdinSupportsAnsi (dart-lang/platform#9)
goderbauer 0af81be
Add (dart-lang/platform#12)
goderbauer 481c456
Bump max Dart SDK version to 2.0.0-dev.infinity (dart-lang/platform#13)
tvolkert 5e5db55
Update sdk constraint to <2.0.0. Drop '-dev.infinity' (dart-lang/plat…
aam a12f988
Update .gitignore to new `dart_tool` pub cache (dart-lang/platform#15)
bcko 196213c
2.2.0 release (dart-lang/platform#18)
tvolkert 4a47743
Add operatingSystemVersion (dart-lang/platform#19)
felangel 9d67b0f
Bump version (dart-lang/platform#20)
tvolkert becef4b
[null-safety] migrate platform to null-safe dart (dart-lang/platform#24)
8c33d85
publishable null-safety release (dart-lang/platform#25)
c857e30
update sdk contraint for 2.11 (dart-lang/platform#26)
2214b7a
updaet SDK constraint for null safety (dart-lang/platform#27)
27031e6
Update for beta release (dart-lang/platform#28)
17c8306
stable release for null safety (dart-lang/platform#29)
2cf2ae9
Add OS constants for use in switch statements (dart-lang/platform#30)
gspencergoog 768a096
Add FakePlatform.copyWith to allow overriding some values only (dart-…
gspencergoog 396db1f
Fix sdk version constraint to no longer be pre-release (dart-lang/pla…
gspencergoog 01783eb
Switch to GitHub actions, update analysis options, fix analysis issue…
gspencergoog d8e96ef
Fix formatting (dart-lang/platform#36)
gspencergoog cf1b571
Remove package root (dart-lang/platform#38)
mit-mit 078763d
Update readme: drop broken coverage and CI badges (dart-lang/platform…
kevmoo 85fcfd4
Point to new repo location in README
stuartmorgan-g 37bec96
Bring over latest files from flutter/packages (dart-lang/platform#46)
mit-mit 5b429af
Prepare for publishing (dart-lang/platform#47)
mit-mit da40958
Merge package:platform into the core monorepo
mosuem a22b849
Add issue template and other fixes
mosuem ddf9f25
Moving fixes
mosuem cecb4b4
Ignore licenses for package:platform
mosuem 08428e8
Update .github/workflows/platform.yaml
mosuem a11bf72
Merge branch 'main' into merge-platform-package
mosuem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
name: "package:platform" | ||
about: "Create a bug or file a feature request against package:platform." | ||
labels: "package:platform" | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Platform Package | ||
|
||
on: | ||
# Run CI on pushes to the main branch, and on PRs against main. | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/platform.yaml' | ||
- 'pkgs/platform/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/platform.yaml' | ||
- 'pkgs/platform/**' | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/platform/ | ||
|
||
jobs: | ||
correctness: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 | ||
with: | ||
sdk: dev | ||
- name: Install dependencies | ||
run: dart pub upgrade | ||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
- name: Analyze project source | ||
run: dart analyze --fatal-infos | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
sdk: [stable, beta, dev] | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- name: Install dependencies | ||
run: dart pub upgrade | ||
- name: Run Tests | ||
run: dart test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### Dart template | ||
# Don’t commit the following directories created by pub. | ||
.buildlog | ||
.dart_tool/ | ||
.pub/ | ||
build/ | ||
packages | ||
.packages | ||
|
||
# Include when developing application packages. | ||
pubspec.lock | ||
|
||
# IDE | ||
.project | ||
.settings | ||
.idea | ||
.c9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the Process project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
Google Inc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
## 3.1.6 | ||
|
||
* Move to `dart-lang/core` monorepo. | ||
|
||
## 3.1.5 | ||
|
||
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. | ||
* Transfers the package source from https://github.com/flutter/packages | ||
to https://github.com/dart-lang/platform. | ||
|
||
## 3.1.4 | ||
|
||
* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. | ||
* Fixes new lint warnings. | ||
|
||
## 3.1.3 | ||
|
||
* Adds example app. | ||
|
||
## 3.1.2 | ||
|
||
* Adds pub topics to package metadata. | ||
* Updates minimum supported SDK version to Flutter 3.7/Dart 2.19. | ||
|
||
## 3.1.1 | ||
|
||
* Transfers the package source from https://github.com/google/platform.dart to | ||
https://github.com/flutter/packages. | ||
|
||
## 3.1.0 | ||
|
||
* Removed `Platform.packageRoot`, which was already marked deprecated, and which | ||
didn't work in Dart 2. | ||
|
||
## 3.0.2 | ||
|
||
* Added `FakePlatform.copyWith` function. | ||
|
||
## 3.0.1 | ||
|
||
* Added string constants for each of the supported platforms for use in switch | ||
statements. | ||
|
||
## 3.0.0 | ||
|
||
* First stable null safe release. | ||
|
||
## 3.0.0-nullsafety.4 | ||
|
||
* Update supported SDK range. | ||
|
||
## 3.0.0-nullsafety.3 | ||
|
||
* Update supported SDK range. | ||
|
||
## 3.0.0-nullsafety.2 | ||
|
||
* Update supported SDK range. | ||
|
||
## 3.0.0-nullsafety.1 | ||
|
||
* Migrate package to null-safe dart. | ||
|
||
## 2.2.1 | ||
|
||
* Add `operatingSystemVersion` | ||
|
||
## 2.2.0 | ||
|
||
* Declare compatibility with Dart 2 stable | ||
* Update dependency on `package:test` to 1.0 | ||
|
||
## 2.1.2 | ||
|
||
* Relax sdk upper bound constraint to '<2.0.0' to allow 'edge' dart sdk use. | ||
|
||
## 2.1.1 | ||
|
||
* Bumped maximum Dart SDK version to 2.0.0-dev.infinity | ||
|
||
## 2.1.0 | ||
|
||
* Added `localeName` | ||
* Bumped minimum Dart SDK version to 1.24.0-dev.0.0 | ||
|
||
## 2.0.0 | ||
|
||
* Added `stdinSupportsAnsi` and `stdinSupportsAnsi` | ||
* Removed `ansiSupported` | ||
|
||
## 1.1.1 | ||
|
||
* Updated `LocalPlatform` to use new `dart.io` API for ansi color support queries | ||
* Bumped minimum Dart SDK version to 1.23.0-dev.10.0 | ||
|
||
## 1.1.0 | ||
|
||
* Added `ansiSupported` | ||
* Bumped minimum Dart SDK version to 1.23.0-dev.9.0 | ||
|
||
## 1.0.2 | ||
|
||
* Minor doc updates | ||
|
||
## 1.0.1 | ||
|
||
* Added const constructors for `Platform` and `LocalPlatform` | ||
|
||
## 1.0.0 | ||
|
||
* Initial version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright 2017, the Dart project authors. All rights reserved. | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[](https://pub.dartlang.org/packages/platform) | ||
|
||
A generic platform abstraction for Dart. | ||
|
||
Like `dart:io`, `package:platform` supplies a rich, Dart-idiomatic API for | ||
accessing platform-specific information. | ||
|
||
`package:platform` provides a lightweight wrapper around the static `Platform` | ||
properties that exist in `dart:io`. However, it uses instance properties rather | ||
than static properties, making it possible to mock out in tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
analyzer: | ||
errors: | ||
# Allow having TODOs in the code | ||
todo: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
A small example application demonstrating how to use the platform information | ||
APIs in `package:platform`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This file configures the static analysis results for your project (errors, | ||
# warnings, and lints). | ||
# | ||
# This enables the 'recommended' set of lints from `package:lints`. | ||
# This set helps identify many issues that may lead to problems when running | ||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic | ||
# style and format. | ||
# | ||
# If you want a smaller set of lints you can change this to specify | ||
# 'package:lints/core.yaml'. These are just the most critical lints | ||
# (the recommended set includes the core lints). | ||
# The core lints are also what is used by pub.dev for scoring packages. | ||
|
||
include: package:lints/recommended.yaml | ||
|
||
# Uncomment the following section to specify additional rules. | ||
|
||
# linter: | ||
# rules: | ||
# - camel_case_types | ||
|
||
# analyzer: | ||
# exclude: | ||
# - path/to/excluded/files/** | ||
|
||
# For more information about the core and recommended set of lints, see | ||
# https://dart.dev/go/core-lints | ||
|
||
# For additional information about configuring this file, see | ||
# https://dart.dev/guides/language/analysis-options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:platform/platform.dart'; | ||
|
||
void main(List<String> arguments) { | ||
const LocalPlatform platform = LocalPlatform(); | ||
|
||
print('Operating System: ${platform.operatingSystem}.'); | ||
print('Local Hostname: ${platform.localHostname}.'); | ||
print('Number of Processors: ${platform.numberOfProcessors}.'); | ||
print('Path Separator: ${platform.pathSeparator}.'); | ||
print('Locale Name: ${platform.localeName}.'); | ||
print('Stdin Supports ANSI: ${platform.stdinSupportsAnsi}.'); | ||
print('Stdout Supports ANSI: ${platform.stdoutSupportsAnsi}.'); | ||
print('Executable Arguments: ${platform.executableArguments}.'); | ||
print('Dart Version: ${platform.version}.'); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: example | ||
description: Demonstrates how to use the platform api. | ||
version: 1.0.0 | ||
publish_to: none | ||
|
||
environment: | ||
sdk: ^3.2.0 | ||
|
||
dependencies: | ||
platform: | ||
path: ../ | ||
|
||
dev_dependencies: | ||
lints: ^4.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// Core interfaces & classes. | ||
export 'src/interface/local_platform.dart'; | ||
export 'src/interface/platform.dart'; | ||
export 'src/testing/fake_platform.dart'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.