EXTRA_DISTFILES = \
Test/resources/TestTasks.cs \
Test/resources/*.*proj \
- Test/resources/*.csproj \
- Test/test-config-file*
+ Test/resources/*.csproj
Test/resources/TestTasks.dll: Test/resources/TestTasks.cs
$(CSCOMPILE) Test/resources/TestTasks.cs /r:$(XBUILD_FRAMEWORK) /r:$(XBUILD_UTILITIES) /target:library
-clean-local: clean-test-tasks
-
-clean-test-tasks:
+clean-test-resources:
rm -f Test/resources/TestTasks.dll
-test-local: copy-config
-
-ifeq (net_4_0, $(PROFILE))
-copy-config:
- cp Test/test-config-file-net-4.0 $(test_lib).config
-else
-ifeq (net_3_5, $(PROFILE))
-copy-config:
- cp Test/test-config-file-net-3.5 $(test_lib).config
-else
-copy-config:
-endif
-endif
-
-export TESTING_MONO=a
-include $(XBUILD_DIR)/xbuild_targets.make
-
test-local: Test/resources/TestTasks.dll
+clean-local: clean-test-resources
+
+include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
public static string BinPath {
get {
- if (RunningOnMono ())
- return "../../tools/xbuild/xbuild";
- else
+ if (RunningOnMono ()) {
+#if XBUILD_12
+ string profile = "xbuild_12";
+#elif NET_4_5
+ string profile = "net_4_5";
+#elif NET_4_0
+ string profile = "net_4_0";
+#elif NET_3_5
+ string profile = "net_3_5";
+#else
+ string profile = "net_2_0";
+#endif
+ var corlib = typeof (object).Assembly.Location;
+ var lib = Path.GetDirectoryName (Path.GetDirectoryName (corlib));
+ return Path.Combine (lib, profile);
+ } else {
+#if XBUILD_12
+ return ToolLocationHelper.GetPathToBuildTools ("12.0");
+#elif NET_4_5
+ return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version45);
+#elif NET_4_0
+ return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40);
+#elif NET_3_5
+ return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35);
+#else
return ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20);
+#endif
+ }
}
}
public static string ToolsVersionString {
get {
-#if NET_4_0
+#if XBUILD_12
+ return " ToolsVersion='12.0'";
+#elif NET_4_0
return " ToolsVersion='4.0'";
#elif NET_3_5
return " ToolsVersion='3.5'";
public static string GetTasksAsmPath ()
{
-#if NET_4_0
- return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version40), "Microsoft.Build.Tasks.v4.0.dll");
+#if XBUILD_12
+ return Path.Combine (BinPath, "Microsoft.Build.Tasks.v12.0.dll");
+#elif NET_4_0
+ return Path.Combine (BinPath, "Microsoft.Build.Tasks.v4.0.dll");
#elif NET_3_5
- return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version35), "Microsoft.Build.Tasks.v3.5.dll");
+ return Path.Combine (BinPath, "Microsoft.Build.Tasks.v3.5.dll");
#else
- return Path.Combine (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20), "Microsoft.Build.Tasks.dll");
+ return Path.Combine (BinPath, "Microsoft.Build.Tasks.dll");
#endif
}
}
+++ /dev/null
-<?xml version ="1.0"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="3.5.0.0"/>
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
+++ /dev/null
-<?xml version ="1.0"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
- <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="4.0.0.0"/>
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
/r:$(corlib) \
/r:System.dll
-include ../../build/library.make
-
-export TESTING_MONO=a
-include $(XBUILD_DIR)/xbuild_targets.make
-
EXTRA_DISTFILES = \
Mono.XBuild.Framework/AssemblyLoadInfo.cs
+
+include ../../build/library.make
+include $(XBUILD_DIR)/xbuild_test.make
LIBRARY = Microsoft.Build.Tasks.dll
-# Some tests are explicitly testing Microsoft.Build.Tasks.v3.5.dll
-TEST_MONO_PATH = $(topdir)/class/lib/net_3_5$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0
-
LIBRARY_NAME = Microsoft.Build.Tasks$(NAME_SUFFIX).dll
LIB_MCS_FLAGS = \
Test/resources/junk.txt \
Test/test-config-file*
-test-local: Test/resources/test.dll
-
Test/resources/test.dll: Test/resources/test.cs
$(CSCOMPILE) -target:library Test/resources/test.cs
-clean-local: clean-test-dll
-
-clean-test-dll:
+clean-test-resources:
rm -f Test/resources/test.dll
-test-local: copy-config
-
-ifeq (net_4_5, $(PROFILE))
-copy-config:
- cp Test/test-config-file-net-4.0 $(test_lib).config
-else
-ifeq (net_4_0, $(PROFILE))
-copy-config:
- cp Test/test-config-file-net-4.0 $(test_lib).config
-else
-ifeq (net_3_5, $(PROFILE))
-copy-config:
- cp Test/test-config-file-net-3.5 $(test_lib).config
-else
-copy-config:
-endif
-endif
-endif
+test-local: Test/resources/test.dll
-export TESTING_MONO=a
-include $(XBUILD_DIR)/xbuild_targets.make
+clean-local: clean-test-resources
+include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
TEST_MCS_FLAGS = /r:$(XBUILD_FRAMEWORK) -r:System.dll -r:System.Core.dll
-export TESTING_MONO=a
-include $(XBUILD_DIR)/xbuild_targets.make
-
+include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
if (toolsVersion != "12.0")
return null;
+ if (Environment.GetEnvironmentVariable ("TESTING_MONO") != null)
+ return Path.Combine (lib_mono_dir, "xbuild_12");
+
if (runningOnDotNet) {
//see http://msdn.microsoft.com/en-us/library/vstudio/bb397428(v=vs.120).aspx
var programFiles = Environment.GetFolderPath (Environment.SpecialFolder.ProgramFilesX86);
include ../../build/library.make
-export TESTING_MONO=a
XBUILD_FRAMEWORK_FOLDERS_PATH=xbuild-testing
-include $(XBUILD_DIR)/xbuild_targets.make
+include $(XBUILD_DIR)/xbuild_test.make
/r:System.dll \
/r:System.Xml.dll
-export TESTING_MONO=a
-include $(XBUILD_DIR)/xbuild_targets.make
+include $(XBUILD_DIR)/xbuild_test.make
include ../../build/library.make
XBUILD_DIR=.
XBUILD_FRAMEWORKS_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework/
REDISTLIST_DIR=$(XBUILD_FRAMEWORKS_DIR)/v$(FRAMEWORK_VERSION)/RedistList
-include $(XBUILD_DIR)/xbuild_targets.make
+include $(XBUILD_DIR)/xbuild_test.make
install-local: install-extras
+++ /dev/null
-XBUILD_TARGETS_DIR=$(topdir)/tools/xbuild/xbuild
-
-test-local: copy-targets
-
-copy-targets:
- for p in net_2_0 net_3_5 net_4_0; do \
- cp $(XBUILD_TARGETS_DIR)/Microsoft.CSharp.targets $(topdir)/class/lib/$$p; \
- cp $(XBUILD_TARGETS_DIR)/Microsoft.VisualBasic.targets $(topdir)/class/lib/$$p; \
- done
- cp $(XBUILD_TARGETS_DIR)/2.0/Microsoft.Common.* $(topdir)/class/lib/net_2_0
- cp $(XBUILD_TARGETS_DIR)/3.5/Microsoft.Common.* $(topdir)/class/lib/net_3_5
- cp $(XBUILD_TARGETS_DIR)/4.0/Microsoft.Common.* $(topdir)/class/lib/net_4_0
-
-clean-local: clean-target-files
-
-clean-target-files:
- for p in net_2_0 net_3_5 net_4_0; do \
- rm -f $(topdir)/class/lib/$$p/Microsoft.Common.targets; \
- rm -f $(topdir)/class/lib/$$p/Microsoft.CSharp.targets; \
- rm -f $(topdir)/class/lib/$$p/Microsoft.VisualBasic.targets; \
- rm -f $(topdir)/class/lib/$$p/Microsoft.Common.tasks; \
- done
--- /dev/null
+XBUILD_TARGETS_DIR=$(topdir)/tools/xbuild/xbuild
+XBUILD_PROFILE_DIR=$(topdir)/class/lib/$(PROFILE)
+
+# makes xbuild look in the class/lib/$PROFILE build directories for targets etc
+export TESTING_MONO=a
+
+test-local: copy-targets $(test_lib).config
+
+copy-targets:
+ cp $(XBUILD_TARGETS_DIR)/$(XBUILD_VERSION)/Microsoft.Common.targets $(XBUILD_PROFILE_DIR)
+ cp $(XBUILD_TARGETS_DIR)/$(XBUILD_VERSION)/Microsoft.Common.tasks $(XBUILD_PROFILE_DIR)
+ cp $(XBUILD_TARGETS_DIR)/Microsoft.CSharp.targets $(XBUILD_PROFILE_DIR)
+ cp $(XBUILD_TARGETS_DIR)/Microsoft.VisualBasic.targets $(XBUILD_PROFILE_DIR)
+
+clean-local: clean-target-files clean-test-config
+
+clean-target-files:
+ rm -f $(XBUILD_PROFILE_DIR)/Microsoft.Common.targets
+ rm -f $(XBUILD_PROFILE_DIR)/Microsoft.Common.tasks
+ rm -f $(XBUILD_PROFILE_DIR)/Microsoft.CSharp.targets
+ rm -f $(XBUILD_PROFILE_DIR)/Microsoft.VisualBasic.targets
+
+$(test_lib).config: $(XBUILD_DIR)/xbuild.exe.config.in
+ sed -e 's/@XBUILD_ASSEMBLY_VERSION@/$(XBUILD_ASSEMBLY_VERSION)/g' $(XBUILD_DIR)/xbuild.exe.config.in > $(test_lib).config
+
+clean-test-config:
+ rm -f $(test_lib).config
+
+#allow tests to find older versions of libs
+ifneq (2.0, $(XBUILD_VERSION))
+TEST_MONO_PATH := $(topdir)/class/lib/net_2_0
+ifneq (3.5, $(XBUILD_VERSION))
+TEST_MONO_PATH := $(topdir)/class/lib/net_3_5$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH)
+ifneq (4.0, $(XBUILD_VERSION))
+TEST_MONO_PATH := $(topdir)/class/lib/net_4_5$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH)
+endif
+endif
+endif