Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NETBEANS-1386]: Fixing handling of non-modularized repositories in p… #954

Merged
merged 1 commit into from Oct 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -112,7 +112,7 @@ public ActionProviderImpl(JDKProject project) {

genericScript = FileUtil.toFileObject(scriptFile);

if (project.moduleRepository.isConsolidatedRepo()) {
if (project.currentModule != null && project.moduleRepository.isConsolidatedRepo()) {
String repoName = ShortcutUtils.getDefault().inferLegacyRepository(project);
File fastBuild = InstalledFileLocator.getDefault().locate("scripts/build-" + repoName + "-consol.xml", "org.netbeans.modules.java.openjdk.project", false);
if (fastBuild != null && ShortcutUtils.getDefault().shouldUseCustomBuild(repoName, FileUtil.getRelativePath(repo, project.getProjectDirectory()))) {
Expand Down Expand Up @@ -185,7 +185,10 @@ public void invokeAction(String command, Lookup context) throws IllegalArgumentE
command = COMMAND_BUILD_FAST; //XXX: should only do this if genericScript supports it
}
Properties props = new Properties();
props.put("basedir", FileUtil.toFile(scriptFO == genericScript ? project.moduleRepository.getJDKRoot() : repository).getAbsolutePath());
FileObject basedirFO = project.currentModule != null ? scriptFO == genericScript ? project.moduleRepository.getJDKRoot()
: repository
: repository.getParent();
props.put("basedir", FileUtil.toFile(basedirFO).getAbsolutePath());
props.put("CONF", project.configurations.getActiveConfiguration().getLocation().getName());
props.put("nb.jdk.project.target.java.home", BuildUtils.findTargetJavaHome(project.getProjectDirectory()).getAbsolutePath());
RootKind kind = getKind(context);
Expand Down