anchoring base jdk version to 1.6+

This commit is contained in:
金戟 2020-10-22 21:05:17 +08:00
parent b6070ad24d
commit 8cc0b0313a
5 changed files with 37 additions and 9 deletions

View File

@ -10,7 +10,11 @@
<name>testable-agent</name> <name>testable-agent</name>
<properties> <properties>
<java.version>1.6</java.version>
<project.compiler.level>1.6</project.compiler.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asm.lib.version>8.0.1</asm.lib.version> <asm.lib.version>8.0.1</asm.lib.version>
<plugin.compiler.version>3.8.1</plugin.compiler.version>
<plugin.jar.version>3.2.0</plugin.jar.version> <plugin.jar.version>3.2.0</plugin.jar.version>
<plugin.shade.version>3.2.4</plugin.shade.version> <plugin.shade.version>3.2.4</plugin.shade.version>
</properties> </properties>
@ -32,6 +36,16 @@
<build> <build>
<finalName>testable-agent</finalName> <finalName>testable-agent</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.compiler.version}</version>
<configuration>
<source>${project.compiler.level}</source>
<target>${project.compiler.level}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>

View File

@ -11,10 +11,10 @@
<name>testable-core</name> <name>testable-core</name>
<properties> <properties>
<plugin.compiler.version>3.8.1</plugin.compiler.version> <java.version>1.6</java.version>
<plugin.resources.version>3.1.0</plugin.resources.version> <project.compiler.level>1.6</project.compiler.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.compiler.level>1.7</project.compiler.level> <plugin.compiler.version>3.8.1</plugin.compiler.version>
</properties> </properties>
<dependencies> <dependencies>

View File

@ -19,9 +19,9 @@ import java.lang.reflect.Modifier;
public class EnableTestableTranslator extends BaseTranslator { public class EnableTestableTranslator extends BaseTranslator {
private final String sourceClassName; private final String sourceClassName;
private final ListBuffer<Name> sourceClassIns = new ListBuffer<>(); private final ListBuffer<Name> sourceClassIns = new ListBuffer<Name>();
private final ListBuffer<String> privateOrFinalFields = new ListBuffer<>(); private final ListBuffer<String> privateOrFinalFields = new ListBuffer<String>();
private final ListBuffer<String> privateMethods = new ListBuffer<>(); private final ListBuffer<String> privateMethods = new ListBuffer<String>();
private final PrivateAccessStatementGenerator privateAccessStatementGenerator; private final PrivateAccessStatementGenerator privateAccessStatementGenerator;
public EnableTestableTranslator(String pkgName, String testClassName, TestableContext cx) { public EnableTestableTranslator(String pkgName, String testClassName, TestableContext cx) {

View File

@ -11,7 +11,7 @@ class StringUtilTest {
@Test @Test
void should_able_to_join_string() { void should_able_to_join_string() {
List<String> list = new ArrayList<>(4); List<String> list = new ArrayList<String>(4);
list.add("a"); list.add("a");
list.add("b"); list.add("b");
list.add("c"); list.add("c");

View File

@ -9,8 +9,12 @@
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<properties> <properties>
<java.version>1.8</java.version>
<testable.version>0.2.0-SNAPSHOT</testable.version> <testable.version>0.2.0-SNAPSHOT</testable.version>
<java.version>1.6</java.version>
<project.compiler.level>1.6</project.compiler.level>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plugin.compiler.version>3.8.1</plugin.compiler.version>
<maven.plugin.version>3.6.0</maven.plugin.version>
</properties> </properties>
<dependencies> <dependencies>
@ -39,10 +43,20 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.compiler.version}</version>
<configuration>
<source>${project.compiler.level}</source>
<target>${project.compiler.level}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId> <artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version> <version>${maven.plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>