Skip to content

Commit 4ad71d8

Browse files
authored
Merge pull request #2 from FireJuun/demo/6_sandbox
Demo/6 sandbox
2 parents 24d98ca + bd792a7 commit 4ad71d8

31 files changed

+1967
-37
lines changed

android/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ if (flutterVersionName == null) {
2424
apply plugin: 'com.android.application'
2525
apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27+
apply plugin: 'com.google.gms.google-services'
2728

2829
android {
2930
compileSdkVersion 28
@@ -39,7 +40,7 @@ android {
3940
defaultConfig {
4041
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4142
applicationId "com.firejuun.symptom_tracker"
42-
minSdkVersion 16
43+
minSdkVersion 21
4344
targetSdkVersion 28
4445
versionCode flutterVersionCode.toInteger()
4546
versionName flutterVersionName

android/app/google-services.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"project_info": {
3+
"project_number": "747077780555",
4+
"firebase_url": "https://symptom-tracker1.firebaseio.com",
5+
"project_id": "symptom-tracker1",
6+
"storage_bucket": "symptom-tracker1.appspot.com"
7+
},
8+
"client": [
9+
{
10+
"client_info": {
11+
"mobilesdk_app_id": "1:747077780555:android:32ac38f7e9f319366579ce",
12+
"android_client_info": {
13+
"package_name": "com.firejuun.symptom_tracker"
14+
}
15+
},
16+
"oauth_client": [
17+
{
18+
"client_id": "747077780555-mvpjfbql7mpbup48p85k0pqk1jujire1.apps.googleusercontent.com",
19+
"client_type": 1,
20+
"android_info": {
21+
"package_name": "com.firejuun.symptom_tracker",
22+
"certificate_hash": "706fee551d06f90f67673719354a56cbf78296b3"
23+
}
24+
},
25+
{
26+
"client_id": "747077780555-s40ds4u5718tegokl9j7lk4lbqt57rd5.apps.googleusercontent.com",
27+
"client_type": 3
28+
}
29+
],
30+
"api_key": [
31+
{
32+
"current_key": "AIzaSyAw4PduFqxFUAQvGcfL2_ognDsdBGHa7mc"
33+
}
34+
],
35+
"services": {
36+
"appinvite_service": {
37+
"other_platform_oauth_client": [
38+
{
39+
"client_id": "747077780555-s40ds4u5718tegokl9j7lk4lbqt57rd5.apps.googleusercontent.com",
40+
"client_type": 3
41+
},
42+
{
43+
"client_id": "747077780555-6ji78ufk74i8vibhl3infaqktfa9nfbh.apps.googleusercontent.com",
44+
"client_type": 2,
45+
"ios_info": {
46+
"bundle_id": "com.firejuun.symptomTracker"
47+
}
48+
}
49+
]
50+
}
51+
}
52+
}
53+
],
54+
"configuration_version": "1"
55+
}

android/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ buildscript {
88
dependencies {
99
classpath 'com.android.tools.build:gradle:3.5.0'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11+
classpath 'com.google.gms:google-services:4.3.3'
1112
}
1213
}
1314

android/settings.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
// Copyright 2014 The Flutter 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-
51
include ':app'
62

7-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8-
def properties = new Properties()
3+
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
94

10-
assert localPropertiesFile.exists()
11-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
5+
def plugins = new Properties()
6+
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7+
if (pluginsFile.exists()) {
8+
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9+
}
1210

13-
def flutterSdkPath = properties.getProperty("flutter.sdk")
14-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
11+
plugins.each { name, path ->
12+
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13+
include ":$name"
14+
project(":$name").projectDir = pluginDirectory
15+
}

ios/Flutter/Debug.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
12
#include "Generated.xcconfig"

ios/Flutter/Release.xcconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

ios/Podfile

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def parse_KV_file(file, separator='=')
14+
file_abs_path = File.expand_path(file)
15+
if !File.exists? file_abs_path
16+
return [];
17+
end
18+
generated_key_values = {}
19+
skip_line_start_symbols = ["#", "/"]
20+
File.foreach(file_abs_path) do |line|
21+
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
22+
plugin = line.split(pattern=separator)
23+
if plugin.length == 2
24+
podname = plugin[0].strip()
25+
path = plugin[1].strip()
26+
podpath = File.expand_path("#{path}", file_abs_path)
27+
generated_key_values[podname] = podpath
28+
else
29+
puts "Invalid plugin specification: #{line}"
30+
end
31+
end
32+
generated_key_values
33+
end
34+
35+
target 'Runner' do
36+
use_frameworks!
37+
use_modular_headers!
38+
39+
# Flutter Pod
40+
41+
copied_flutter_dir = File.join(__dir__, 'Flutter')
42+
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
43+
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
44+
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
45+
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
46+
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
47+
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
48+
49+
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
50+
unless File.exist?(generated_xcode_build_settings_path)
51+
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
52+
end
53+
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
54+
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
55+
56+
unless File.exist?(copied_framework_path)
57+
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
58+
end
59+
unless File.exist?(copied_podspec_path)
60+
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
61+
end
62+
end
63+
64+
# Keep pod path relative so it can be checked into Podfile.lock.
65+
pod 'Flutter', :path => 'Flutter'
66+
67+
# Plugin Pods
68+
69+
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
70+
# referring to absolute paths on developers' machines.
71+
system('rm -rf .symlinks')
72+
system('mkdir -p .symlinks/plugins')
73+
plugin_pods = parse_KV_file('../.flutter-plugins')
74+
plugin_pods.each do |name, path|
75+
symlink = File.join('.symlinks', 'plugins', name)
76+
File.symlink(path, symlink)
77+
pod name, :path => File.join(symlink, 'ios')
78+
end
79+
end
80+
81+
post_install do |installer|
82+
installer.pods_project.targets.each do |target|
83+
target.build_configurations.each do |config|
84+
config.build_settings['ENABLE_BITCODE'] = 'NO'
85+
end
86+
end
87+
end

0 commit comments

Comments
 (0)