diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/ImportProject.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/ImportProject.java index efc4f135eb60f5ca040219cc1222956724af78f7..c2f96556f6f5296641254c1c0e88a0b9f433c057 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/ImportProject.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/ImportProject.java @@ -57,8 +57,10 @@ public final class ImportProject implements IApplication { } try { final IProject project = TITANProjectOpener.open(projectPath); - if (!TITANProjectOpener.check(project)) { - System.out.println("The project with name `" + project.getName() + "' is imported, but it is not a Titan project."); + if (TITANProjectOpener.check(project)) { + System.out.println("The project with name `" + project.getName() + "' is imported in the workspace!"); + } else { + System.out.println("The project with name `" + project.getName() + "' is imported in the workspace, but it is not a Titan project."); } } catch (Exception e) { ErrorReporter.logExceptionStackTrace("Error while imporing project with name `" diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/InvokeBuild.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/InvokeBuild.java index f844f0f97294e96bc0582d6cbdb25a7a6fc4a481..3890e102c1e8915a376374be3f9dbb92d99969fb 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/InvokeBuild.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/application/InvokeBuild.java @@ -55,13 +55,13 @@ public final class InvokeBuild implements IApplication { MakefileCreationData.DEFAULT_JAVA_TARGET_PROPERTY), MakefileCreationData.DefaultJavaTarget.EXECUTABLE.toString()); project.setPersistentProperty(new QualifiedName(ProjectBuildPropertyData.QUALIFIER, MakefileCreationData.GENERATE_START_SH_SCRIPT_PROPERTY), String.valueOf(true)); - if (AntScriptGenerator.generateAndStoreBuildXML(project, true)) { + if (AntScriptGenerator.generateAndStoreBuildXML(project, false)) { AntLaunchConfigGenerator.createAntLaunchConfiguration(project); AntLaunchConfigGenerator.addAntBuilder(project); + AntLaunchConfigGenerator.setAntBuilderEnabled(project, true); + CliScriptGenerator.generateAndStoreScripts(project); project.refreshLocal(IResource.DEPTH_ONE, null); } - CliScriptGenerator.generateAndStoreScripts(project); - AntLaunchConfigGenerator.setAntBuilderEnabled(project, true); } private Integer closeWorkspace() { diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ant/AntScriptGenerator.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ant/AntScriptGenerator.java index 31f988ed014e9cbd38a95f15ff6611a385cb2150..b0d0819ead7e8de60242bd6926affc8d246cc551 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ant/AntScriptGenerator.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/core/ant/AntScriptGenerator.java @@ -242,6 +242,12 @@ public final class AntScriptGenerator { return null; } final SourceInfo[] sourceInfos = convert(getClasspath(config)); + if (sourceInfos == null || sourceInfos.length == 0) { + ErrorReporter.parallelErrorDisplayInMessageDialog( + "Error while generating the ANT script 'jarbuild.xml' for project", + "Error while resolving classpaths!"); + return null; + } JavaAppLaunchConfigGenerator.deleteTemporaryJavaAppLaunchConfiguration(project); DocumentBuilder docBuilder = null; DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); diff --git a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectOpener.java b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectOpener.java index 34f27cbea449b40d4330927f2afbbe7561b80eff..7e8f0671fbc0a53a85112c593c06409404b4a9c6 100644 --- a/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectOpener.java +++ b/org.eclipse.titan.designer/src/org/eclipse/titan/designer/wizards/TITANProjectOpener.java @@ -52,7 +52,7 @@ public final class TITANProjectOpener { * @return If a project with the same name already exists in the workspace then the handler of this project * is returned, otherwise the project on the specified path is created in the workspace. * {@code null} is returned upon empty or null path - * @throws CoreException + * @throws CoreException, FileNotFoundException */ public static IProject open(final IPath path) throws CoreException, FileNotFoundException { if (path == null || path.isEmpty()) { @@ -93,7 +93,7 @@ public final class TITANProjectOpener { * @return If a project with the same name already exists in the workspace then the handler of this project * is returned, otherwise the project on the specified path is created in the workspace. * {@code null} is returned upon empty or null path - * @throws CoreException + * @throws CoreException, FileNotFoundException */ public static IProject open(final String pathString) throws CoreException, FileNotFoundException { return open(new Path(pathString));