diff --git a/docs/io.sarl.docs.suite/src/test/java/io/sarl/docs/gettingstarted/CreateFirstProject.spec b/docs/io.sarl.docs.suite/src/test/java/io/sarl/docs/gettingstarted/CreateFirstProject.spec index 68e5842973..221a1d9f6f 100644 --- a/docs/io.sarl.docs.suite/src/test/java/io/sarl/docs/gettingstarted/CreateFirstProject.spec +++ b/docs/io.sarl.docs.suite/src/test/java/io/sarl/docs/gettingstarted/CreateFirstProject.spec @@ -79,7 +79,7 @@ describe "Create First Project" { * * * `src/main/java`: for your Java classes; * * `src/main/sarl`: for your SARL scripts; - * * `src/main/generated-sources/xtend`: for the Java codes generated by the SARL compiler (you should not change them yourself); + * * `src/main/generated-sources/sarl`: for the Java codes generated by the SARL compiler (you should not change them yourself); * * `src/main/resources`: for the files that are not SARL nor Java code. * *

The default output folder is `target/classes`. @@ -95,7 +95,7 @@ describe "Create First Project" { fact "Step 2: Configuration of the source folders" { SARLConfig::FOLDER_SOURCE_JAVA should be "src/main/java" SARLConfig::FOLDER_SOURCE_SARL should be "src/main/sarl" - SARLConfig::FOLDER_SOURCE_GENERATED should be "src/main/generated-sources/xtend" + SARLConfig::FOLDER_SOURCE_GENERATED should be "src/main/generated-sources/sarl" SARLConfig::FOLDER_RESOURCES should be "src/main/resources" SARLConfig::FOLDER_BIN should be "target/classes" "./new_sarl_project_screen_3.png" should beAccessibleFrom this @@ -170,7 +170,7 @@ describe "Create First Project" { */ fact "Edit the Maven configuration" { // Check if the SARL code is generated in the expected folder - SARLConfig::FOLDER_SOURCE_GENERATED should be "src/main/generated-sources/xtend" + SARLConfig::FOLDER_SOURCE_GENERATED should be "src/main/generated-sources/sarl" // The checks are valid only if the macro replacements were done. // The replacements are done by Maven. // So, Eclipse Junit tools do not make the replacements. @@ -243,7 +243,7 @@ describe "Create First Project" { * * @filter(.*) */ - fact "Configuration a runtime environment (optional)" { + fact "Configuration of a runtime environment (optional)" { // The checks are valid only if the macro replacements were done. // The replacements are done by Maven. // So, Eclipse Junit tools do not make the replacements. diff --git a/plugins/io.sarl.core/build.properties b/plugins/io.sarl.core/build.properties index b59ff246db..8bb4bdae44 100644 --- a/plugins/io.sarl.core/build.properties +++ b/plugins/io.sarl.core/build.properties @@ -1,6 +1,6 @@ source.. = src/main/java/,\ src/main/sarl/,\ - src/main/generated-sources/xtend/ + src/main/generated-sources/sarl/ bin.includes = META-INF/,\ .,\ OSGI-INF/ diff --git a/plugins/io.sarl.core/pom.xml b/plugins/io.sarl.core/pom.xml index 4764212792..687d1ac9e4 100644 --- a/plugins/io.sarl.core/pom.xml +++ b/plugins/io.sarl.core/pom.xml @@ -36,8 +36,8 @@ src/main/sarl - src/main/generated-sources/xtend/ - src/test/generated-sources/xtend/ + src/main/generated-sources/sarl/ + src/test/generated-sources/sarl/ @@ -55,9 +55,15 @@ + + src/main/generated-sources/sarl + src/main/generated-sources/xtend + + src/test/generated-sources/sarl + src/test/generated-sources/xtend @@ -87,7 +93,7 @@ io.sarl.lang.SARLStandaloneSetup - src/main/generated-sources/xtend/ + src/main/generated-sources/sarl/ diff --git a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java index 467baf2219..7110012512 100644 --- a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java +++ b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/BuildSettingWizardPage.java @@ -603,13 +603,16 @@ public void performFinish(IProgressMonitor monitor) throws CoreException, Interr configureJavaProject(newProjectCompliance, new SubProgressMonitor(monitor, 1)); IPath generationFolder = findGenerationSourcePath(); - if (generationFolder != null) { - SARLPreferences.setSpecificSARLConfigurationFor( - getJavaProject().getProject(), generationFolder); - } else { - SARLPreferences.setSystemSARLConfigurationFor( - getJavaProject().getProject()); - } + if (generationFolder == null) { + IStatus status = SARLEclipsePlugin.getDefault().createStatus( + IStatus.ERROR, + MessageFormat.format( + Messages.BuildSettingWizardPage_0, + SARLConfig.FOLDER_SOURCE_GENERATED)); + throw new CoreException(status); + } + SARLPreferences.setSpecificSARLConfigurationFor( + getJavaProject().getProject(), generationFolder); } catch (Throwable e) { if (this.fCurrProject != null) { removeProvisonalProject(); diff --git a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/Messages.java b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/Messages.java index dd5320b9ac..4661174285 100644 --- a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/Messages.java +++ b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/Messages.java @@ -34,11 +34,37 @@ public class Messages extends NLS { private static final String BUNDLE_NAME = "io.sarl.eclipse.wizards.newproject.messages"; //$NON-NLS-1$ + public static String BuildSettingWizardPage_0; + public static String JavaProjectWizard_op_error_create_message; public static String JavaProjectWizard_op_error_title; - public static String MainProjectPage_0;public static String SARLProjectCreationWizard_0; + public static String MainProjectPage_0;public static String NewJavaProjectWizardPageTwo_DeleteCorruptProjectFile_message; + + public static String NewJavaProjectWizardPageTwo_error_message; + + public static String NewJavaProjectWizardPageTwo_error_remove_message; + + public static String NewJavaProjectWizardPageTwo_error_remove_title; + + public static String NewJavaProjectWizardPageTwo_error_title; + + public static String NewJavaProjectWizardPageTwo_monitor_init_build_path; + + public static String NewJavaProjectWizardPageTwo_operation_create; + + public static String NewJavaProjectWizardPageTwo_operation_initialize; + + public static String NewJavaProjectWizardPageTwo_operation_remove; + + public static String NewJavaProjectWizardPageTwo_problem_backup; + + public static String NewJavaProjectWizardPageTwo_problem_restore_classpath; + + public static String NewJavaProjectWizardPageTwo_problem_restore_project; + + public static String SARLProjectCreationWizard_0; public static String SARLProjectNewWizard_0; public static String SARLProjectNewWizard_1; diff --git a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java index 61be83df4f..917110ab18 100644 --- a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java +++ b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/NewSarlProjectWizard.java @@ -62,6 +62,7 @@ import io.sarl.eclipse.properties.RuntimeEnvironmentPropertyPage; import io.sarl.eclipse.runtime.ISREInstall; import io.sarl.eclipse.util.Utilities; +import io.sarl.lang.SARLConfig; import io.sarl.lang.ui.preferences.SARLPreferences; /** @@ -167,35 +168,23 @@ private static String toOSString(IPath path) { protected boolean validateSARLSpecificElements(IJavaElement element) { IJavaProject javaProject = (IJavaProject) element; // Check if the "SARL" generation directory is a source folder. - IPath outputPath; - IPath generalPreferencePath; - IPath projectSpecificPath = SARLPreferences.getSARLOutputPathFor(javaProject.getProject()); + IPath outputPath = SARLPreferences.getSARLOutputPathFor(javaProject.getProject()); - generalPreferencePath = SARLPreferences.getGlobalSARLOutputPath(); - - if (projectSpecificPath != null) { - outputPath = projectSpecificPath; - generalPreferencePath = null; - } else { - generalPreferencePath = SARLPreferences.getGlobalSARLOutputPath(); - outputPath = generalPreferencePath; + if (outputPath == null) { + String message = MessageFormat.format( + Messages.BuildSettingWizardPage_0, + SARLConfig.FOLDER_SOURCE_GENERATED); + IStatus status = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, message); + handleFinishException(getShell(), new InvocationTargetException(new CoreException(status))); + return false; } - assert (outputPath != null); if (!hasSourcePath(javaProject, outputPath)) { - if (generalPreferencePath == null) { - generalPreferencePath = SARLPreferences.getGlobalSARLOutputPath(); - } - assert (generalPreferencePath != null); String message = MessageFormat.format( Messages.SARLProjectCreationWizard_0, toOSString(outputPath), - toOSString(projectSpecificPath), - toOSString(generalPreferencePath), buildInvalidOutputPathMessageFragment(javaProject)); IStatus status = SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, message); - handleFinishException(getShell(), new InvocationTargetException(new CoreException(status))); - return false; } return true; diff --git a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/messages.properties b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/messages.properties index 789a9a3ce1..d46397c8db 100644 --- a/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/messages.properties +++ b/plugins/io.sarl.eclipse/src/io/sarl/eclipse/wizards/newproject/messages.properties @@ -1,7 +1,20 @@ +BuildSettingWizardPage_0=The source folder for the generated sources is not defined. The source folder '{0}' should be defined for example. JavaProjectWizard_op_error_create_message= JavaProjectWizard_op_error_title= MainProjectPage_0=SRE -SARLProjectCreationWizard_0=The SARL output path {0} for the generated sources is not a source folder in the project. The source folders are:\n{3}Project-specific path={1}\nGeneral preference path={2} +NewJavaProjectWizardPageTwo_DeleteCorruptProjectFile_message= +NewJavaProjectWizardPageTwo_error_message= +NewJavaProjectWizardPageTwo_error_remove_message= +NewJavaProjectWizardPageTwo_error_remove_title= +NewJavaProjectWizardPageTwo_error_title= +NewJavaProjectWizardPageTwo_monitor_init_build_path= +NewJavaProjectWizardPageTwo_operation_create= +NewJavaProjectWizardPageTwo_operation_initialize= +NewJavaProjectWizardPageTwo_operation_remove= +NewJavaProjectWizardPageTwo_problem_backup= +NewJavaProjectWizardPageTwo_problem_restore_classpath= +NewJavaProjectWizardPageTwo_problem_restore_project= +SARLProjectCreationWizard_0=The SARL output path ''{0}'' for the generated sources is not a source folder in the project. The source folders are:\n{1} SARLProjectNewWizard_0=New SARL Project SARLProjectNewWizard_1=Create a SARL Project. SARLProjectNewWizard_2=Define the SARL build settings. diff --git a/plugins/io.sarl.lang.ui/META-INF/MANIFEST.MF b/plugins/io.sarl.lang.ui/META-INF/MANIFEST.MF index db1acd1d46..08e3ee9f74 100644 --- a/plugins/io.sarl.lang.ui/META-INF/MANIFEST.MF +++ b/plugins/io.sarl.lang.ui/META-INF/MANIFEST.MF @@ -23,7 +23,11 @@ Require-Bundle: io.sarl.lang;bundle-version="1.0.0";visibility:=reexport, org.eclipse.jdt.debug.ui Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Activator: io.sarl.lang.ui.internal.SARLActivator -Export-Package: io.sarl.lang.ui.highlighting;x-friends:="io.sarl.lang.ui.tests", +Export-Package: io.sarl.lang.ui;x-friends:="io.sarl.lang.ui.tests", + io.sarl.lang.ui.contentassist, + io.sarl.lang.ui.contentassist.antlr, + io.sarl.lang.ui.contentassist.antlr.internal;x-friends:="io.sarl.lang.ui.tests", + io.sarl.lang.ui.highlighting;x-friends:="io.sarl.lang.ui.tests", io.sarl.lang.ui.images;x-friends:="io.sarl.lang.ui.tests", io.sarl.lang.ui.internal, io.sarl.lang.ui.labeling;x-friends:="io.sarl.lang.ui.tests", @@ -31,6 +35,7 @@ Export-Package: io.sarl.lang.ui.highlighting;x-friends:="io.sarl.lang.ui.tests", io.sarl.lang.ui.preferences, io.sarl.lang.ui.quickfix;x-friends:="io.sarl.lang.ui.tests", io.sarl.lang.ui.quickfix.acceptors;x-friends:="io.sarl.lang.ui.tests", - io.sarl.lang.ui.contentassist, - io.sarl.lang.ui.contentassist.antlr + io.sarl.lang.ui.tasks;x-friends:="io.sarl.lang.ui.tests", + io.sarl.lang.ui.validation;x-friends:="io.sarl.lang.ui.tests", + org.eclipse.xtend.core.ui.contentassist;x-friends:="io.sarl.lang.ui.tests" Import-Package: org.apache.log4j diff --git a/plugins/io.sarl.lang/src/io/sarl/lang/SARLConfig.java b/plugins/io.sarl.lang/src/io/sarl/lang/SARLConfig.java index 365725e16b..20c5e3c796 100644 --- a/plugins/io.sarl.lang/src/io/sarl/lang/SARLConfig.java +++ b/plugins/io.sarl.lang/src/io/sarl/lang/SARLConfig.java @@ -42,7 +42,7 @@ public final class SARLConfig { /** Path of the generated source files. */ - public static final String FOLDER_SOURCE_GENERATED = "src/main/generated-sources/xtend"; //$NON-NLS-1$ + public static final String FOLDER_SOURCE_GENERATED = "src/main/generated-sources/sarl"; //$NON-NLS-1$ /** Path of the Java source files. */ @@ -50,7 +50,7 @@ public final class SARLConfig { /** Path of the SARL source files. */ - public static final String FOLDER_TEST_SOURCE_GENERATED = "src/test/generated-sources/xtend"; //$NON-NLS-1$ + public static final String FOLDER_TEST_SOURCE_GENERATED = "src/test/generated-sources/sarl"; //$NON-NLS-1$ /** Path of the generated source files that should be no more used when creating * new projects. This value is the default generation folder form Xtext. diff --git a/tests/sarl-maven-plugin.tests/src/test/java/io/sarl/maven/compiler/CompileMojoTest.java b/tests/sarl-maven-plugin.tests/src/test/java/io/sarl/maven/compiler/CompileMojoTest.java index 36da5b7237..7cbe7bda54 100644 --- a/tests/sarl-maven-plugin.tests/src/test/java/io/sarl/maven/compiler/CompileMojoTest.java +++ b/tests/sarl-maven-plugin.tests/src/test/java/io/sarl/maven/compiler/CompileMojoTest.java @@ -45,7 +45,7 @@ public class CompileMojoTest extends AbstractMojoTest { public void compile() throws Exception { Verifier verifier = executeMojo("prj1", "compile"); Path path = FileSystems.getDefault().getPath( - "src", "main", "generated-sources", "xtend", + "src", "main", "generated-sources", "sarl", "io", "sarl", "maven", "compiler", "tests", "MyAgent.java"); assertNotNull(path); verifier.assertFilePresent(path.toString());