This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[path_provider] Federate mobile implementations #4465
Merged
stuartmorgan-g
merged 9 commits into
flutter:master
from
stuartmorgan-g:path-provider-full-federation
Nov 10, 2021
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5a696ee
Create iOS and Android packages as duplicates of path_provider
stuartmorgan-g 6d39109
pubspec and CHANGELOG fixes
stuartmorgan-g 02b8f2e
Update tests and examples
stuartmorgan-g 89a06d5
Fix gradle and podspec
stuartmorgan-g 54e7465
Fix iOS native tests
stuartmorgan-g 8aed09a
Throw test fixes
stuartmorgan-g 731455c
Merge branch 'master' into path-provider-full-federation
stuartmorgan-g 0708997
Merge branch 'main' into path-provider-full-federation
stuartmorgan-g ab627fe
Fix READMEs
stuartmorgan-g 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
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the Flutter project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
Google Inc. | ||
The Chromium Authors | ||
German Saprykin <[email protected]> | ||
Benjamin Sauer <[email protected]> | ||
[email protected] | ||
Ali Bitek <[email protected]> | ||
Pol Batlló <[email protected]> | ||
Anatoly Pulyaevskiy | ||
Hayden Flinner <[email protected]> | ||
Stefano Rodriguez <[email protected]> | ||
Salvatore Giordano <[email protected]> | ||
Brian Armstrong <[email protected]> | ||
Paul DeMarco <[email protected]> | ||
Fabricio Nogueira <[email protected]> | ||
Simon Lightfoot <[email protected]> | ||
Ashton Thomas <[email protected]> | ||
Thomas Danner <[email protected]> | ||
Diego Velásquez <[email protected]> | ||
Hajime Nakamura <[email protected]> | ||
Tuyển Vũ Xuân <[email protected]> | ||
Miguel Ruivo <[email protected]> | ||
Sarthak Verma <[email protected]> | ||
Mike Diarmid <[email protected]> | ||
Invertase <[email protected]> | ||
Elliot Hesp <[email protected]> | ||
Vince Varga <[email protected]> | ||
Aawaz Gyawali <[email protected]> | ||
EUI Limited <[email protected]> | ||
Katarina Sheremet <[email protected]> | ||
Thomas Stockx <[email protected]> | ||
Sarbagya Dhaubanjar <[email protected]> | ||
Ozkan Eksi <[email protected]> | ||
Rishab Nayak <[email protected]> | ||
ko2ic <[email protected]> | ||
Jonathan Younger <[email protected]> | ||
Jose Sanchez <[email protected]> | ||
Debkanchan Samadder <[email protected]> | ||
Audrius Karosevicius <[email protected]> | ||
Lukasz Piliszczuk <[email protected]> | ||
SoundReply Solutions GmbH <[email protected]> | ||
Rafal Wachol <[email protected]> | ||
Pau Picas <[email protected]> | ||
Christian Weder <[email protected]> | ||
Alexandru Tuca <[email protected]> | ||
Christian Weder <[email protected]> | ||
Rhodes Davis Jr. <[email protected]> | ||
Luigi Agosti <[email protected]> | ||
Quentin Le Guennec <[email protected]> | ||
Koushik Ravikumar <[email protected]> | ||
Nissim Dsilva <[email protected]> | ||
Giancarlo Rocha <[email protected]> | ||
Ryo Miyake <[email protected]> | ||
Théo Champion <[email protected]> | ||
Kazuki Yamaguchi <[email protected]> | ||
Eitan Schwartz <[email protected]> | ||
Chris Rutkowski <[email protected]> | ||
Juan Alvarez <[email protected]> | ||
Aleksandr Yurkovskiy <[email protected]> | ||
Anton Borries <[email protected]> | ||
Alex Li <[email protected]> | ||
Rahul Raj <[email protected]> |
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 @@ | ||
## 2.0.6 | ||
|
||
* Split from `path_provider` as a federated implementation. |
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,25 @@ | ||
Copyright 2013 The Flutter 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,11 @@ | ||
# path\_provider\_android | ||
|
||
The Android implementation of [`path_provider`]. | ||
|
||
## Usage | ||
|
||
This package is [endorsed][2], which means you can simply use `path_provider` | ||
normally. This package will be automatically included in your app when you do. | ||
|
||
[1]: https://pub.dev/packages/path_provider | ||
[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin |
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/path_provider/path_provider_android/android/settings.gradle
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 @@ | ||
rootProject.name = 'path_provider_android' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
packages/path_provider/path_provider_android/example/README.md
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 @@ | ||
# path_provider_example | ||
|
||
Demonstrates how to use the path_provider plugin. | ||
|
||
## Getting Started | ||
|
||
For help getting started with Flutter, view our online | ||
[documentation](https://flutter.dev/). |
64 changes: 64 additions & 0 deletions
64
packages/path_provider/path_provider_android/example/android/app/build.gradle
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,64 @@ | ||
def localProperties = new Properties() | ||
def localPropertiesFile = rootProject.file('local.properties') | ||
if (localPropertiesFile.exists()) { | ||
localPropertiesFile.withReader('UTF-8') { reader -> | ||
localProperties.load(reader) | ||
} | ||
} | ||
|
||
def flutterRoot = localProperties.getProperty('flutter.sdk') | ||
if (flutterRoot == null) { | ||
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | ||
} | ||
|
||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | ||
if (flutterVersionCode == null) { | ||
flutterVersionCode = '1' | ||
} | ||
|
||
def flutterVersionName = localProperties.getProperty('flutter.versionName') | ||
if (flutterVersionName == null) { | ||
flutterVersionName = '1.0' | ||
} | ||
|
||
apply plugin: 'com.android.application' | ||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||
|
||
android { | ||
compileSdkVersion 29 | ||
|
||
lintOptions { | ||
disable 'InvalidPackage' | ||
} | ||
|
||
defaultConfig { | ||
applicationId "io.flutter.plugins.pathproviderexample" | ||
minSdkVersion 16 | ||
targetSdkVersion 28 | ||
versionCode flutterVersionCode.toInteger() | ||
versionName flutterVersionName | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
// TODO: Add your own signing config for the release build. | ||
// Signing with the debug keys for now, so `flutter run --release` works. | ||
signingConfig signingConfigs.debug | ||
} | ||
} | ||
} | ||
|
||
flutter { | ||
source '../..' | ||
} | ||
|
||
dependencies { | ||
androidTestImplementation 'androidx.test:runner:1.2.0' | ||
androidTestImplementation 'androidx.test:rules:1.2.0' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' | ||
|
||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test:runner:1.1.1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | ||
} |
5 changes: 5 additions & 0 deletions
5
...ovider/path_provider_android/example/android/app/gradle/wrapper/gradle-wrapper.properties
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 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
14 changes: 14 additions & 0 deletions
14
...roid/example/android/app/src/androidTest/java/io/flutter/plugins/DartIntegrationTest.java
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 @@ | ||
// 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. | ||
|
||
package io.flutter.plugins; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface DartIntegrationTest {} |
19 changes: 19 additions & 0 deletions
19
...le/android/app/src/androidTest/java/io/flutter/plugins/pathprovider/MainActivityTest.java
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,19 @@ | ||
// 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. | ||
|
||
package io.flutter.plugins.pathprovider; | ||
|
||
import androidx.test.rule.ActivityTestRule; | ||
import dev.flutter.plugins.integration_test.FlutterTestRunner; | ||
import io.flutter.embedding.android.FlutterActivity; | ||
import io.flutter.plugins.DartIntegrationTest; | ||
import org.junit.Rule; | ||
import org.junit.runner.RunWith; | ||
|
||
@DartIntegrationTest | ||
@RunWith(FlutterTestRunner.class) | ||
public class MainActivityTest { | ||
@Rule | ||
public ActivityTestRule<FlutterActivity> rule = new ActivityTestRule<>(FlutterActivity.class); | ||
} |
20 changes: 20 additions & 0 deletions
20
...ages/path_provider/path_provider_android/example/android/app/src/main/AndroidManifest.xml
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,20 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="io.flutter.plugins.pathproviderexample"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
|
||
<application android:label="path_provider_example" android:icon="@mipmap/ic_launcher"> | ||
<activity android:name="io.flutter.embedding.android.FlutterActivity" | ||
android:launchMode="singleTop" | ||
android:theme="@android:style/Theme.Black.NoTitleBar" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection" | ||
android:hardwareAccelerated="true" | ||
android:windowSoftInputMode="adjustResize"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<meta-data android:name="flutterEmbedding" android:value="2"/> | ||
</application> | ||
</manifest> |
Binary file added
BIN
+544 Bytes
...h_provider_android/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+442 Bytes
...h_provider_android/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+721 Bytes
..._provider_android/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.01 KB
...provider_android/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.41 KB
...rovider_android/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
packages/path_provider/path_provider_android/example/android/build.gradle
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,29 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:3.3.0' | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
rootProject.buildDir = '../build' | ||
subprojects { | ||
project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
} | ||
subprojects { | ||
project.evaluationDependsOn(':app') | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} |
4 changes: 4 additions & 0 deletions
4
packages/path_provider/path_provider_android/example/android/gradle.properties
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,4 @@ | ||
org.gradle.jvmargs=-Xmx1536M | ||
android.enableR8=true | ||
android.useAndroidX=true | ||
android.enableJetifier=true |
5 changes: 5 additions & 0 deletions
5
...h_provider/path_provider_android/example/android/gradle/wrapper/gradle-wrapper.properties
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 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip |
15 changes: 15 additions & 0 deletions
15
packages/path_provider/path_provider_android/example/android/settings.gradle
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 @@ | ||
include ':app' | ||
|
||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() | ||
|
||
def plugins = new Properties() | ||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') | ||
if (pluginsFile.exists()) { | ||
pluginsFile.withInputStream { stream -> plugins.load(stream) } | ||
} | ||
|
||
plugins.each { name, path -> | ||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() | ||
include ":$name" | ||
project(":$name").projectDir = pluginDirectory | ||
} |
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.