makefile.dart 680 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6 7 8 9 10 11 12 13
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import '../project.dart';

// The setting that controls the executable name in the linux makefile.
const String _kBinaryNameVariable = 'BINARY_NAME=';

/// Extracts the `BINARY_NAME` from a linux project Makefile.
///
/// Returns `null` if it cannot be found.
String makefileExecutableName(LinuxProject project) {
14
  for (final String line in project.makeFile.readAsLinesSync()) {
15 16 17 18 19
    if (line.startsWith(_kBinaryNameVariable)) {
      return line.split(_kBinaryNameVariable).last.trim();
    }
  }
  return null;
Dan Field's avatar
Dan Field committed
20
}