From 57cda51f7ef04f9c23818541cf523ca4f0fa6d23 Mon Sep 17 00:00:00 2001 From: godofredoc <54371434+godofredoc@users.noreply.github.com> Date: Wed, 23 Sep 2020 16:52:02 -0700 Subject: [PATCH] Fix gradle_plugin_light_apk test. (#66496) --- dev/devicelab/lib/framework/apk_utils.dart | 9 ++++++--- dev/try_builders.json | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dev/devicelab/lib/framework/apk_utils.dart b/dev/devicelab/lib/framework/apk_utils.dart index 0dca599f35..33aabdaa47 100644 --- a/dev/devicelab/lib/framework/apk_utils.dart +++ b/dev/devicelab/lib/framework/apk_utils.dart @@ -8,6 +8,9 @@ import 'package:path/path.dart' as path; import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/utils.dart'; + +final String platformLineSep = Platform.isWindows ? '\r\n' : '\n'; + final List flutterAssets = [ 'assets/flutter_assets/AssetManifest.json', 'assets/flutter_assets/NOTICES', @@ -267,8 +270,8 @@ subprojects { final File pubspec = File(path.join(rootPath, 'pubspec.yaml')); String content = await pubspec.readAsString(); content = content.replaceFirst( - '\ndependencies:\n', - '\ndependencies:\n $plugin:\n', + '${platformLineSep}dependencies:$platformLineSep', + '${platformLineSep}dependencies:$platformLineSep $plugin:$platformLineSep', ); await pubspec.writeAsString(content, flush: true); } @@ -315,7 +318,7 @@ android { path.join(parent.path, 'hello', 'pubspec.yaml') ); final String contents = pubspec.readAsStringSync(); - final String newContents = contents.replaceFirst('# The following section is specific to Flutter.\nflutter:\n', ''' + final String newContents = contents.replaceFirst('# The following section is specific to Flutter.${platformLineSep}flutter:$platformLineSep', ''' flutter: assets: - lib/gallery/example_code.dart diff --git a/dev/try_builders.json b/dev/try_builders.json index f5218d94d5..3f47ae9153 100644 --- a/dev/try_builders.json +++ b/dev/try_builders.json @@ -357,6 +357,13 @@ "enabled":true, "run_if":["dev/**", "bin/**"] }, + { + "name": "Windows gradle_plugin_light_apk_test", + "repo": "flutter", + "task_name": "win_gradle_plugin_light_apk_test", + "enabled":true, + "run_if":["dev/**", "bin/**"] + }, { "name": "Windows gradle_r8_test", "repo": "flutter",