Merge changes from topic 'java_8_layoutlib'

* changes:
  Switch LayoutLib to Java 8
  Move LayoutLib to Java 8
This commit is contained in:
Neil Fuller
2016-02-29 10:33:29 +00:00
committed by Gerrit Code Review
10 changed files with 20 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<component name="InspectionProjectProfileManager">
<profile version="1.0" is_locked="false">
<option name="myName" value="Project Default" />
@@ -8,6 +7,15 @@
<option name="CHECK_TRY_CATCH_SECTION" value="true" />
<option name="CHECK_METHOD_BODY" value="true" />
</inspection_tool>
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="ToArrayCallWithZeroLengthArrayArgument" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="WeakerAccess" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="false" />
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="false" />
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="true" />
</inspection_tool>
</profile>
</component>

View File

@@ -37,7 +37,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@@ -26,4 +26,4 @@
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>
</component>

View File

@@ -16,7 +16,7 @@
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_JAVACFLAGS := -source 6 -target 6
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
#
# Define rules to build temp_layoutlib.jar, which contains a subset of

View File

@@ -18,8 +18,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_JAVA_RESOURCE_DIRS := resources
LOCAL_JAVACFLAGS := -source 6 -target 6
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
LOCAL_JAVA_LIBRARIES := \
layoutlib_api-prebuilt \

View File

@@ -16,10 +16,11 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
# Only compile source java files in this lib.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_JAVA_RESOURCE_DIRS := res
LOCAL_JAVACFLAGS := -source 6 -target 6
LOCAL_MODULE := layoutlib-tests
LOCAL_MODULE_TAGS := optional

View File

@@ -16,6 +16,8 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
LOCAL_SRC_FILES := $(call all-java-files-under,src)
LOCAL_JAR_MANIFEST := manifest.txt

View File

@@ -176,17 +176,6 @@ public abstract class AbstractClassAdapter extends ClassVisitor {
}
}
/* Java 7 verifies the StackMapTable of a class if its version number is greater than 50.0.
* However, the check is disabled if the class version number is 50.0 or less. Generation
* of the StackMapTable requires a rewrite using the tree API of ASM. As a workaround,
* we rewrite the version number of the class to be 50.0
*
* http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6693236
*/
if (version > 50) {
version = 50;
}
super.visit(version, access, name, signature, superName, interfaces);
}

View File

@@ -103,6 +103,7 @@ class StubMethodAdapter extends MethodVisitor {
mParentVisitor.visitInsn(Opcodes.ICONST_1);
mParentVisitor.visitInsn(Opcodes.IRETURN);
mParentVisitor.visitLabel(l1);
mParentVisitor.visitFrame(Opcodes.F_SAME, 0, null, 0, null);
mParentVisitor.visitInsn(Opcodes.ICONST_0);
break;
case Type.CHAR:

View File

@@ -15,6 +15,8 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_JAVA_LANGUAGE_VERSION := 1.8
# Only compile source java files in this lib.
LOCAL_SRC_FILES := $(call all-java-files-under, com)