Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e76af89
linux path provider start
TimWhiting Mar 7, 2020
03b97e1
Start of linux implementation
TimWhiting Mar 7, 2020
45e516a
WIP working on linux implementation of path provider
TimWhiting Mar 8, 2020
75f2bca
Some fixes including licences and removing unused import
TimWhiting Mar 8, 2020
1b872e5
rename plugin class for linux
TimWhiting Mar 8, 2020
17bfd87
linux path provider start
TimWhiting Mar 7, 2020
7708458
Start of linux implementation
TimWhiting Mar 7, 2020
d71a35d
WIP working on linux implementation of path provider
TimWhiting Mar 8, 2020
0073084
Some fixes including licences and removing unused import
TimWhiting Mar 8, 2020
63e41ef
rename plugin class for linux
TimWhiting Mar 8, 2020
9573b74
Merge branch 'path_provider_linux' of github.com:TimWhiting/plugins i…
TimWhiting Apr 25, 2020
02eef61
adding linux implementation to path_provider
TimWhiting Apr 26, 2020
3bd7e48
formatted and fixed analyzer errors
TimWhiting Apr 28, 2020
463dc1e
bump path provider version
TimWhiting Apr 28, 2020
da8c397
get rid of android and ios plugin stubs
TimWhiting Apr 29, 2020
1a38b77
add back in the android/ios plugin stubs
TimWhiting Apr 29, 2020
71ec79b
fixing example folders
TimWhiting May 6, 2020
a546385
updates to linux path provider according to comments
TimWhiting May 6, 2020
49c2f3c
merging updates to remove linux example folder etc
TimWhiting May 6, 2020
012f863
Merge remote-tracking branch 'upstream/master' into path_provider_linux
TimWhiting May 6, 2020
f7e6bb1
adding end to end tests and widget tests to example
TimWhiting May 6, 2020
ad9bde0
readd the ios and android examples
TimWhiting May 12, 2020
3895152
register linux path provider on e2e test
TimWhiting May 13, 2020
f0c2b70
Merge remote-tracking branch 'origin/master' into path_provider_linux
TimWhiting May 13, 2020
80bc0b1
copy from macos the ios and android folders in example
TimWhiting May 15, 2020
0820590
Merge branch 'master' of github.com:flutter/plugins into path_provide…
TimWhiting May 15, 2020
15cc118
updates so package doesn't conflict (gradle issues)
TimWhiting May 15, 2020
4140c32
update ios podspec
TimWhiting May 15, 2020
3dc4be3
update to use new pubspec option, and add in generated iOS files that…
TimWhiting May 18, 2020
d809a82
adjusting path_provider e2e test to not override the plugin on ios
TimWhiting May 18, 2020
f745485
update test to ignore download directory on ios and android to preven…
TimWhiting May 18, 2020
b93aa6a
remove source files attribute in podspec
TimWhiting May 18, 2020
d9005c8
update podspec
TimWhiting May 19, 2020
8cadc92
fixed syntax error in podspec
TimWhiting May 19, 2020
bd65767
Merge remote-tracking branch 'upstream/master' into path_provider_linux
TimWhiting May 21, 2020
a30db16
remove no-op android plugin
TimWhiting May 21, 2020
2ec5f93
update readme to indicate how to use the plugin until it is endorsed,…
TimWhiting May 21, 2020
723679e
Merge remote-tracking branch 'origin/master' into path_provider_linux
TimWhiting May 21, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/path_provider/path_provider_linux/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
.dart_tool/

.packages
.pub/

build/
10 changes: 10 additions & 0 deletions packages/path_provider/path_provider_linux/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: e491544588e8d34fdf31d5f840b4649850ef167a
channel: master

project_type: plugin
5 changes: 5 additions & 0 deletions packages/path_provider/path_provider_linux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.0.1

* The initial implementation of path_provider for Linux
* Implements getApplicationSupportPath, getApplicationDocumentsPath, getDownloadsPath, and getTemporaryPath

27 changes: 27 additions & 0 deletions packages/path_provider/path_provider_linux/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2020 The Chromium 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.
37 changes: 37 additions & 0 deletions packages/path_provider/path_provider_linux/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# path_provider_linux

The linux implementation of [`path_provider`].

**Please set your constraint to `path_provider_linux: '>=0.0.y+x <2.0.0'`**

## Backward compatible 1.0.0 version is coming
The `path_provider` plugin has reached a stable API, we guarantee that version `1.0.0` will be backward compatible with `0.0.y+z`.
Please use `path_provider_linux: '>=0.0.y+x <2.0.0'` as your dependency constraint to allow a smoother ecosystem migration.
For more details see: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0

## Usage

### Import the package

To use this plugin in your Flutter linux app, simply add it as a dependency in
your `pubspec.yaml` alongside the base `path_provider` plugin.

_(This is only temporary: in the future we hope to make this package an
"endorsed" implementation of `path_provider`, so that it is automatically
included in your Flutter linux app when you depend on `package:path_provider`.)_

This is what the above means to your `pubspec.yaml`:

```yaml
...
dependencies:
...
path_provider: ^1.5.1
path_provider_linux: ^0.0.1
...
```

### Use the plugin

Once you have the `path_provider_linux` dependency in your pubspec, you should
be able to use `package:path_provider` as normal.
43 changes: 43 additions & 0 deletions packages/path_provider/path_provider_linux/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
10 changes: 10 additions & 0 deletions packages/path_provider/path_provider_linux/example/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: e491544588e8d34fdf31d5f840b4649850ef167a
channel: master

project_type: app
16 changes: 16 additions & 0 deletions packages/path_provider/path_provider_linux/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# path_provider_linux_example

Demonstrates how to use the path_provider_linux plugin.

## Getting Started

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
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 28

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'
}
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

package io.flutter.plugins.pathprovider;

import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.e2e.FlutterRunner;
import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity;
import org.junit.Rule;
import org.junit.runner.RunWith;

@RunWith(FlutterRunner.class)
public class EmbeddingV1ActivityTest {
@Rule
public ActivityTestRule<EmbeddingV1Activity> rule =
new ActivityTestRule<>(EmbeddingV1Activity.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

package io.flutter.plugins.pathprovider;

import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.e2e.FlutterRunner;
import io.flutter.plugins.pathproviderexample.MainActivity;
import org.junit.Rule;
import org.junit.runner.RunWith;

@RunWith(FlutterRunner.class)
public class MainActivityTest {
@Rule public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.pathproviderexample">

<uses-permission android:name="android.permission.INTERNET"/>

<application android:name="io.flutter.app.FlutterApplication" android:label="path_provider_example" android:icon="@mipmap/ic_launcher">
<activity
android:name=".EmbeddingV1Activity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
</activity>
<activity android:name=".MainActivity"
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>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

package io.flutter.plugins.pathproviderexample;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class EmbeddingV1Activity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2017 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.

package io.flutter.plugins.pathproviderexample;

import dev.flutter.plugins.e2e.E2EPlugin;
import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.pathprovider.PathProviderPlugin;

public class MainActivity extends FlutterActivity {
// TODO(xster): Remove this once v2 of GeneratedPluginRegistrant rolls to stable. https://github.com/flutter/flutter/issues/42694
@Override
public void configureFlutterEngine(FlutterEngine flutterEngine) {
flutterEngine.getPlugins().add(new PathProviderPlugin());
flutterEngine.getPlugins().add(new E2EPlugin());
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}
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
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
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
}
Loading