Skip to content

Commit

Permalink
Use GX and MSBuild custom paths when not empty (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlamasrios authored Feb 27, 2024
1 parent a5463ac commit 710a068
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,18 @@ private GeneXusInstallation getGeneXusInstallation(@CheckForNull FilePath worksp
}

private String getGxPath(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) {
// check for custom path first
String customPath = getGxCustomPath();
if (customPath != null && !customPath.isEmpty()) {
return customPath;
}

GeneXusInstallation installation = getGeneXusInstallation(workspace, env, listener);
if (installation != null) {
return installation.getHome();
}

return getGxCustomPath();
return "";
}

private String getMSBuildInstallationId(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) {
Expand All @@ -204,14 +210,20 @@ private String getMSBuildInstallationId(@CheckForNull FilePath workspace, @Check
}

private String getMsBuildPath(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) {
// check for custom path first
String customPath = getMsbuildCustomPath();
if (customPath != null && !customPath.isEmpty()) {
return customPath;
}

String installationId = getMSBuildInstallationId(workspace, env, listener);
Node node = workspaceToNode(workspace);
MsBuildInstallation msbuildTool = MsBuildInstallationHelper.resolveInstallation(installationId, node, env, listener);
if (msbuildTool != null) {
return msbuildTool.getHome();
}

return getMsbuildCustomPath();
return "";
}

@Exported
Expand Down

0 comments on commit 710a068

Please sign in to comment.