Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-02-21 04:25:39 -0500
committerTill Brychcy2018-02-21 04:28:19 -0500
commit2d055cecc6a1fb8ee8d82df0a53a8aa63b73e6cf (patch)
treeaf06ba2a84d766fb42840d06186efa22cbbab43d /org.eclipse.jdt.apt.ui
parentec6aa067aba071c103605a1798d085733fd3b0ba (diff)
downloadeclipse.jdt.core-2d055cecc6a1fb8ee8d82df0a53a8aa63b73e6cf.tar.gz
eclipse.jdt.core-2d055cecc6a1fb8ee8d82df0a53a8aa63b73e6cf.tar.xz
eclipse.jdt.core-2d055cecc6a1fb8ee8d82df0a53a8aa63b73e6cf.zip
Bug 531072 - [testsources][apt] classes generated for test sources need
to be put in a test source folder - add check that test output directory is different from main output directory
Diffstat (limited to 'org.eclipse.jdt.apt.ui')
-rw-r--r--org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/AptConfigurationBlock.java13
-rw-r--r--org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/Messages.java2
-rw-r--r--org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/messages.properties1
3 files changed, 11 insertions, 5 deletions
diff --git a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/AptConfigurationBlock.java b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/AptConfigurationBlock.java
index 2527f2c53f..059e981dd2 100644
--- a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/AptConfigurationBlock.java
+++ b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/AptConfigurationBlock.java
@@ -513,13 +513,16 @@ public class AptConfigurationBlock extends BaseConfigurationBlock {
* @return true if current field value is valid
*/
private IStatus validateGenTestSrcDir() {
- String dirName = fGenTestSrcDirField.getText();
- if (!AptConfig.validateGenSrcDir(fJProj, dirName)) {
+ String dirName = fGenSrcDirField.getText();
+ String testDirName = fGenTestSrcDirField.getText();
+ if (!AptConfig.validateGenSrcDir(fJProj, testDirName)) {
return new StatusInfo(IStatus.ERROR, Messages.AptConfigurationBlock_genTestSrcDirMustBeValidRelativePath);
}
- boolean TODO; // check it is not same as validateGenSrcDir, make sure it has its own output folder
- if (fJProj != null && !dirName.equals(fOriginalGenTestSrcDir)) {
- IFolder folder = fJProj.getProject().getFolder( dirName );
+ if (testDirName.equals(dirName)) {
+ return new StatusInfo(IStatus.ERROR, Messages.AptConfigurationBlock_genTestSrcDirMustBeDifferent);
+ }
+ if (fJProj != null && !testDirName.equals(fOriginalGenTestSrcDir)) {
+ IFolder folder = fJProj.getProject().getFolder( testDirName );
if (folder != null && folder.exists() && !folder.isDerived()) {
return new StatusInfo(IStatus.WARNING, Messages.AptConfigurationBlock_warningContentsMayBeDeleted);
}
diff --git a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/Messages.java b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/Messages.java
index e73517ea15..a18aba9477 100644
--- a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/Messages.java
+++ b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/Messages.java
@@ -103,6 +103,8 @@ public class Messages extends NLS {
public static String AptConfigurationBlock_genTestSrcDirMustBeValidRelativePath;
+ public static String AptConfigurationBlock_genTestSrcDirMustBeDifferent;
+
public static String FactoryPathConfigurationBlock_advanced;
public static String AdvancedFactoryPathOptionsDialog_advancedOptions;
diff --git a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/messages.properties b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/messages.properties
index c297b97f63..e8a18684f0 100644
--- a/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/messages.properties
+++ b/org.eclipse.jdt.apt.ui/src/org/eclipse/jdt/apt/ui/internal/preferences/messages.properties
@@ -18,6 +18,7 @@ AptConfigurationBlock_warningContentsMayBeDeleted=Contents of generated source d
AptConfigurationBlock_enableReconcileProcessing=Enable processing in edito&r
AptConfigurationBlock_genSrcDirMustBeValidRelativePath=Generated source directory must be a valid relative path
AptConfigurationBlock_genTestSrcDirMustBeValidRelativePath=Generated test source directory must be a valid relative path
+AptConfigurationBlock_genTestSrcDirMustBeDifferent=Generated test source directory must different from generated source directory
AptConfigurationBlock_options=Processor options (-Akey=value):
AptPreferencePage_preferences=Specify the default annotation processor settings for new projects:
AptPreferencePage_preferencesTitle=Java Annotation Processing Preferences

Back to the top