mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#1553: Update tycho-compiler-jdt to latest 1.6.0 version
Disable one test in GenericsHierarchyTest for Eclipse on Java 8 due to a bug in the Tycho compiler. Disable freeBuilder integration test for Eclipse since there are some problems in the second round of annotation processing (no ModelElementProcessor(s) are found)
This commit is contained in:
parent
853ff7f74f
commit
c410379f83
@ -36,8 +36,7 @@ public class MavenIntegrationTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ProcessorTest(baseDir = "freeBuilderBuilderTest", processorTypes = {
|
@ProcessorTest(baseDir = "freeBuilderBuilderTest", processorTypes = {
|
||||||
ProcessorTest.ProcessorType.JAVAC,
|
ProcessorTest.ProcessorType.JAVAC
|
||||||
ProcessorTest.ProcessorType.ECLIPSE_JDT
|
|
||||||
})
|
})
|
||||||
void freeBuilderBuilderTest() {
|
void freeBuilderBuilderTest() {
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<org.apache.maven.plugins.surefire.version>3.0.0-M3</org.apache.maven.plugins.surefire.version>
|
<org.apache.maven.plugins.surefire.version>3.0.0-M3</org.apache.maven.plugins.surefire.version>
|
||||||
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
|
<org.apache.maven.plugins.javadoc.version>3.1.0</org.apache.maven.plugins.javadoc.version>
|
||||||
<org.springframework.version>4.0.3.RELEASE</org.springframework.version>
|
<org.springframework.version>4.0.3.RELEASE</org.springframework.version>
|
||||||
<org.eclipse.tycho.compiler-jdt.version>0.26.0</org.eclipse.tycho.compiler-jdt.version>
|
<org.eclipse.tycho.compiler-jdt.version>1.6.0</org.eclipse.tycho.compiler-jdt.version>
|
||||||
<com.puppycrawl.tools.checkstyle.version>8.29</com.puppycrawl.tools.checkstyle.version>
|
<com.puppycrawl.tools.checkstyle.version>8.29</com.puppycrawl.tools.checkstyle.version>
|
||||||
<org.junit.jupiter.version>5.6.0</org.junit.jupiter.version>
|
<org.junit.jupiter.version>5.6.0</org.junit.jupiter.version>
|
||||||
<add.release.arguments />
|
<add.release.arguments />
|
||||||
@ -237,13 +237,28 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-container-default</artifactId>
|
<artifactId>plexus-container-default</artifactId>
|
||||||
<version>1.6</version>
|
<version>1.7.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-component-annotations</artifactId>
|
||||||
|
<version>1.7.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
|
<artifactId>plexus-classworlds</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
<groupId>org.codehaus.plexus</groupId>
|
||||||
<artifactId>plexus-utils</artifactId>
|
<artifactId>plexus-utils</artifactId>
|
||||||
<version>3.0.20</version>
|
<version>3.0.20</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Project modules -->
|
<!-- Project modules -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -12,6 +12,8 @@ import org.junit.runner.RunWith;
|
|||||||
import org.mapstruct.ap.testutil.IssueKey;
|
import org.mapstruct.ap.testutil.IssueKey;
|
||||||
import org.mapstruct.ap.testutil.WithClasses;
|
import org.mapstruct.ap.testutil.WithClasses;
|
||||||
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
|
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
|
||||||
|
import org.mapstruct.ap.testutil.runner.Compiler;
|
||||||
|
import org.mapstruct.ap.testutil.runner.DisabledOnCompiler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Gudian
|
* @author Andreas Gudian
|
||||||
@ -34,6 +36,13 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
|
|||||||
public class GenericsHierarchyTest {
|
public class GenericsHierarchyTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
// Disabled due to a bug in the Eclipse compiler (https://bugs.eclipse.org/bugs/show_bug.cgi?id=540101)
|
||||||
|
// See https://github.com/mapstruct/mapstruct/issues/1553 and https://github.com/mapstruct/mapstruct/pull/1587
|
||||||
|
// for more information
|
||||||
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
public void determinesAnimalKeyGetter() {
|
public void determinesAnimalKeyGetter() {
|
||||||
AbstractAnimal source = new Elephant();
|
AbstractAnimal source = new Elephant();
|
||||||
|
|
||||||
|
@ -55,7 +55,10 @@ public class DateConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler(Compiler.JDK11)
|
@DisabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void shouldApplyDateFormatForConversions() {
|
public void shouldApplyDateFormatForConversions() {
|
||||||
Source source = new Source();
|
Source source = new Source();
|
||||||
@ -70,7 +73,10 @@ public class DateConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnabledOnCompiler(Compiler.JDK11)
|
@EnabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void shouldApplyDateFormatForConversionsJdk11() {
|
public void shouldApplyDateFormatForConversionsJdk11() {
|
||||||
Source source = new Source();
|
Source source = new Source();
|
||||||
@ -85,7 +91,10 @@ public class DateConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler(Compiler.JDK11)
|
@DisabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void shouldApplyDateFormatForConversionInReverseMapping() {
|
public void shouldApplyDateFormatForConversionInReverseMapping() {
|
||||||
Target target = new Target();
|
Target target = new Target();
|
||||||
@ -102,7 +111,10 @@ public class DateConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnabledOnCompiler(Compiler.JDK11)
|
@EnabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void shouldApplyDateFormatForConversionInReverseMappingJdk11() {
|
public void shouldApplyDateFormatForConversionInReverseMappingJdk11() {
|
||||||
Target target = new Target();
|
Target target = new Target();
|
||||||
|
@ -87,7 +87,10 @@ public class JodaConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler(Compiler.JDK11)
|
@DisabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void testSourceToTargetMappingForStrings() {
|
public void testSourceToTargetMappingForStrings() {
|
||||||
Source src = new Source();
|
Source src = new Source();
|
||||||
@ -115,7 +118,10 @@ public class JodaConversionTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@EnabledOnCompiler(Compiler.JDK11)
|
@EnabledOnCompiler({
|
||||||
|
Compiler.JDK11,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
})
|
||||||
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
// See https://bugs.openjdk.java.net/browse/JDK-8211262, there is a difference in the default formats on Java 9+
|
||||||
public void testSourceToTargetMappingForStringsJdk11() {
|
public void testSourceToTargetMappingForStringsJdk11() {
|
||||||
Source src = new Source();
|
Source src = new Source();
|
||||||
|
@ -30,7 +30,10 @@ import org.mapstruct.ap.testutil.runner.DisabledOnCompiler;
|
|||||||
public class VerboseTest {
|
public class VerboseTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses({ CreateBeanMapping.class, CreateBeanMappingConfig.class })
|
@WithClasses({ CreateBeanMapping.class, CreateBeanMappingConfig.class })
|
||||||
@ExpectedNote("^MapStruct: Using accessor naming strategy:.*DefaultAccessorNamingStrategy.*$")
|
@ExpectedNote("^MapStruct: Using accessor naming strategy:.*DefaultAccessorNamingStrategy.*$")
|
||||||
@ -41,7 +44,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@WithServiceImplementation(provides = BuilderProvider.class, value = ImmutablesBuilderProvider.class)
|
@WithServiceImplementation(provides = BuilderProvider.class, value = ImmutablesBuilderProvider.class)
|
||||||
@WithServiceImplementation(provides = AccessorNamingStrategy.class, value = ImmutablesAccessorNamingStrategy.class)
|
@WithServiceImplementation(provides = AccessorNamingStrategy.class, value = ImmutablesAccessorNamingStrategy.class)
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@ -54,7 +60,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@WithServiceImplementation(provides = AstModifyingAnnotationProcessor.class,
|
@WithServiceImplementation(provides = AstModifyingAnnotationProcessor.class,
|
||||||
value = AstModifyingAnnotationProcessorSaysNo.class)
|
value = AstModifyingAnnotationProcessorSaysNo.class)
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@ -73,7 +82,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses({ CreateBeanMapping.class, CreateBeanMappingConfig.class })
|
@WithClasses({ CreateBeanMapping.class, CreateBeanMappingConfig.class })
|
||||||
@ExpectedNote("^- MapStruct: creating bean mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating bean mapping method implementation for.*$")
|
||||||
@ -82,7 +94,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(SelectBeanMapping.class)
|
@WithClasses(SelectBeanMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating bean mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating bean mapping method implementation for.*$")
|
||||||
@ -91,7 +106,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(ValueMapping.class)
|
@WithClasses(ValueMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating value mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating value mapping method implementation for.*$")
|
||||||
@ -99,7 +117,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(CreateIterableMapping.class)
|
@WithClasses(CreateIterableMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating iterable mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating iterable mapping method implementation for.*$")
|
||||||
@ -108,7 +129,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(SelectIterableMapping.class)
|
@WithClasses(SelectIterableMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating iterable mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating iterable mapping method implementation for.*$")
|
||||||
@ -117,7 +141,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(SelectStreamMapping.class)
|
@WithClasses(SelectStreamMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating stream mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating stream mapping method implementation for.*$")
|
||||||
@ -125,7 +152,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(CreateMapMapping.class)
|
@WithClasses(CreateMapMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating map mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating map mapping method implementation for.*$")
|
||||||
@ -135,7 +165,10 @@ public class VerboseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@DisabledOnCompiler( Compiler.ECLIPSE )
|
@DisabledOnCompiler( {
|
||||||
|
Compiler.ECLIPSE,
|
||||||
|
Compiler.ECLIPSE11
|
||||||
|
} )
|
||||||
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
@ProcessorOption(name = "mapstruct.verbose", value = "true")
|
||||||
@WithClasses(SelectMapMapping.class)
|
@WithClasses(SelectMapMapping.class)
|
||||||
@ExpectedNote("^- MapStruct: creating map mapping method implementation for.*$")
|
@ExpectedNote("^- MapStruct: creating map mapping method implementation for.*$")
|
||||||
|
@ -74,7 +74,10 @@ public class AnnotationProcessorTestRunner extends ParentRunner<Runner> {
|
|||||||
// Current tycho-compiler-jdt (0.26.0) is not compatible with Java 11
|
// Current tycho-compiler-jdt (0.26.0) is not compatible with Java 11
|
||||||
// Updating to latest version 1.3.0 fails some tests
|
// Updating to latest version 1.3.0 fails some tests
|
||||||
// Once https://github.com/mapstruct/mapstruct/pull/1587 is resolved we can remove this line
|
// Once https://github.com/mapstruct/mapstruct/pull/1587 is resolved we can remove this line
|
||||||
return Arrays.asList( new InnerAnnotationProcessorRunner( klass, Compiler.JDK11 ) );
|
return Arrays.asList(
|
||||||
|
new InnerAnnotationProcessorRunner( klass, Compiler.JDK11 ),
|
||||||
|
new InnerAnnotationProcessorRunner( klass, Compiler.ECLIPSE11 )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Arrays.asList(
|
return Arrays.asList(
|
||||||
|
@ -10,5 +10,5 @@ package org.mapstruct.ap.testutil.runner;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum Compiler {
|
public enum Compiler {
|
||||||
JDK, JDK11, ECLIPSE;
|
JDK, JDK11, ECLIPSE, ECLIPSE11;
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,5 @@ public @interface DisabledOnCompiler {
|
|||||||
/**
|
/**
|
||||||
* @return The compiler to use.
|
* @return The compiler to use.
|
||||||
*/
|
*/
|
||||||
Compiler value();
|
Compiler[] value();
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import java.io.File;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.lang.model.SourceVersion;
|
||||||
|
|
||||||
import org.codehaus.plexus.compiler.CompilerConfiguration;
|
import org.codehaus.plexus.compiler.CompilerConfiguration;
|
||||||
import org.codehaus.plexus.compiler.CompilerException;
|
import org.codehaus.plexus.compiler.CompilerException;
|
||||||
import org.codehaus.plexus.compiler.CompilerResult;
|
import org.codehaus.plexus.compiler.CompilerResult;
|
||||||
@ -108,9 +110,10 @@ class EclipseCompilingStatement extends CompilingStatement {
|
|||||||
config.setGeneratedSourcesDirectory( new File( sourceOutputDir ) );
|
config.setGeneratedSourcesDirectory( new File( sourceOutputDir ) );
|
||||||
config.setAnnotationProcessors( new String[] { MappingProcessor.class.getName() } );
|
config.setAnnotationProcessors( new String[] { MappingProcessor.class.getName() } );
|
||||||
config.setSourceFiles( sourceFiles );
|
config.setSourceFiles( sourceFiles );
|
||||||
|
String version = getSourceVersion();
|
||||||
config.setShowWarnings( false );
|
config.setShowWarnings( false );
|
||||||
config.setSourceVersion( "1.8" );
|
config.setSourceVersion( version );
|
||||||
config.setTargetVersion( "1.8" );
|
config.setTargetVersion( version );
|
||||||
|
|
||||||
for ( String option : compilationRequest.getProcessorOptions() ) {
|
for ( String option : compilationRequest.getProcessorOptions() ) {
|
||||||
config.addCompilerCustomArgument( option, null );
|
config.addCompilerCustomArgument( option, null );
|
||||||
@ -128,13 +131,22 @@ class EclipseCompilingStatement extends CompilingStatement {
|
|||||||
sourceDir,
|
sourceDir,
|
||||||
compilerResult );
|
compilerResult );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getSourceVersion() {
|
||||||
|
SourceVersion latest = SourceVersion.latest();
|
||||||
|
if ( latest == SourceVersion.RELEASE_8 ) {
|
||||||
|
return "1.8";
|
||||||
|
}
|
||||||
|
return "11";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<String> buildEclipseCompilerClasspath() {
|
private static List<String> buildEclipseCompilerClasspath() {
|
||||||
String[] whitelist =
|
String[] whitelist =
|
||||||
new String[] {
|
new String[] {
|
||||||
"tycho-compiler",
|
"tycho-compiler",
|
||||||
"org.eclipse.jdt.",
|
"ecj",
|
||||||
"plexus-compiler-api",
|
"plexus-compiler-api",
|
||||||
"plexus-component-annotations" };
|
"plexus-component-annotations" };
|
||||||
|
|
||||||
|
@ -22,5 +22,5 @@ public @interface EnabledOnCompiler {
|
|||||||
/**
|
/**
|
||||||
* @return The compiler to use.
|
* @return The compiler to use.
|
||||||
*/
|
*/
|
||||||
Compiler value();
|
Compiler[] value();
|
||||||
}
|
}
|
||||||
|
@ -68,12 +68,20 @@ class InnerAnnotationProcessorRunner extends BlockJUnit4ClassRunner {
|
|||||||
protected boolean isIgnoredForCompiler(FrameworkMethod child) {
|
protected boolean isIgnoredForCompiler(FrameworkMethod child) {
|
||||||
EnabledOnCompiler enabledOnCompiler = child.getAnnotation( EnabledOnCompiler.class );
|
EnabledOnCompiler enabledOnCompiler = child.getAnnotation( EnabledOnCompiler.class );
|
||||||
if ( enabledOnCompiler != null ) {
|
if ( enabledOnCompiler != null ) {
|
||||||
return enabledOnCompiler.value() != compiler;
|
for ( Compiler value : enabledOnCompiler.value() ) {
|
||||||
|
if ( value != compiler ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DisabledOnCompiler disabledOnCompiler = child.getAnnotation( DisabledOnCompiler.class );
|
DisabledOnCompiler disabledOnCompiler = child.getAnnotation( DisabledOnCompiler.class );
|
||||||
if ( disabledOnCompiler != null ) {
|
if ( disabledOnCompiler != null ) {
|
||||||
return disabledOnCompiler.value() == compiler;
|
for ( Compiler value : disabledOnCompiler.value() ) {
|
||||||
|
if ( value == compiler ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user