Skip to content

Commit

Permalink
Revert "Remove autoninja calls from the analyze script. (flutter#26752)…
Browse files Browse the repository at this point in the history
…" (flutter#26812)

This reverts commit e274d31.
  • Loading branch information
godofredoc authored Jun 17, 2021
1 parent e274d31 commit 399917c
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ci/analyze.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function analyze() (
)

echo "Analyzing dart:ui library..."
autoninja -C "$SRC_DIR/out/host_debug_unopt" generate_dart_ui
analyze \
--options "$FLUTTER_DIR/analysis_options.yaml" \
"$SRC_DIR/out/host_debug_unopt/gen/sky/bindings/dart_ui/ui.dart"
Expand Down Expand Up @@ -106,6 +107,8 @@ analyze \
"$FLUTTER_DIR/testing/smoke_test_failure"

echo "Analyzing testing/dart..."
"$FLUTTER_DIR/tools/gn" --unoptimized
autoninja -C "$SRC_DIR/out/host_debug_unopt" sky_engine sky_services
(cd "$FLUTTER_DIR/testing/dart" && "$PUB" get --offline)
analyze \
--packages="$FLUTTER_DIR/testing/dart/.dart_tool/package_config.json" \
Expand Down
80 changes: 75 additions & 5 deletions testing/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,89 @@ def RunDartTest(build_dir, test_packages, dart_file, verbose_dart_snapshot, mult

def EnsureDebugUnoptSkyPackagesAreBuilt():
variant_out_dir = os.path.join(out_dir, 'host_debug_unopt')
assert os.path.exists(variant_out_dir), "%s doesn't exist. Run GN to generate the directory first" % variant_out_dir

ninja_command = [
'ninja',
'-C',
variant_out_dir,
'flutter/sky/packages'
]

# Attempt running Ninja if the out directory exists.
# We don't want to blow away any custom GN args the caller may have already set.
if os.path.exists(variant_out_dir):
RunCmd(ninja_command, cwd=buildroot_dir)
return

gn_command = [
os.path.join(buildroot_dir, 'flutter', 'tools', 'gn'),
'--runtime-mode',
'debug',
'--unopt',
'--no-lto',
]

RunCmd(gn_command, cwd=buildroot_dir)
RunCmd(ninja_command, cwd=buildroot_dir)


def EnsureJavaTestsAreBuilt(android_out_dir):
"""Builds the engine variant and the test jar containing the JUnit tests"""
tmp_out_dir = os.path.join(out_dir, android_out_dir)
assert os.path.exists(tmp_out_dir), "%s doesn't exist. Run GN to generate the directory first" % android_out_dir
ninja_command = [
'autoninja',
'-C',
android_out_dir,
'flutter/shell/platform/android:robolectric_tests'
]

# Attempt running Ninja if the out directory exists.
# We don't want to blow away any custom GN args the caller may have already set.
if os.path.exists(android_out_dir):
RunCmd(ninja_command, cwd=buildroot_dir)
return

assert android_out_dir != "out/android_debug_unopt", "%s doesn't exist. Run GN to generate the directory first" % android_out_dir

# Otherwise prepare the directory first, then build the test.
gn_command = [
os.path.join(buildroot_dir, 'flutter', 'tools', 'gn'),
'--android',
'--unoptimized',
'--runtime-mode=debug',
'--no-lto',
]
RunCmd(gn_command, cwd=buildroot_dir)
RunCmd(ninja_command, cwd=buildroot_dir)


def EnsureIosTestsAreBuilt(ios_out_dir):
"""Builds the engine variant and the test dylib containing the XCTests"""
tmp_out_dir = os.path.join(out_dir, ios_out_dir)
assert os.path.exists(tmp_out_dir), "%s doesn't exist. Run GN to generate the directory first" % ios_out_dir
ninja_command = [
'autoninja',
'-C',
ios_out_dir,
'ios_test_flutter'
]

# Attempt running Ninja if the out directory exists.
# We don't want to blow away any custom GN args the caller may have already set.
if os.path.exists(ios_out_dir):
RunCmd(ninja_command, cwd=buildroot_dir)
return

assert ios_out_dir != "out/ios_debug_sim_unopt", "%s doesn't exist. Run GN to generate the directory first" % ios_out_dir

# Otherwise prepare the directory first, then build the test.
gn_command = [
os.path.join(buildroot_dir, 'flutter', 'tools', 'gn'),
'--ios',
'--unoptimized',
'--runtime-mode=debug',
'--no-lto',
'--simulator'
]
RunCmd(gn_command, cwd=buildroot_dir)
RunCmd(ninja_command, cwd=buildroot_dir)


def AssertExpectedJavaVersion():
Expand Down

0 comments on commit 399917c

Please sign in to comment.