diff options
4 files changed, 68 insertions, 5 deletions
diff --git a/jack-tests/tests/com/android/jack/annotations/ForceInMainDex.java b/jack-tests/tests/com/android/jack/annotations/ForceInMainDex.java new file mode 100644 index 0000000..e37c392 --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotations/ForceInMainDex.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicate that the type must always be in the main dex. + */ +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.TYPE) +public @interface ForceInMainDex { + +} diff --git a/jack-tests/tests/com/android/jack/annotations/MultiDexInstaller.java b/jack-tests/tests/com/android/jack/annotations/MultiDexInstaller.java new file mode 100644 index 0000000..b8d03dc --- /dev/null +++ b/jack-tests/tests/com/android/jack/annotations/MultiDexInstaller.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.jack.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Indicate that the element may be used during the multidex legacy support installation. As such it + * must be kept in main dex along with its dependencies. + */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR}) +public @interface MultiDexInstaller { + +}
\ No newline at end of file diff --git a/jack/tests/com/android/jack/multidex/MultidexMinimalTests.java b/jack/tests/com/android/jack/multidex/MultidexMinimalTests.java index f1c9c88..74dc95b 100644 --- a/jack/tests/com/android/jack/multidex/MultidexMinimalTests.java +++ b/jack/tests/com/android/jack/multidex/MultidexMinimalTests.java @@ -149,7 +149,7 @@ public class MultidexMinimalTests { File annotations = TestTools.createTempDir("multidexAnnotations", ""); TestTools.compileSourceToJack(new Options(), TestTools.getFromAndroidTree( - "toolchain/jack/jack/src/com/android/jack/annotations/"), + "toolchain/jack/jack-tests/tests/com/android/jack/annotations/"), TestTools.getDefaultBootclasspathString(), annotations, false); return annotations; } diff --git a/jack/tests/com/android/jack/preprocessor/PreProcessorTest.java b/jack/tests/com/android/jack/preprocessor/PreProcessorTest.java index b22fab2..81cfc13 100644 --- a/jack/tests/com/android/jack/preprocessor/PreProcessorTest.java +++ b/jack/tests/com/android/jack/preprocessor/PreProcessorTest.java @@ -94,8 +94,8 @@ public class PreProcessorTest { public void test001_002() throws Exception { File testDir = TestTools.getJackTestsWithJackFolder("preprocessor/test001"); Options options = TestTools.buildCommandLineArgs(testDir); - options.addProperty("jack.annotation.adder.hasfile", "true"); - options.addProperty("jack.annotation.adder.file", + options.addProperty(PreProcessor.ENABLE.getName(), "true"); + options.addProperty(PreProcessor.FILE.getName(), new File(testDir, "config.jpp").getAbsolutePath()); TestTools.compileSourceToDex(options, testDir, TestTools.getDefaultBootclasspathString(), TestTools.createTempFile("annotationAdderTest", ".out.zip"), true); @@ -126,8 +126,8 @@ public class PreProcessorTest { } } - JAnnotation installerAnnotation = - session.getPhantomLookup().getAnnotation("Lcom/android/jack/preprocessor/test001/jack/MultiDexInstaller;"); + JAnnotation installerAnnotation = session.getPhantomLookup().getAnnotation( + "Lcom/android/jack/preprocessor/test001/jack/MultiDexInstaller;"); JNodeLookup lookup = session.getLookup(); { JDefinedClassOrInterface coi = lookup.getClass( |