Use newer dex to verify Kotlin bytecode in tests
This commit is contained in:
Generated
+2
-2
@@ -4,11 +4,11 @@
|
||||
<root url="file://$PROJECT_DIR$/annotations" />
|
||||
</ANNOTATIONS>
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/dx.jar!/" />
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/android-5.0/lib/dx.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/dependencies/dx-sources.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/dependencies/dx-src/src" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
@@ -16,8 +16,11 @@
|
||||
|
||||
package org.jetbrains.jet.codegen;
|
||||
|
||||
import com.android.dx.cf.direct.DirectClassFile;
|
||||
import com.android.dx.cf.direct.StdAttributeFactory;
|
||||
import com.android.dx.command.dexer.Main;
|
||||
import com.android.dx.dex.cf.CfTranslator;
|
||||
import com.android.dx.dex.file.DexFile;
|
||||
import org.jetbrains.jet.OutputFile;
|
||||
import org.junit.Assert;
|
||||
|
||||
@@ -42,7 +45,16 @@ public class DxChecker {
|
||||
|
||||
for (OutputFile file : outputFiles.asList()) {
|
||||
try {
|
||||
CfTranslator.translate(file.getRelativePath(), file.asByteArray(), arguments.cfOptions, arguments.dexOptions);
|
||||
byte[] bytes = file.asByteArray();
|
||||
DirectClassFile cf = new DirectClassFile(bytes, file.getRelativePath(), true);
|
||||
cf.setAttributeFactory(StdAttributeFactory.THE_ONE);
|
||||
CfTranslator.translate(
|
||||
cf,
|
||||
bytes,
|
||||
arguments.cfOptions,
|
||||
arguments.dexOptions,
|
||||
new DexFile(arguments.dexOptions)
|
||||
);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
Assert.fail(generateExceptionMessage(e));
|
||||
|
||||
+14
-1
@@ -123,7 +123,20 @@
|
||||
<get-ant-library version="1.8.0" folderName="ant-1.8"/>
|
||||
|
||||
<!-- dx.jar -->
|
||||
<get-maven-library prefix="com/google/android/tools" lib="dx" version="1.7" target.jar.name.base="dx"/>
|
||||
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
|
||||
<get
|
||||
src="https://dl-ssl.google.com/android/repository/${android-build-tools.zip}"
|
||||
dest="dependencies/download/${android-build-tools.zip}"
|
||||
usetimestamp="true"/>
|
||||
<unzip src="dependencies/download/${android-build-tools.zip}" dest="dependencies"/>
|
||||
|
||||
<property name="android-sources.tgz" value="dx.tar.gz"/>
|
||||
<get
|
||||
src="https://android.googlesource.com/platform/dalvik/+archive/android-5.0.0_r2/${android-sources.tgz}"
|
||||
dest="dependencies/download/${android-sources.tgz}"
|
||||
usetimestamp="true"/>
|
||||
<delete dir="dependencies/dx-src" failonerror="false"/>
|
||||
<untar src="dependencies/download/${android-sources.tgz}" dest="dependencies/dx-src" compression="gzip"/>
|
||||
|
||||
<!-- jflex 1.4 -->
|
||||
<mkdir dir="dependencies/jflex"/>
|
||||
|
||||
Reference in New Issue
Block a user