Commit 168c3c26 authored by Kristof Szabados's avatar Kristof Szabados

lets convert the project name to containing alphanumeric characters.

Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent b6451934
......@@ -112,8 +112,9 @@ public class ProjectSourceCompiler {
* @throws CoreException if file operations can not be performed.
* */
public static void generateSingleMain(final IProject project, final Collection<Module> modules) throws CoreException {
final String projectName = project.getName().replaceAll("[^\\p{IsAlphabetic}^\\p{IsDigit}]", "_");
final IFolder folder = project.getFolder( DIR_GENERATED_ROOT );
final IFile file = folder.getFile( project.getName() + "_Single_main.java");
final IFile file = folder.getFile( projectName + "_Single_main.java");
createDir( folder );
final StringBuilder contentBuilder = new StringBuilder();
......@@ -145,7 +146,7 @@ public class ProjectSourceCompiler {
contentBuilder.append(MessageFormat.format("import {0}.{1};\n", PACKAGE_GENERATED_ROOT, module.getIdentifier().getName()));
}
contentBuilder.append(MessageFormat.format("public class {0}_Single_main '{'\n\n", project.getName()));
contentBuilder.append(MessageFormat.format("public class {0}_Single_main '{'\n\n", projectName));
contentBuilder.append( "public static void main( String[] args ) {\n" );
contentBuilder.append("long absoluteStart = System.nanoTime();\n");
for ( final Module module : modules ) {
......@@ -178,8 +179,9 @@ public class ProjectSourceCompiler {
* @throws CoreException if file operations can not be performed.
* */
public static void generateParallelMain(final IProject project, final Collection<Module> modules) throws CoreException {
final String projectName = project.getName().replaceAll("[^\\p{IsAlphabetic}^\\p{IsDigit}]", "_");
final IFolder folder = project.getFolder( DIR_GENERATED_ROOT );
final IFile file = folder.getFile( project.getName() + "_Parallel_main.java");
final IFile file = folder.getFile( projectName + "_Parallel_main.java");
createDir( folder );
final StringBuilder contentBuilder = new StringBuilder();
......@@ -211,7 +213,7 @@ public class ProjectSourceCompiler {
contentBuilder.append(MessageFormat.format("import {0}.{1};\n", PACKAGE_GENERATED_ROOT, module.getIdentifier().getName()));
}
contentBuilder.append(MessageFormat.format("public class {0}_Parallel_main '{'\n\n", project.getName()));
contentBuilder.append(MessageFormat.format("public class {0}_Parallel_main '{'\n\n", projectName));
contentBuilder.append( "public static void main( String[] args ) {\n" );
contentBuilder.append("long absoluteStart = System.nanoTime();\n");
for ( final Module module : modules ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment