ios_content_validation_test.dart 1.34 KB
Newer Older
1 2 3 4 5 6
// Copyright 2014 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.

import 'package:flutter_devicelab/framework/apk_utils.dart';
import 'package:flutter_devicelab/framework/framework.dart';
7
import 'package:flutter_devicelab/framework/task_result.dart';
8 9 10 11 12 13 14
import 'package:flutter_devicelab/framework/utils.dart';
import 'package:path/path.dart' as path;

Future<void> main() async {
  await task(() async {
    try {
      await runProjectTest((FlutterProject flutterProject) async {
15 16 17 18 19 20 21 22
        section('Archive');

        await inDirectory(flutterProject.rootPath, () async {
          await flutter('build', options: <String>[
            'xcarchive',
          ]);
        });

23
        final String archivePath = path.join(
24 25 26 27 28
          flutterProject.rootPath,
          'build',
          'ios',
          'archive',
          'Runner.xcarchive',
29 30 31 32
        );

        checkDirectoryExists(path.join(
          archivePath,
33 34
          'Products',
        ));
35 36 37 38 39 40

        checkDirectoryExists(path.join(
          archivePath,
          'dSYMs',
          'Runner.app.dSYM',
        ));
41
      });
42

43 44 45 46 47 48 49 50
      return TaskResult.success(null);
    } on TaskResult catch (taskResult) {
      return taskResult;
    } catch (e) {
      return TaskResult.failure(e.toString());
    }
  });
}