From d60997b9f6f9e6ad37249f5265a1511a30dc1939 Mon Sep 17 00:00:00 2001 From: shuyangzhou Date: Fri, 16 Apr 2021 21:26:03 -0700 Subject: [PATCH] Hardcode portal-test dependency for all tests, will clean up the hardcode later. --- src/com/liferay/netbeansproject/container/Module.java | 7 +++++++ src/com/liferay/netbeansproject/util/GradleUtil.java | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/liferay/netbeansproject/container/Module.java b/src/com/liferay/netbeansproject/container/Module.java index 835d1487..7539080d 100644 --- a/src/com/liferay/netbeansproject/container/Module.java +++ b/src/com/liferay/netbeansproject/container/Module.java @@ -522,6 +522,13 @@ private Module( _portalModuleDependencies = portalModuleDependencies; _checksum = checksum; _jdkVersion = jdkVersion; + + if ((_testUnitPath != null) || (_testIntegrationPath != null)) { + Path portalTest = _projectPath.resolve("portal-test"); + + _moduleDependencies.add( + new Dependency(portalTest, portalTest.resolve("src"), true)); + } } private void _save() throws IOException { diff --git a/src/com/liferay/netbeansproject/util/GradleUtil.java b/src/com/liferay/netbeansproject/util/GradleUtil.java index 73119126..6b8e9981 100644 --- a/src/com/liferay/netbeansproject/util/GradleUtil.java +++ b/src/com/liferay/netbeansproject/util/GradleUtil.java @@ -181,7 +181,7 @@ public static Set getModuleDependencies( Path buildGradlePath = modulePath.resolve("build.gradle"); if (!Files.exists(buildGradlePath)) { - return Collections.emptySet(); + return new HashSet<>(); } Set moduleDependencies = new HashSet<>();