Skip to content

Commit bd18656

Browse files
authored
Add a skeleton package:ok_http (#1212)
1 parent a2e241b commit bd18656

37 files changed

+763
-0
lines changed

.github/workflows/okhttp.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: package:ok_http CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- '.github/workflows/okhttp.yml'
10+
- 'pkgs/ok_http/**'
11+
- 'pkgs/http_client_conformance_tests/**'
12+
pull_request:
13+
paths:
14+
- '.github/workflows/okhttp.yml'
15+
- 'pkgs/ok_http/**'
16+
- 'pkgs/http_client_conformance_tests/**'
17+
schedule:
18+
- cron: "0 0 * * 0"
19+
20+
env:
21+
PUB_ENVIRONMENT: bot.github
22+
23+
jobs:
24+
verify:
25+
name: Format & Analyze & Test
26+
runs-on: ubuntu-latest
27+
defaults:
28+
run:
29+
working-directory: pkgs/ok_http
30+
steps:
31+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
32+
- uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9
33+
with:
34+
distribution: 'zulu'
35+
java-version: '17'
36+
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
37+
with:
38+
channel: 'stable'
39+
- id: install
40+
name: Install dependencies
41+
run: flutter pub get
42+
- name: Check formatting
43+
if: always() && steps.install.outcome == 'success'
44+
run: dart format --output=none --set-exit-if-changed .
45+
- name: Analyze code
46+
if: always() && steps.install.outcome == 'success'
47+
run: flutter analyze --fatal-infos

pkgs/ok_http/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
build/

pkgs/ok_http/.metadata

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3"
8+
channel: "stable"
9+
10+
project_type: plugin_ffi
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
17+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
18+
- platform: android
19+
create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
20+
base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

pkgs/ok_http/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0-wip
2+
3+
* Initial release.

pkgs/ok_http/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2014, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

pkgs/ok_http/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[![pub package](https://img.shields.io/pub/v/cronet_http.svg)](https://pub.dev/packages/ok_http)
2+
[![package publisher](https://img.shields.io/pub/publisher/ok_http.svg)](https://pub.dev/packages/ok_http/publisher)
3+
4+
An Android Flutter plugin that provides access to the
5+
[OkHttp][] HTTP client.
6+
7+
## Status: experimental
8+
9+
**NOTE**: This package is currently experimental and published under the
10+
[labs.dart.dev](https://dart.dev/dart-team-packages) pub publisher in order to
11+
solicit feedback.
12+
13+
For packages in the labs.dart.dev publisher we generally plan to either graduate
14+
the package into a supported publisher (dart.dev, tools.dart.dev) after a period
15+
of feedback and iteration, or discontinue the package. These packages have a
16+
much higher expected rate of API and breaking changes.
17+
18+
Your feedback is valuable and will help us evolve this package. For general
19+
feedback, suggestions, and comments, please file an issue in the
20+
[bug tracker](https://github.com/dart-lang/http/issues).
21+
22+
[OkHttp]: https://square.github.io/okhttp/

pkgs/ok_http/analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: ../../analysis_options.yaml

pkgs/ok_http/android/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx

pkgs/ok_http/android/build.gradle

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// The Android Gradle Plugin builds the native code with the Android NDK.
2+
3+
group = "com.example.ok_http"
4+
version = "1.0"
5+
6+
buildscript {
7+
repositories {
8+
google()
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
// The Android Gradle Plugin knows how to build native code with the NDK.
14+
classpath("com.android.tools.build:gradle:7.3.0")
15+
}
16+
}
17+
18+
rootProject.allprojects {
19+
repositories {
20+
google()
21+
mavenCentral()
22+
}
23+
}
24+
25+
apply plugin: "com.android.library"
26+
27+
android {
28+
if (project.android.hasProperty("namespace")) {
29+
namespace = "com.example.ok_http"
30+
}
31+
32+
// Bumping the plugin compileSdk version requires all clients of this plugin
33+
// to bump the version in their app.
34+
compileSdk = 34
35+
36+
// Use the NDK version
37+
// declared in /android/app/build.gradle file of the Flutter project.
38+
// Replace it with a version number if this plugin requires a specific NDK version.
39+
// (e.g. ndkVersion "23.1.7779620")
40+
ndkVersion = android.ndkVersion
41+
42+
// Invoke the shared CMake build with the Android Gradle Plugin.
43+
externalNativeBuild {
44+
cmake {
45+
path = "../src/CMakeLists.txt"
46+
47+
// The default CMake version for the Android Gradle Plugin is 3.10.2.
48+
// https://developer.android.com/studio/projects/install-ndk#vanilla_cmake
49+
//
50+
// The Flutter tooling requires that developers have CMake 3.10 or later
51+
// installed. You should not increase this version, as doing so will cause
52+
// the plugin to fail to compile for some customers of the plugin.
53+
// version "3.10.2"
54+
}
55+
}
56+
57+
compileOptions {
58+
sourceCompatibility = JavaVersion.VERSION_1_8
59+
targetCompatibility = JavaVersion.VERSION_1_8
60+
}
61+
62+
defaultConfig {
63+
minSdk = 21
64+
}
65+
}

pkgs/ok_http/android/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'ok_http'

0 commit comments

Comments
 (0)