Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-02-12 22:43:44 +0000
committerTill Brychcy2018-02-19 21:43:59 +0000
commit86b105d1761e70cf1cca4f74c60ede1ff3f77520 (patch)
treefb39f9a1d3a763b9a70d044cb351e44b837b2504 /org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java
parente603dedfdfd718d3d302f1cd90c78085d81e98f0 (diff)
downloadeclipse.jdt.core-86b105d1761e70cf1cca4f74c60ede1ff3f77520.tar.gz
eclipse.jdt.core-86b105d1761e70cf1cca4f74c60ede1ff3f77520.tar.xz
eclipse.jdt.core-86b105d1761e70cf1cca4f74c60ede1ff3f77520.zip
Bug 531072 - [testsources][apt] classes generated for test sources need
to be put in a test source folder Change-Id: Ieb06760c55d8fe3bd04954ca13d1b9fb4f67d846
Diffstat (limited to 'org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java')
-rw-r--r--org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java
index 3a0a7e7d87..b78916bd8f 100644
--- a/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java
+++ b/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/AptCompilationParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2015 BEA Systems, Inc.
+ * Copyright (c) 2005, 2018 BEA Systems, Inc. and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,6 +25,7 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.apt.core.internal.util.FactoryPath;
+import org.eclipse.jdt.apt.core.internal.util.TestCodeUtil;
import org.eclipse.jdt.apt.core.util.AptConfig;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
@@ -135,8 +136,12 @@ public class AptCompilationParticipant extends CompilationParticipant
// also exclude files that has already been processed.
int annoFileCount = 0;
int noAnnoFileCount = 0;
+ boolean test = false;
for( int i=0; i<total; i++ ){
BuildContext bc = allfiles[i];
+ if(bc.isTestCode()) {
+ test = true;
+ }
if( _buildRound > 0 && _processedFiles.containsKey( bc.getFile() )){
// We've already processed this file; we'll skip reprocessing it, on
// the assumption that nothing would change, but we need to re-report
@@ -191,7 +196,8 @@ public class AptCompilationParticipant extends CompilationParticipant
aptProject,
factories,
_previousRoundsBatchFactories,
- _isBatch);
+ _isBatch,
+ test);
_previousRoundsBatchFactories.addAll(dispatchedBatchFactories);
}
finally {
@@ -215,14 +221,14 @@ public class AptCompilationParticipant extends CompilationParticipant
Map<AnnotationProcessorFactory, FactoryPath.Attributes> factories =
AnnotationProcessorFactoryLoader.getLoader().getJava5FactoriesAndAttributesForProject( javaProject );
- APTDispatchRunnable.runAPTDuringReconcile(context, aptProject, factories);
+ APTDispatchRunnable.runAPTDuringReconcile(context, aptProject, factories, TestCodeUtil.isTestCode(workingCopy));
}
@Override
public void cleanStarting(IJavaProject javaProject){
IProject p = javaProject.getProject();
- AptPlugin.getAptProject(javaProject).projectClean( true );
+ AptPlugin.getAptProject(javaProject).projectClean( true, true, true );
try{
// clear out all markers during a clean.
IMarker[] markers = p.findMarkers(AptPlugin.APT_BATCH_PROCESSOR_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);

Back to the top