Skip to content

Commit

Permalink
[cloud_functions] create no-op stubs for iOS/Android in cloud_functio…
Browse files Browse the repository at this point in the history
…ns_web (firebase#1908)

* create no-op stubs for iOS/Android in cloud_functions_web

* Update CHANGELOG

* Update version number to accomodate check.

* Remove AndroidX from no-op plugin implementation
  • Loading branch information
sbeitzel authored Jan 30, 2020
1 parent 8e7f774 commit 32a8126
Show file tree
Hide file tree
Showing 11 changed files with 130 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/cloud_functions/cloud_functions_web/.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: 659dc8129d4edb9166e9a0d600439d135740933f
channel: beta

project_type: plugin
4 changes: 4 additions & 0 deletions packages/cloud_functions/cloud_functions_web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

Add no-op plugin implementations for iOS and Android to enable builds.

## 1.0.0

Initial release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
43 changes: 43 additions & 0 deletions packages/cloud_functions/cloud_functions_web/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
group 'io.flutter.plugins.cloud_functions_web'
version '1.0'

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

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

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
}
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=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-4.10.2-all.zip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = 'cloud_functions_web'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.cloud_functions_web">
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.flutter.plugins.cloud_functions_web

import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
import io.flutter.plugin.common.MethodChannel.Result
import io.flutter.plugin.common.PluginRegistry.Registrar

/** CloudFunctionsWebPlugin */
public class CloudFunctionsWebPlugin: FlutterPlugin, MethodCallHandler {
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { }

// This static function is optional and equivalent to onAttachedToEngine. It supports the old
// pre-Flutter-1.12 Android projects. You are encouraged to continue supporting
// plugin registration via this function while apps migrate to use the new Android APIs
// post-flutter-1.12 via https://flutter.dev/go/android-project-migration.
//
// It is encouraged to share logic between onAttachedToEngine and registerWith to keep
// them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
// in the same class.
companion object {
@JvmStatic
fun registerWith(registrar: Registrar) { }
}

override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint cloud_functions_web.podspec' to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'cloud_functions_web'
s.version = '1.0.0'
s.summary = 'No-op implementation of cloud_functions_web plugin to avoid iOS build issues'
s.description = <<-DESC
Stub/fake cloud_functions_web plugin
DESC
s.homepage = 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_functions/cloud_functions_web'
s.license = { :file => '../LICENSE' }
s.author = { 'Flutter Team' => '[email protected]' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
s.swift_version = '5.0'
end
2 changes: 1 addition & 1 deletion packages/cloud_functions/cloud_functions_web/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: cloud_functions_web
description: The web implementation of cloud_functions
homepage: https://github.com/FirebaseExtended/flutterfire/tree/master/packages/cloud_functions/cloud_functions_web
version: 1.0.0
version: 1.0.1

flutter:
plugin:
Expand Down

0 comments on commit 32a8126

Please sign in to comment.