Skip to content

Commit b255981

Browse files
authored
[build] Remove extraneous nuget restores (#599)
Ever since commit dec2e39, *every* **make**(1) target would result in running `nuget restore`, e.g.: $ make run-tests TESTS=bin/TestDebug/Java.Interop.Tools.JavaSource-Tests.dll nuget restore ... The `nuget restore` was both time consuming and irrelevant, and meant that `make` targets which *should* have been fast -- like `make all`, which shouldn't do anything after the initial `make prepare all`, would instead take multiple seconds to complete. Why was `nuget restore` always being invoked? $ make -d -n run-tests ... Must remake target `packages/NUnit.3.11.0/NUnit.3.11.0.nupkg'. nuget restore What happened is that commit dec2e39 changed various projects to be Short-Form SDK projects, which in turn alters the `packages` directory structure: instead of e.g. packages/NUnit.3.11.0/NUnit.3.11.0.nupkg the file is instead: packages/nunit/3.11.0/nunit.3.11.0.nupkg Note case and directory structure change, which in turn meant that the rule dependencies were *never* satisfied (unless you happened to have a `packages` directory from a pre-dec2e390 build…). We *could* fix up the `$(PACKAGES)` and `$(NUNIT_CONSOLE)` variables to use the new paths, but they're not actually *used* for anything anymore, so just remove them.
1 parent 2a59c40 commit b255981

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Makefile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ NATIVE_EXT = .so
1212
DLLMAP_OS_NAME = linux
1313
endif
1414

15-
PACKAGES = \
16-
packages/NUnit.3.11.0/NUnit.3.11.0.nupkg \
17-
packages/NUnit.Console.3.9.0/NUnit.Console.3.9.0.nupkg
18-
1915
PREPARE_EXTERNAL_FILES = \
2016
external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj
2117

@@ -39,8 +35,6 @@ PTESTS = \
3935
ATESTS = \
4036
bin/Test$(CONFIGURATION)/Android.Interop-Tests.dll
4137

42-
NUNIT_CONSOLE = packages/NUnit.ConsoleRunner.3.9.0/tools/nunit3-console.exe
43-
4438
BUILD_PROPS = bin/Build$(CONFIGURATION)/JdkInfo.props bin/Build$(CONFIGURATION)/MonoInfo.props
4539

4640
all: $(DEPENDENCIES) $(TESTS)
@@ -68,9 +62,10 @@ bin/Build$(CONFIGURATION)/Java.Interop.BootstrapTasks.dll: build-tools/Java.Inte
6862
$(wildcard build-tools/Java.Interop.BootstrapTasks/Java.Interop.BootstrapTasks/*.cs)
6963
$(MSBUILD) $(MSBUILD_FLAGS) /restore "$<"
7064

71-
prepare-external $(PREPARE_EXTERNAL_FILES): $(PACKAGES) $(NUNIT_CONSOLE)
65+
prepare-external $(PREPARE_EXTERNAL_FILES):
7266
git submodule update --init --recursive
7367
(cd external/xamarin-android-tools && $(MAKE) prepare)
68+
nuget restore
7469

7570
clean:
7671
-$(MSBUILD) $(MSBUILD_FLAGS) /t:Clean
@@ -80,9 +75,6 @@ clean:
8075
include build-tools/scripts/mono.mk
8176
include build-tools/scripts/jdk.mk
8277

83-
$(PACKAGES) $(NUNIT_CONSOLE):
84-
nuget restore
85-
8678
JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE = Java.Runtime.Environment.Override.dllmap
8779
ifeq ($(wildcard $(JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE)),)
8880
JAVA_RUNTIME_ENVIRONMENT_DLLMAP_OVERRIDE_CMD = '/@JAVA_RUNTIME_ENVIRONMENT_DLLMAP@/d'

0 commit comments

Comments
 (0)