Skip to content

Commit 0618fdf

Browse files
franciscojma86Egor
authored and
Egor
committed
[path_provider_macos] Adds example app (flutter#2559)
* Add macos exmaple * Update version * Fix analyzer * Fix * space * Remove tests * Address comment * Remove show * Import * Add platform * Use right import
1 parent f03ddba commit 0618fdf

File tree

75 files changed

+2635
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+2635
-2
lines changed

packages/path_provider/path_provider_macos/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.4
2+
3+
* Adds an example app to run integration tests.
4+
15
## 0.0.3+1
26

37
* Make the pedantic dev_dependency explicit.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# path_provider_macos_example
2+
3+
Demonstrates how to use the path_provider_macos plugin.
4+
5+
## Getting Started
6+
7+
For help getting started with Flutter, view our online
8+
[documentation](http://flutter.io/).
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
def localProperties = new Properties()
2+
def localPropertiesFile = rootProject.file('local.properties')
3+
if (localPropertiesFile.exists()) {
4+
localPropertiesFile.withReader('UTF-8') { reader ->
5+
localProperties.load(reader)
6+
}
7+
}
8+
9+
def flutterRoot = localProperties.getProperty('flutter.sdk')
10+
if (flutterRoot == null) {
11+
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12+
}
13+
14+
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15+
if (flutterVersionCode == null) {
16+
flutterVersionCode = '1'
17+
}
18+
19+
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20+
if (flutterVersionName == null) {
21+
flutterVersionName = '1.0'
22+
}
23+
24+
apply plugin: 'com.android.application'
25+
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
26+
27+
android {
28+
compileSdkVersion 28
29+
30+
lintOptions {
31+
disable 'InvalidPackage'
32+
}
33+
34+
defaultConfig {
35+
applicationId "io.flutter.plugins.pathproviderexample"
36+
minSdkVersion 16
37+
targetSdkVersion 28
38+
versionCode flutterVersionCode.toInteger()
39+
versionName flutterVersionName
40+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
41+
}
42+
43+
buildTypes {
44+
release {
45+
// TODO: Add your own signing config for the release build.
46+
// Signing with the debug keys for now, so `flutter run --release` works.
47+
signingConfig signingConfigs.debug
48+
}
49+
}
50+
}
51+
52+
flutter {
53+
source '../..'
54+
}
55+
56+
dependencies {
57+
androidTestImplementation 'androidx.test:runner:1.2.0'
58+
androidTestImplementation 'androidx.test:rules:1.2.0'
59+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
60+
61+
testImplementation 'junit:junit:4.12'
62+
androidTestImplementation 'androidx.test:runner:1.1.1'
63+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
64+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
package io.flutter.plugins.pathprovider;
3+
4+
import androidx.test.rule.ActivityTestRule;
5+
import dev.flutter.plugins.e2e.FlutterRunner;
6+
import io.flutter.plugins.pathproviderexample.EmbeddingV1Activity;
7+
import org.junit.Rule;
8+
import org.junit.runner.RunWith;
9+
10+
@RunWith(FlutterRunner.class)
11+
public class EmbeddingV1ActivityTest {
12+
@Rule
13+
public ActivityTestRule<EmbeddingV1Activity> rule =
14+
new ActivityTestRule<>(EmbeddingV1Activity.class);
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
package io.flutter.plugins.pathprovider;
3+
4+
import androidx.test.rule.ActivityTestRule;
5+
import dev.flutter.plugins.e2e.FlutterRunner;
6+
import io.flutter.plugins.pathproviderexample.MainActivity;
7+
import org.junit.Rule;
8+
import org.junit.runner.RunWith;
9+
10+
@RunWith(FlutterRunner.class)
11+
public class MainActivityTest {
12+
@Rule public ActivityTestRule<MainActivity> rule = new ActivityTestRule<>(MainActivity.class);
13+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="io.flutter.plugins.pathproviderexample">
3+
4+
<uses-permission android:name="android.permission.INTERNET"/>
5+
6+
<application android:name="io.flutter.app.FlutterApplication" android:label="path_provider_example" android:icon="@mipmap/ic_launcher">
7+
<activity
8+
android:name=".EmbeddingV1Activity"
9+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale"
10+
android:hardwareAccelerated="true"
11+
android:windowSoftInputMode="adjustResize">
12+
</activity>
13+
<activity android:name=".MainActivity"
14+
android:launchMode="singleTop"
15+
android:theme="@android:style/Theme.Black.NoTitleBar"
16+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
17+
android:hardwareAccelerated="true"
18+
android:windowSoftInputMode="adjustResize">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN"/>
21+
<category android:name="android.intent.category.LAUNCHER"/>
22+
</intent-filter>
23+
</activity>
24+
</application>
25+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
package io.flutter.plugins.pathproviderexample;
3+
4+
import android.os.Bundle;
5+
import io.flutter.app.FlutterActivity;
6+
import io.flutter.plugins.GeneratedPluginRegistrant;
7+
8+
public class EmbeddingV1Activity extends FlutterActivity {
9+
@Override
10+
protected void onCreate(Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
GeneratedPluginRegistrant.registerWith(this);
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2017 The Chromium Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
package io.flutter.plugins.pathproviderexample;
6+
7+
import dev.flutter.plugins.e2e.E2EPlugin;
8+
import io.flutter.embedding.android.FlutterActivity;
9+
import io.flutter.embedding.engine.FlutterEngine;
10+
import io.flutter.plugins.pathprovider.PathProviderPlugin;
11+
12+
public class MainActivity extends FlutterActivity {
13+
// TODO(xster): Remove this once v2 of GeneratedPluginRegistrant rolls to stable. https://github.com/flutter/flutter/issues/42694
14+
@Override
15+
public void configureFlutterEngine(FlutterEngine flutterEngine) {
16+
flutterEngine.getPlugins().add(new PathProviderPlugin());
17+
flutterEngine.getPlugins().add(new E2EPlugin());
18+
}
19+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
buildscript {
2+
repositories {
3+
google()
4+
jcenter()
5+
}
6+
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:3.3.0'
9+
}
10+
}
11+
12+
allprojects {
13+
repositories {
14+
google()
15+
jcenter()
16+
}
17+
}
18+
19+
rootProject.buildDir = '../build'
20+
subprojects {
21+
project.buildDir = "${rootProject.buildDir}/${project.name}"
22+
}
23+
subprojects {
24+
project.evaluationDependsOn(':app')
25+
}
26+
27+
task clean(type: Delete) {
28+
delete rootProject.buildDir
29+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
org.gradle.jvmargs=-Xmx1536M
2+
android.enableR8=true
3+
android.useAndroidX=true
4+
android.enableJetifier=true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
include ':app'
2+
3+
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4+
5+
def plugins = new Properties()
6+
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7+
if (pluginsFile.exists()) {
8+
pluginsFile.withInputStream { stream -> plugins.load(stream) }
9+
}
10+
11+
plugins.each { name, path ->
12+
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13+
include ":$name"
14+
project(":$name").projectDir = pluginDirectory
15+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>App</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>io.flutter.flutter.app</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>App</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1.0</string>
23+
<key>UIRequiredDeviceCapabilities</key>
24+
<array>
25+
<string>arm64</string>
26+
</array>
27+
<key>MinimumOSVersion</key>
28+
<string>8.0</string>
29+
</dict>
30+
</plist>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Generated.xcconfig"
2+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "Generated.xcconfig"
2+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"

0 commit comments

Comments
 (0)