Skip to content

Commit

Permalink
INTELLIJ-288 includes the product in Blade invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrokke committed Jul 11, 2024
1 parent f9dc608 commit 29f11a8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.liferay.ide.idea.util.CoreUtil;
import com.liferay.ide.idea.util.IntellijUtil;
import com.liferay.ide.idea.util.LiferayWorkspaceSupport;
import com.liferay.release.util.ReleaseEntry;

import java.io.File;

Expand Down Expand Up @@ -200,6 +201,13 @@ public void setupRootModel(@NotNull ModifiableRootModel modifiableRootModel) {
args.add(targetPlatformVersion);
}

ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", targetPlatformVersion);

if (releaseEntry != null) {
args.add("--liferay-product");
args.add(releaseEntry.getProduct());
}

args.add("-t");
args.add(_type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,19 @@ else if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_GRADLE_WORKSPACE)
args.add(_productVersion);
}

ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", _targetPlatform);

if (releaseEntry != null) {
args.add("--liferay-product");
args.add(releaseEntry.getProduct());
}

args.add("-f");

if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_MAVEN_WORKSPACE)) {
args.add("-b");
args.add("maven");
}
}

PropertiesComponent component = PropertiesComponent.getInstance(project);

Expand Down Expand Up @@ -235,8 +241,6 @@ else if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_MAVEN_WORKSPACE))

properties.setProperty(WorkspaceConstants.WORKSPACE_BOM_VERSION, _targetPlatform);

ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", _targetPlatform);

if (Objects.nonNull(releaseEntry)) {
properties.setProperty(WorkspaceConstants.BUNDLE_URL_PROPERTY, releaseEntry.getBundleURL());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.liferay.ide.idea.util.CoreUtil;
import com.liferay.ide.idea.util.IntellijUtil;
import com.liferay.ide.idea.util.LiferayWorkspaceSupport;
import com.liferay.release.util.ReleaseEntry;

import java.io.File;

Expand Down Expand Up @@ -193,12 +194,12 @@ private void _createProject(VirtualFile projectRoot, Project project, String typ
args.add("create -d");
args.add(BladeCLI.quote(virtualFile.getPath()));

String targetPlatformVersion = LiferayWorkspaceSupport.getTargetPlatformVersion(project);

if (Objects.equals(typeId, LiferayProjectType.LIFERAY_MAVEN_WORKSPACE)) {
args.add("-b");
args.add("maven");

String targetPlatformVersion = LiferayWorkspaceSupport.getTargetPlatformVersion(project);

if (targetPlatformVersion != null) {
args.add("-v");
args.add(targetPlatformVersion);
Expand All @@ -209,6 +210,15 @@ private void _createProject(VirtualFile projectRoot, Project project, String typ
args.add(_liferayProductGroupVersion);
}

if (targetPlatformVersion != null) {
ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", targetPlatformVersion);

if (releaseEntry != null) {
args.add("--liferay-product");
args.add(releaseEntry.getProduct());
}
}

args.add("--base");
args.add(BladeCLI.quote(project.getBasePath()));
args.add("-t");
Expand Down

0 comments on commit 29f11a8

Please sign in to comment.