[ci] Continue .cirrus.yml alignment with flutter/plugins (#2832)

* Enable more repo checks

* Remove Android from Pigeon iOS test app

* Add various mostly-no-op tasks

* Remove unused Java generation in ObjC test
This commit is contained in:
stuartmorgan
2022-11-21 13:41:24 -05:00
committed by GitHub
parent 4419bdffce
commit a6835840e2
25 changed files with 215 additions and 796 deletions

View File

@ -107,6 +107,7 @@ task:
# has been fixed, this can be removed and there can just be a single # has been fixed, this can be removed and there can just be a single
# run with --require-excerpts and no exclusions. # run with --require-excerpts and no exclusions.
- ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml - ./script/tool_runner.sh readme-check --require-excerpts --exclude=script/configs/temp_exclude_excerpt.yaml
dependabot_script: $PLUGIN_TOOL_COMMAND dependabot-check
version_script: version_script:
# For pre-submit, pass the PR labels to the script to allow for # For pre-submit, pass the PR labels to the script to allow for
# check overrides. # check overrides.
@ -119,6 +120,14 @@ task:
- ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS" - ./script/tool_runner.sh version-check --check-for-missing-changes --pr-labels="$CIRRUS_PR_LABELS"
- fi - fi
publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release publishable_script: ./script/tool_runner.sh publish-check --allow-pre-release
federated_safety_script:
# This check is only meaningful for PRs, as it validates changes
# rather than state.
- if [[ $CIRRUS_PR == "" ]]; then
- ./script/tool_runner.sh federation-safety-check
- else
- echo "Only run in presubmit"
- fi
- name: dart_unit_tests - name: dart_unit_tests
env: env:
matrix: matrix:
@ -220,6 +229,19 @@ task:
CHANNEL: "master" CHANNEL: "master"
CHANNEL: "stable" CHANNEL: "stable"
<< : *BUILD_ALL_PACKAGES_APP_TEMPLATE << : *BUILD_ALL_PACKAGES_APP_TEMPLATE
- name: linux-platform_tests
# Don't run full platform tests on both channels in pre-submit.
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
- ./script/tool_runner.sh build-examples --linux
native_test_script:
- xvfb-run ./script/tool_runner.sh native-test --linux --no-integration
drive_script:
- xvfb-run ./script/tool_runner.sh drive-examples --linux
# Heavy-workload Linux tasks. # Heavy-workload Linux tasks.
# These use machines with more CPUs and memory, so will reduce parallelization # These use machines with more CPUs and memory, so will reduce parallelization
@ -251,8 +273,16 @@ task:
# extension_google_sign_in_as_googleapis_auth is currently not building, see # extension_google_sign_in_as_googleapis_auth is currently not building, see
# https://github.com/flutter/flutter/issues/89301 # https://github.com/flutter/flutter/issues/89301
- ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth - ./script/tool_runner.sh build-examples --apk --exclude=extension_google_sign_in_as_googleapis_auth
lint_script:
- ./script/tool_runner.sh lint-android # must come after build-examples
native_unit_test_scipt: native_unit_test_scipt:
- ./script/tool_runner.sh native-test --android --no-integration - ./script/tool_runner.sh native-test --android --no-integration
# Upload the full lint results to Cirrus to display in the results UI.
always:
android-lint_artifacts:
path: "**/reports/lint-results-debug.xml"
type: text/xml
format: android-lint
- name: android-build_all_packages - name: android-build_all_packages
env: env:
BUILD_ALL_ARGS: "apk" BUILD_ALL_ARGS: "apk"
@ -290,25 +320,13 @@ task:
- cd ../.. - cd ../..
- flutter packages get - flutter packages get
- dart testing/web_benchmarks_test.dart - dart testing/web_benchmarks_test.dart
### Linux desktop tasks ###
- name: linux-platform_tests
# Don't run full platform tests on both channels in pre-submit.
skip: $CIRRUS_PR != '' && $CHANNEL == 'stable'
env:
matrix:
CHANNEL: "master"
CHANNEL: "stable"
build_script:
- ./script/tool_runner.sh build-examples --linux
native_test_script:
- ./script/tool_runner.sh native-test --linux --no-integration
# ARM macOS tasks.
task: task:
<< : *FLUTTER_UPGRADE_TEMPLATE << : *FLUTTER_UPGRADE_TEMPLATE
<< : *MACOS_ARM_TEMPLATE << : *MACOS_ARM_TEMPLATE
matrix: matrix:
- name: macos-custom_package_tests - name: macos-custom_package_tests
# Run on macOS x64 image with Java runtime installed.
env: env:
PATH: $PATH:/usr/local/bin PATH: $PATH:/usr/local/bin
matrix: matrix:
@ -340,6 +358,16 @@ task:
- ./script/tool_runner.sh build-examples --ios - ./script/tool_runner.sh build-examples --ios
native_test_script: native_test_script:
- ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 13,OS=latest" - ./script/tool_runner.sh native-test --ios --ios-destination "platform=iOS Simulator,name=iPhone 13,OS=latest"
drive_script:
# `drive-examples` contains integration tests, which changes the UI of the application.
# This UI change sometimes affects `xctest`.
# So we run `drive-examples` after `native-test`; changing the order will result ci failure.
- ./script/tool_runner.sh drive-examples --ios
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --ios
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --ios --ios-min-version=13.0
### iOS tasks ### ### iOS tasks ###
- name: ios-build_all_packages - name: ios-build_all_packages
env: env:
@ -359,8 +387,15 @@ task:
PATH: $PATH:/usr/local/bin PATH: $PATH:/usr/local/bin
build_script: build_script:
- ./script/tool_runner.sh build-examples --macos - ./script/tool_runner.sh build-examples --macos
xcode_analyze_script:
- ./script/tool_runner.sh xcode-analyze --macos
xcode_analyze_deprecation_script:
# Ensure we don't accidentally introduce deprecated code.
- ./script/tool_runner.sh xcode-analyze --macos --macos-min-version=12.3
native_test_script: native_test_script:
- ./script/tool_runner.sh native-test --macos - ./script/tool_runner.sh native-test --macos
drive_script:
- ./script/tool_runner.sh drive-examples --macos
# Intel macOS tasks. # Intel macOS tasks.
task: task:

167
.github/dependabot.yml vendored
View File

@ -22,3 +22,170 @@ updates:
labels: labels:
- "team" - "team"
- "team: infra" - "team: infra"
- package-ecosystem: "gradle"
directory: "/packages/animations/example/android/app"
commit-message:
prefix: "[animations]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/dynamic_layouts/example/android/app"
commit-message:
prefix: "[dynamic_lyts]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/extension_google_sign_in_as_googleapis_auth/example/android/app"
commit-message:
prefix: "[ext_sign_in]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/flutter_adaptive_scaffold/example/android/app"
commit-message:
prefix: "[scaffold]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/flutter_markdown/example/android/app"
commit-message:
prefix: "[markdown]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/go_router/example/android/app"
commit-message:
prefix: "[go_router]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app"
commit-message:
prefix: "[imitation]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/palette_generator/example/android/app"
commit-message:
prefix: "[palette_gen]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/pigeon/platform_tests/test_plugin/android"
commit-message:
prefix: "[pigeon]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "com.android.tools.build:gradle"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "junit:junit"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "org.mockito:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "androidx.test:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "org.robolectric:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/pigeon/platform_tests/test_plugin/example/android/app"
commit-message:
prefix: "[pigeon]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/pigeon/platform_tests/alternate_language_test_plugin/android"
commit-message:
prefix: "[pigeon]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "com.android.tools.build:gradle"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "junit:junit"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "org.mockito:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "androidx.test:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- dependency-name: "org.robolectric:*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/app"
commit-message:
prefix: "[pigeon]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/rfw/example/hello/android/app"
commit-message:
prefix: "[rfw]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/rfw/example/local/android/app"
commit-message:
prefix: "[rfw]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]
- package-ecosystem: "gradle"
directory: "/packages/rfw/example/remote/android/app"
commit-message:
prefix: "[rfw]"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-minor", "version-update:semver-patch"]

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1654625234632</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@ -1,13 +0,0 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk-11.0.4.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1654625234643</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@ -1,2 +0,0 @@
connection.project.dir=..
eclipse.preferences.version=1

View File

@ -1,67 +0,0 @@
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 plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.test_objc"
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 {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

View File

@ -1,7 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test_objc">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@ -1,25 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test_objc">
<application
android:name="${applicationName}"
android:label="test_objc"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
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>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@ -1,501 +0,0 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Autogenerated from Pigeon (v4.0.2), do not edit directly.
// See also: https://pub.dev/packages/pigeon
package dev.flutter.aaclarke.pigeon;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.StandardMessageCodec;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/** Generated class from Pigeon. */
@SuppressWarnings({"unused", "unchecked", "CodeBlock2Expr", "RedundantSuppression"})
public class MessagePigeon {
public enum MessageRequestState {
PENDING(0),
SUCCESS(1),
FAILURE(2);
private int index;
private MessageRequestState(final int index) {
this.index = index;
}
}
/** Generated class from Pigeon that represents data sent in messages. */
public static class MessageSearchRequest {
private @Nullable String query;
public @Nullable String getQuery() {
return query;
}
public void setQuery(@Nullable String setterArg) {
this.query = setterArg;
}
private @Nullable Long anInt;
public @Nullable Long getAnInt() {
return anInt;
}
public void setAnInt(@Nullable Long setterArg) {
this.anInt = setterArg;
}
private @Nullable Boolean aBool;
public @Nullable Boolean getABool() {
return aBool;
}
public void setABool(@Nullable Boolean setterArg) {
this.aBool = setterArg;
}
public static final class Builder {
private @Nullable String query;
public @NonNull Builder setQuery(@Nullable String setterArg) {
this.query = setterArg;
return this;
}
private @Nullable Long anInt;
public @NonNull Builder setAnInt(@Nullable Long setterArg) {
this.anInt = setterArg;
return this;
}
private @Nullable Boolean aBool;
public @NonNull Builder setABool(@Nullable Boolean setterArg) {
this.aBool = setterArg;
return this;
}
public @NonNull MessageSearchRequest build() {
MessageSearchRequest pigeonReturn = new MessageSearchRequest();
pigeonReturn.setQuery(query);
pigeonReturn.setAnInt(anInt);
pigeonReturn.setABool(aBool);
return pigeonReturn;
}
}
@NonNull
Map<String, Object> toMap() {
Map<String, Object> toMapResult = new HashMap<>();
toMapResult.put("query", query);
toMapResult.put("anInt", anInt);
toMapResult.put("aBool", aBool);
return toMapResult;
}
static @NonNull MessageSearchRequest fromMap(@NonNull Map<String, Object> map) {
MessageSearchRequest pigeonResult = new MessageSearchRequest();
Object query = map.get("query");
pigeonResult.setQuery((String) query);
Object anInt = map.get("anInt");
pigeonResult.setAnInt(
(anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt));
Object aBool = map.get("aBool");
pigeonResult.setABool((Boolean) aBool);
return pigeonResult;
}
}
/** Generated class from Pigeon that represents data sent in messages. */
public static class MessageSearchReply {
private @Nullable String result;
public @Nullable String getResult() {
return result;
}
public void setResult(@Nullable String setterArg) {
this.result = setterArg;
}
private @Nullable String error;
public @Nullable String getError() {
return error;
}
public void setError(@Nullable String setterArg) {
this.error = setterArg;
}
private @Nullable MessageRequestState state;
public @Nullable MessageRequestState getState() {
return state;
}
public void setState(@Nullable MessageRequestState setterArg) {
this.state = setterArg;
}
public static final class Builder {
private @Nullable String result;
public @NonNull Builder setResult(@Nullable String setterArg) {
this.result = setterArg;
return this;
}
private @Nullable String error;
public @NonNull Builder setError(@Nullable String setterArg) {
this.error = setterArg;
return this;
}
private @Nullable MessageRequestState state;
public @NonNull Builder setState(@Nullable MessageRequestState setterArg) {
this.state = setterArg;
return this;
}
public @NonNull MessageSearchReply build() {
MessageSearchReply pigeonReturn = new MessageSearchReply();
pigeonReturn.setResult(result);
pigeonReturn.setError(error);
pigeonReturn.setState(state);
return pigeonReturn;
}
}
@NonNull
Map<String, Object> toMap() {
Map<String, Object> toMapResult = new HashMap<>();
toMapResult.put("result", result);
toMapResult.put("error", error);
toMapResult.put("state", state == null ? null : state.index);
return toMapResult;
}
static @NonNull MessageSearchReply fromMap(@NonNull Map<String, Object> map) {
MessageSearchReply pigeonResult = new MessageSearchReply();
Object result = map.get("result");
pigeonResult.setResult((String) result);
Object error = map.get("error");
pigeonResult.setError((String) error);
Object state = map.get("state");
pigeonResult.setState(state == null ? null : MessageRequestState.values()[(int) state]);
return pigeonResult;
}
}
/** Generated class from Pigeon that represents data sent in messages. */
public static class MessageNested {
private @Nullable MessageSearchRequest request;
public @Nullable MessageSearchRequest getRequest() {
return request;
}
public void setRequest(@Nullable MessageSearchRequest setterArg) {
this.request = setterArg;
}
public static final class Builder {
private @Nullable MessageSearchRequest request;
public @NonNull Builder setRequest(@Nullable MessageSearchRequest setterArg) {
this.request = setterArg;
return this;
}
public @NonNull MessageNested build() {
MessageNested pigeonReturn = new MessageNested();
pigeonReturn.setRequest(request);
return pigeonReturn;
}
}
@NonNull
Map<String, Object> toMap() {
Map<String, Object> toMapResult = new HashMap<>();
toMapResult.put("request", (request == null) ? null : request.toMap());
return toMapResult;
}
static @NonNull MessageNested fromMap(@NonNull Map<String, Object> map) {
MessageNested pigeonResult = new MessageNested();
Object request = map.get("request");
pigeonResult.setRequest(
(request == null) ? null : MessageSearchRequest.fromMap((Map) request));
return pigeonResult;
}
}
private static class MessageApiCodec extends StandardMessageCodec {
public static final MessageApiCodec INSTANCE = new MessageApiCodec();
private MessageApiCodec() {}
@Override
protected Object readValueOfType(byte type, ByteBuffer buffer) {
switch (type) {
case (byte) 128:
return MessageSearchReply.fromMap((Map<String, Object>) readValue(buffer));
case (byte) 129:
return MessageSearchRequest.fromMap((Map<String, Object>) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
}
@Override
protected void writeValue(ByteArrayOutputStream stream, Object value) {
if (value instanceof MessageSearchReply) {
stream.write(128);
writeValue(stream, ((MessageSearchReply) value).toMap());
} else if (value instanceof MessageSearchRequest) {
stream.write(129);
writeValue(stream, ((MessageSearchRequest) value).toMap());
} else {
super.writeValue(stream, value);
}
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface MessageApi {
void initialize();
@NonNull
MessageSearchReply search(@NonNull MessageSearchRequest request);
/** The codec used by MessageApi. */
static MessageCodec<Object> getCodec() {
return MessageApiCodec.INSTANCE;
}
/** Sets up an instance of `MessageApi` to handle messages through the `binaryMessenger`. */
static void setup(BinaryMessenger binaryMessenger, MessageApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.MessageApi.initialize", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
api.initialize();
wrapped.put("result", null);
} catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.MessageApi.search", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
ArrayList<Object> args = (ArrayList<Object>) message;
MessageSearchRequest requestArg = (MessageSearchRequest) args.get(0);
if (requestArg == null) {
throw new NullPointerException("requestArg unexpectedly null.");
}
MessageSearchReply output = api.search(requestArg);
wrapped.put("result", output);
} catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
}
}
private static class MessageNestedApiCodec extends StandardMessageCodec {
public static final MessageNestedApiCodec INSTANCE = new MessageNestedApiCodec();
private MessageNestedApiCodec() {}
@Override
protected Object readValueOfType(byte type, ByteBuffer buffer) {
switch (type) {
case (byte) 128:
return MessageNested.fromMap((Map<String, Object>) readValue(buffer));
case (byte) 129:
return MessageSearchReply.fromMap((Map<String, Object>) readValue(buffer));
case (byte) 130:
return MessageSearchRequest.fromMap((Map<String, Object>) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
}
@Override
protected void writeValue(ByteArrayOutputStream stream, Object value) {
if (value instanceof MessageNested) {
stream.write(128);
writeValue(stream, ((MessageNested) value).toMap());
} else if (value instanceof MessageSearchReply) {
stream.write(129);
writeValue(stream, ((MessageSearchReply) value).toMap());
} else if (value instanceof MessageSearchRequest) {
stream.write(130);
writeValue(stream, ((MessageSearchRequest) value).toMap());
} else {
super.writeValue(stream, value);
}
}
}
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
public interface MessageNestedApi {
@NonNull
MessageSearchReply search(@NonNull MessageNested nested);
/** The codec used by MessageNestedApi. */
static MessageCodec<Object> getCodec() {
return MessageNestedApiCodec.INSTANCE;
}
/**
* Sets up an instance of `MessageNestedApi` to handle messages through the `binaryMessenger`.
*/
static void setup(BinaryMessenger binaryMessenger, MessageNestedApi api) {
{
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.MessageNestedApi.search", getCodec());
if (api != null) {
channel.setMessageHandler(
(message, reply) -> {
Map<String, Object> wrapped = new HashMap<>();
try {
ArrayList<Object> args = (ArrayList<Object>) message;
MessageNested nestedArg = (MessageNested) args.get(0);
if (nestedArg == null) {
throw new NullPointerException("nestedArg unexpectedly null.");
}
MessageSearchReply output = api.search(nestedArg);
wrapped.put("result", output);
} catch (Error | RuntimeException exception) {
wrapped.put("error", wrapError(exception));
}
reply.reply(wrapped);
});
} else {
channel.setMessageHandler(null);
}
}
}
}
private static class MessageFlutterSearchApiCodec extends StandardMessageCodec {
public static final MessageFlutterSearchApiCodec INSTANCE = new MessageFlutterSearchApiCodec();
private MessageFlutterSearchApiCodec() {}
@Override
protected Object readValueOfType(byte type, ByteBuffer buffer) {
switch (type) {
case (byte) 128:
return MessageSearchReply.fromMap((Map<String, Object>) readValue(buffer));
case (byte) 129:
return MessageSearchRequest.fromMap((Map<String, Object>) readValue(buffer));
default:
return super.readValueOfType(type, buffer);
}
}
@Override
protected void writeValue(ByteArrayOutputStream stream, Object value) {
if (value instanceof MessageSearchReply) {
stream.write(128);
writeValue(stream, ((MessageSearchReply) value).toMap());
} else if (value instanceof MessageSearchRequest) {
stream.write(129);
writeValue(stream, ((MessageSearchRequest) value).toMap());
} else {
super.writeValue(stream, value);
}
}
}
/** Generated class from Pigeon that represents Flutter messages that can be called from Java. */
public static class MessageFlutterSearchApi {
private final BinaryMessenger binaryMessenger;
public MessageFlutterSearchApi(BinaryMessenger argBinaryMessenger) {
this.binaryMessenger = argBinaryMessenger;
}
public interface Reply<T> {
void reply(T reply);
}
static MessageCodec<Object> getCodec() {
return MessageFlutterSearchApiCodec.INSTANCE;
}
public void search(
@NonNull MessageSearchRequest requestArg, Reply<MessageSearchReply> callback) {
BasicMessageChannel<Object> channel =
new BasicMessageChannel<>(
binaryMessenger, "dev.flutter.pigeon.MessageFlutterSearchApi.search", getCodec());
channel.send(
new ArrayList<Object>(Arrays.asList(requestArg)),
channelReply -> {
@SuppressWarnings("ConstantConditions")
MessageSearchReply output = (MessageSearchReply) channelReply;
callback.reply(output);
});
}
}
private static Map<String, Object> wrapError(Throwable exception) {
Map<String, Object> errorMap = new HashMap<>();
errorMap.put("message", exception.toString());
errorMap.put("code", exception.getClass().getSimpleName());
errorMap.put(
"details",
"Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception));
return errorMap;
}
}

View File

@ -1,15 +0,0 @@
// Copyright 2013 The Flutter 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 com.example.test_objc
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
</resources>

View File

@ -1,7 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test_objc">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>

View File

@ -1,31 +0,0 @@
buildscript {
ext.kotlin_version = '1.6.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}

View File

@ -1,4 +0,0 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

View File

@ -1,6 +0,0 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip

View File

@ -1,15 +0,0 @@
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}

View File

@ -252,13 +252,11 @@ run_ios_e2e_tests() {
DARTLE_H="e2e_tests/test_objc/ios/Runner/dartle.h" DARTLE_H="e2e_tests/test_objc/ios/Runner/dartle.h"
DARTLE_M="e2e_tests/test_objc/ios/Runner/dartle.m" DARTLE_M="e2e_tests/test_objc/ios/Runner/dartle.m"
DARTLE_DART="e2e_tests/test_objc/lib/dartle.dart" DARTLE_DART="e2e_tests/test_objc/lib/dartle.dart"
PIGEON_JAVA="e2e_tests/test_objc/android/app/src/main/java/io/flutter/plugins/Pigeon.java"
$run_pigeon \ $run_pigeon \
--input pigeons/message.dart \ --input pigeons/message.dart \
--dart_out $DARTLE_DART \ --dart_out $DARTLE_DART \
--objc_header_out $DARTLE_H \ --objc_header_out $DARTLE_H \
--objc_source_out $DARTLE_M \ --objc_source_out $DARTLE_M \
--java_out $PIGEON_JAVA
dart format $DARTLE_DART dart format $DARTLE_DART
pushd $PWD pushd $PWD