summaryrefslogtreecommitdiffstats
path: root/jack-api
diff options
context:
space:
mode:
authormikaelpeltier <mikaelpeltier@google.com>2015-03-02 16:48:31 +0100
committermikaelpeltier <mikaelpeltier@google.com>2015-03-03 12:03:40 +0100
commit0c596931ccea50a3c3e6ba07e8a4d55cfc6b2f77 (patch)
treee4c0e4c9f2fb401a4291d8c86feabd31ee929b1a /jack-api
parent46a13dda75b93d2f63ea612496b11e75887c47e1 (diff)
downloadtoolchain_jack-0c596931ccea50a3c3e6ba07e8a4d55cfc6b2f77.zip
toolchain_jack-0c596931ccea50a3c3e6ba07e8a4d55cfc6b2f77.tar.gz
toolchain_jack-0c596931ccea50a3c3e6ba07e8a4d55cfc6b2f77.tar.bz2
Update Api01Config interface
- Add methods to set command line options and property values Change-Id: I59ce6084fe9cd0be59fa7e5c2498f38b94a27291
Diffstat (limited to 'jack-api')
-rw-r--r--jack-api/src/com/android/jack/api/example/Main.java6
-rw-r--r--jack-api/src/com/android/jack/api01/Api01Config.java73
-rw-r--r--jack-api/src/com/android/jack/api01/JavaSourceVersion.java24
-rw-r--r--jack-api/src/com/android/jack/api01/MultiDexKind.java24
-rw-r--r--jack-api/src/com/android/jack/api01/ReporterKind.java24
-rw-r--r--jack-api/src/com/android/jack/api01/ResourceCollisionPolicy.java24
-rw-r--r--jack-api/src/com/android/jack/api01/TypeCollisionPolicy.java24
-rw-r--r--jack-api/src/com/android/jack/api01/VerbosityLevel.java28
8 files changed, 218 insertions, 9 deletions
diff --git a/jack-api/src/com/android/jack/api/example/Main.java b/jack-api/src/com/android/jack/api/example/Main.java
index be60cfa..51b7459 100644
--- a/jack-api/src/com/android/jack/api/example/Main.java
+++ b/jack-api/src/com/android/jack/api/example/Main.java
@@ -73,10 +73,8 @@ public class Main {
// Configure the compiler
try {
// Set standard options
- api01Config.setOutputDexFolder(new File("out/"));
- api01Config.setConfigJarjarFile(new File("rules.jarjar"));
- // Set official properties
- api01Config.setProperty(Api01Config.PROPERTY_REPORTER, "sdk");
+ api01Config.setOutputDexDir(new File("out/"));
+ api01Config.setJarJarConfigFile(new File("rules.jarjar"));
// Set provisional properties
api01Config.setProperty("jack.internal.test", "true");
// Check and build compiler
diff --git a/jack-api/src/com/android/jack/api01/Api01Config.java b/jack-api/src/com/android/jack/api01/Api01Config.java
index 001690f..6549b54 100644
--- a/jack-api/src/com/android/jack/api01/Api01Config.java
+++ b/jack-api/src/com/android/jack/api01/Api01Config.java
@@ -19,6 +19,9 @@ package com.android.jack.api01;
import com.android.jack.api.JackConfig;
import java.io.File;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Map;
import javax.annotation.Nonnull;
@@ -26,20 +29,80 @@ import javax.annotation.Nonnull;
* STOPSHIP
*/
public interface Api01Config extends JackConfig {
+
+ @Nonnull
+ void setReporter(@Nonnull ReporterKind reporterKind, @Nonnull OutputStream reporterStream)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setTypeImportCollisionPolicy(@Nonnull TypeCollisionPolicy typeImportCollisionPolicy)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setResourceImportCollisionPolicy(
+ @Nonnull ResourceCollisionPolicy resourceImportCollisionPolicy) throws ConfigurationException;
+
+ @Nonnull
+ void setJavaSourceVersion(@Nonnull JavaSourceVersion javaSourceVersion)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setObfuscationMappingOutputFile(@Nonnull File obfuscationMappingOuputFile)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setClasspath(@Nonnull List<File> classpath) throws ConfigurationException;
+
+ @Nonnull
+ void setImportedJackLibraryFiles(@Nonnull List<File> importedJackLibraryFiles)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setMetaDirs(@Nonnull List<File> metaDirs) throws ConfigurationException;
+
+ @Nonnull
+ void setResourceDirs(@Nonnull List<File> resourceDirs) throws ConfigurationException;
+
+ @Nonnull
+ void setIncrementalDir(@Nonnull File incrementalDir) throws ConfigurationException;
+
+ @Nonnull
+ void setOutputDexDir(@Nonnull File outputDexDir) throws ConfigurationException;
+
+ @Nonnull
+ void setOutputJackFile(@Nonnull File outputJackFile) throws ConfigurationException;
+
+ @Nonnull
+ void setJarJarConfigFile(@Nonnull File jarjarConfigFile) throws ConfigurationException;
+
+ @Nonnull
+ void setProguardConfigFiles(@Nonnull List<File> proguardConfigFiles)
+ throws ConfigurationException;
+
+ @Nonnull
+ void setEmitDebug(boolean emitDebug) throws ConfigurationException;
+
+ @Nonnull
+ void setMultiDexKind(@Nonnull MultiDexKind multiDexKind) throws ConfigurationException;
+
+ @Nonnull
+ void setVerbosityLevel(@Nonnull VerbosityLevel verbosityLevel) throws ConfigurationException;
+
@Nonnull
- static final String PROPERTY_REPORTER = "jack.reporter";
+ void setProcessorNames(@Nonnull List<String> processorNames) throws ConfigurationException;
@Nonnull
- Api01Config setOutputDexFolder(@Nonnull File folder) throws ConfigurationException;
+ void setProcessorPath(@Nonnull List<File> processorPath) throws ConfigurationException;
@Nonnull
- Api01Config setOutputJackFile(@Nonnull File file) throws ConfigurationException;
+ void setProcessorOptions(@Nonnull Map<String, String> processorOptions)
+ throws ConfigurationException;
@Nonnull
- Api01Config setConfigJarjarFile(@Nonnull File file) throws ConfigurationException;
+ void setSourceEntries(@Nonnull List<File> sourceEntries) throws ConfigurationException;
@Nonnull
- Api01Config setProperty(@Nonnull String key, @Nonnull String value) throws ConfigurationException;
+ void setProperty(@Nonnull String key, @Nonnull String value) throws ConfigurationException;
@Nonnull
Api01Compiler build() throws ConfigurationException;
diff --git a/jack-api/src/com/android/jack/api01/JavaSourceVersion.java b/jack-api/src/com/android/jack/api01/JavaSourceVersion.java
new file mode 100644
index 0000000..5b8090d
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/JavaSourceVersion.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+/**
+ * Supported Java source version.
+ */
+public enum JavaSourceVersion {
+ JAVA_3, JAVA_4, JAVA_5, JAVA_6, JAVA_7
+}
diff --git a/jack-api/src/com/android/jack/api01/MultiDexKind.java b/jack-api/src/com/android/jack/api01/MultiDexKind.java
new file mode 100644
index 0000000..4e4294a
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/MultiDexKind.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+/**
+ * Available mode for the multidex feature
+ */
+public enum MultiDexKind {
+ NONE, NATIVE, LEGACY
+} \ No newline at end of file
diff --git a/jack-api/src/com/android/jack/api01/ReporterKind.java b/jack-api/src/com/android/jack/api01/ReporterKind.java
new file mode 100644
index 0000000..ab7a953
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/ReporterKind.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+/**
+ * Available reporters.
+ */
+public enum ReporterKind {
+ DEFAULT, SDK
+} \ No newline at end of file
diff --git a/jack-api/src/com/android/jack/api01/ResourceCollisionPolicy.java b/jack-api/src/com/android/jack/api01/ResourceCollisionPolicy.java
new file mode 100644
index 0000000..4b52c2e
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/ResourceCollisionPolicy.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+/**
+ * How to handle resource collisions.
+ */
+public enum ResourceCollisionPolicy {
+ KEEP_FIRST, FAIL
+}
diff --git a/jack-api/src/com/android/jack/api01/TypeCollisionPolicy.java b/jack-api/src/com/android/jack/api01/TypeCollisionPolicy.java
new file mode 100644
index 0000000..73ac802
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/TypeCollisionPolicy.java
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+/**
+ * How to handle type collisions.
+ */
+public enum TypeCollisionPolicy {
+ KEEP_FIRST, FAIL
+}
diff --git a/jack-api/src/com/android/jack/api01/VerbosityLevel.java b/jack-api/src/com/android/jack/api01/VerbosityLevel.java
new file mode 100644
index 0000000..72b1c6f
--- /dev/null
+++ b/jack-api/src/com/android/jack/api01/VerbosityLevel.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2015 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.api01;
+
+
+/**
+ * Jack verbosity level
+ */
+public enum VerbosityLevel {
+ ERROR,
+ WARNING,
+ INFO,
+ DEBUG
+} \ No newline at end of file