Skip to content

Commit 593cc5c

Browse files
authored
Federate android platform implementation (#798)
* Federate the Android platform implementation * Fix name of geolocator_android workflow * Fix formatting mistake
1 parent 96312ec commit 593cc5c

File tree

73 files changed

+3316
-0
lines changed

Some content is hidden

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

73 files changed

+3316
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: geolocator_android
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the develop branch
7+
on:
8+
push:
9+
branches: [ master, next ]
10+
paths:
11+
- 'geolocator_android/**'
12+
pull_request:
13+
branches: [ master, next ]
14+
paths:
15+
- 'geolocator_android/**'
16+
17+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
18+
jobs:
19+
format:
20+
name: Format
21+
22+
# The type of runner that the job will run on
23+
runs-on: ubuntu-latest
24+
25+
env:
26+
source-directory: ./geolocator_android
27+
28+
# Steps represent a sequence of tasks that will be executed as part of the job
29+
steps:
30+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
31+
- uses: actions/checkout@v2
32+
33+
# Make sure the stable version of Flutter is available
34+
- uses: subosito/flutter-action@v1
35+
with:
36+
channel: 'stable'
37+
38+
# Download all Flutter packages
39+
- name: Download dependencies
40+
run: flutter pub get
41+
working-directory: ${{env.source-directory}}
42+
43+
# Run Flutter Format to ensure formatting is valid
44+
- name: Run Flutter Format
45+
run: flutter format --set-exit-if-changed .
46+
working-directory: ${{env.source-directory}}
47+
48+
analyze:
49+
name: Analyze
50+
51+
# The type of runner that the job will run on
52+
runs-on: ubuntu-latest
53+
54+
env:
55+
source-directory: ./geolocator_android
56+
57+
# Steps represent a sequence of tasks that will be executed as part of the job
58+
steps:
59+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
60+
- uses: actions/checkout@v2
61+
62+
# Make sure the stable version of Flutter is available
63+
- uses: subosito/flutter-action@v1
64+
with:
65+
channel: 'stable'
66+
67+
# Download all Flutter packages
68+
- name: Download dependencies
69+
run: flutter pub get
70+
working-directory: ${{env.source-directory}}
71+
72+
# Run Flutter Analyzer
73+
- name: Run Flutter Analyzer
74+
run: flutter analyze
75+
working-directory: ${{env.source-directory}}
76+
77+
build_android:
78+
name: Build Android App
79+
80+
# The type of runner that the job will run on
81+
runs-on: ubuntu-latest
82+
83+
env:
84+
source-directory: ./geolocator_android
85+
example-directory: ./geolocator_android/example
86+
87+
# Steps represent a sequence of tasks that will be executed as part of the job
88+
steps:
89+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
90+
- uses: actions/checkout@v2
91+
92+
# Ensure correct JAVA version is installed.
93+
- uses: actions/setup-java@v1
94+
with:
95+
java-version: '12.x'
96+
97+
# Make sure the stable version of Flutter is available
98+
- uses: subosito/flutter-action@v1
99+
with:
100+
channel: 'stable'
101+
102+
# Download all Flutter packages
103+
- name: Download dependencies
104+
run: flutter pub get
105+
working-directory: ${{env.source-directory}}
106+
107+
# Build Android version of the example App
108+
- name: Run Android build
109+
run: flutter build apk --release
110+
working-directory: ${{env.example-directory}}
111+
112+
tests:
113+
name: Unit-tests
114+
# The type of runner that the job will run on
115+
runs-on: ubuntu-latest
116+
117+
env:
118+
source-directory: ./geolocator_android
119+
120+
# Steps represent a sequence of tasks that will be executed as part of the job
121+
steps:
122+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
123+
- uses: actions/checkout@v2
124+
125+
# Make sure the stable version of Flutter is available
126+
- uses: subosito/flutter-action@v1
127+
with:
128+
channel: 'stable'
129+
130+
# Download all Flutter packages
131+
- name: Download dependencies
132+
run: flutter pub get
133+
working-directory: ${{env.source-directory}}
134+
135+
# Run all unit-tests with code coverage
136+
- name: Run unit tests
137+
run: flutter test --coverage
138+
working-directory: ${{env.source-directory}}
139+
140+
# Upload code coverage information
141+
- uses: codecov/codecov-action@v1
142+
with:
143+
file: ${{env.source-directory}}/coverage/lcov.info # optional
144+
name: Geolocator (App Facing Package) # optional
145+
fail_ci_if_error: true

geolocator_android/AUTHORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
# Below is a list of people and organizations that have contributed
3+
# to the Flutter project. Names should be added to the list like so:
4+
#
5+
# Name/Organization <email address>
6+
7+
8+
Maurits van Beusekom <[email protected]>

geolocator_android/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## 1.0.0
2+
3+
- Initial open source release.
4+

geolocator_android/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Baseflow
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

geolocator_android/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# geolocator_android
2+
3+
[![pub package](https://img.shields.io/pub/v/geolocator.svg)](https://pub.dartlang.org/packages/geolocator) ![Build status](https://github.com/Baseflow/flutter-geolocator/workflows/geolocator_android/badge.svg?branch=master) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
4+
5+
The official Android implementation of the [geolocator](https://pub.dev/packages/geolocator) plugin by [Baseflow](https://baseflow.com).
6+
7+
## Usage
8+
9+
Since version 8.0.0 of the [geolocator](https://pub.dev/packages/geolocator) plugin this is the endorsed Android implementation. This means it will automatically be added to your dependencies when you depend on `geolocator: ^8.0.0` in your applications pubspec.yaml.
10+
11+
More detailed instructions on using the API can be found in the [README.md](../geolocator/README.md) of the [geolocator](https://pub.dev/packages/geolocator) package.
12+
13+
## Issues
14+
15+
Please file any issues, bugs or feature requests as an issue on our [GitHub](https://github.com/Baseflow/flutter-geolocator/issues) page. Commercial support is available, you can contact us at <[email protected]>.
16+
17+
## Want to contribute
18+
19+
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](../CONTRIBUTING.md) and send us your [pull request](https://github.com/Baseflow/flutter-geolocator/pulls).
20+
21+
## Author
22+
23+
This Geolocator plugin for Flutter is developed by [Baseflow](https://baseflow.com).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
analyzer:
4+
exclude:
5+
# Ignore generated files
6+
- '**/*.g.dart'
7+
- 'lib/src/generated/*.dart'
8+
linter:
9+
rules:
10+
- public_member_api_docs

geolocator_android/android/.classpath

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-14/"/>
4+
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
5+
<classpathentry kind="output" path="bin/default"/>
6+
</classpath>

geolocator_android/android/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
arguments=
2+
auto.sync=false
3+
build.scans.enabled=false
4+
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(6.3))
5+
connection.project.dir=
6+
eclipse.preferences.version=1
7+
gradle.user.home=
8+
java.home=/Users/maurits/Library/Java/JavaVirtualMachines/openjdk-14.0.1/Contents/Home
9+
jvm.arguments=
10+
offline.mode=false
11+
override.workspace.settings=true
12+
show.console.view=true
13+
show.executions.view=true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
group 'com.baseflow.geolocator'
2+
version '1.0'
3+
def args = ["-Xlint:deprecation","-Xlint:unchecked","-Werror"]
4+
5+
buildscript {
6+
repositories {
7+
google()
8+
jcenter()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:3.5.0'
13+
}
14+
}
15+
16+
rootProject.allprojects {
17+
repositories {
18+
google()
19+
jcenter()
20+
}
21+
}
22+
23+
project.getTasks().withType(JavaCompile){
24+
options.compilerArgs.addAll(args)
25+
}
26+
27+
apply plugin: 'com.android.library'
28+
29+
android {
30+
compileSdkVersion 29
31+
32+
defaultConfig {
33+
minSdkVersion 16
34+
}
35+
lintOptions {
36+
disable 'InvalidPackage'
37+
}
38+
compileOptions {
39+
sourceCompatibility JavaVersion.VERSION_1_8
40+
targetCompatibility JavaVersion.VERSION_1_8
41+
}
42+
}
43+
44+
dependencies {
45+
implementation 'com.google.android.gms:play-services-location:17.0.0'
46+
}
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.6.2-all.zip
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'geolocator'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.baseflow.geolocator">
3+
</manifest>

0 commit comments

Comments
 (0)