generate static method

String generate({
  1. required String appName,
  2. required List<TargetPlatform> platforms,
})

The config, with the platforms set up and everything else commented out

Implementation

static String generate({required String appName, required List<TargetPlatform> platforms}) {
  List<String> lines = [
    "# build_pipe: $docsUrl",
    "build_pipe:",
    "  workflows:",
    "    default:",
    "      clean_flutter: true",
    "      generate_log: true",
    "      output: auto # auto | interactive | plain | verbose | json",
    ..._commented(6, [
      "xcode_derived_data_path_env_key: XCODE_DERIVED_PATH",
      "pre_platform_run:",
      "  build: dart run build_runner build --delete-conflicting-outputs",
      "  publish: sh ./scripts/pre_publish.sh",
      "post_platform_run:",
      "  build:",
      "    on_success: sh ./scripts/post_build.sh",
      "    finally: sh ./scripts/build_cleanup.sh",
      "  publish:",
      "    on_success: sh ./scripts/post_publish.sh",
      "    finally: sh ./scripts/publish_cleanup.sh",
    ]),
    "      platforms:",
    for (TargetPlatform platform in BPConfig.platformOrder) ...(platforms.contains(platform) ? _indented(8, _platform(platform, appName)) : _commented(8, _missingPlatform(platform))),
  ];
  return "${lines.join("\n")}\n";
}