From f3ee011797e7429c17110525f0482af670dd40a6 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 13 Apr 2020 09:26:55 +0200 Subject: [PATCH] [xharness] Automatically generate xharness make dependencies. (#8324) --- tests/Makefile | 4 +++- tests/xharness/.gitignore | 1 + tools/common/create-makefile-fragment.sh | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 4b49b14ade3e..51e588434177 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -198,8 +198,10 @@ $(TOP)/tools/common/SdkVersions.cs: $(TOP)/tools/common/SdkVersions.cs.in @$(MAKE) -C $(TOP)/src project-files @touch $@ -xharness/xharness.exe: $(wildcard xharness/*.cs) $(wildcard $(TOP)/tools/bcl-test-importer/BCLTestImporter/*.cs) xharness/xharness.csproj $(TOP)/tools/common/SdkVersions.cs test.config test-system.config .stamp-src-project-files +xharness/xharness.exe: $(xharness_dependencies) test.config test-system.config .stamp-src-project-files $(Q_GEN) $(SYSTEM_MSBUILD) /restore $(MSBUILD_VERBOSITY_QUIET) xharness/xharness.csproj +xharness/xharness.csproj.inc: export ABSOLUTE_PATHS=1 +-include xharness/xharness.csproj.inc killall: @killall "iPhone Simulator" >/dev/null 2>&1 || true diff --git a/tests/xharness/.gitignore b/tests/xharness/.gitignore index d49d29fcf0c3..06d0cd9f45f9 100644 --- a/tests/xharness/.gitignore +++ b/tests/xharness/.gitignore @@ -1,2 +1,3 @@ +xharness.csproj.inc tmp-test-dir diff --git a/tools/common/create-makefile-fragment.sh b/tools/common/create-makefile-fragment.sh index 4c0013df6a87..76e5fa6ffb2b 100755 --- a/tools/common/create-makefile-fragment.sh +++ b/tools/common/create-makefile-fragment.sh @@ -86,7 +86,7 @@ for proj in $(sort "$REFERENCES_PATH" | uniq); do sed -i '' "s@^@$proj_dir/@" "$inputs_path" # Change to Make syntax. This is horrifically difficult in MSBuild, - # because MSBuild blindly replaces backslashes with forword slashes (i.e. + # because MSBuild blindly replaces backslashes with forward slashes (i.e. # windows paths to unix paths...) sed -i '' "s_^\\(.*\\)\$_ \\1 \\\\_" "$inputs_path" @@ -103,7 +103,9 @@ echo "${PROJECT}_dependencies = \\" >> "$FRAGMENT_PATH" sort "${INPUT_PATHS[@]}" | uniq >> "$FRAGMENT_PATH" # Simplify paths somewhat by removing the current directory -sed -i '' "s@$PROJECT_DIR/@@" "$FRAGMENT_PATH" +if test -z "$ABSOLUTE_PATHS"; then + sed -i '' "s@$PROJECT_DIR/@@" "$FRAGMENT_PATH" +fi # Cleanup rm -f "${INPUT_PATHS[@]}"