diff options
7 files changed, 133 insertions, 82 deletions
diff --git a/anttasks/src/com/android/ant/ApkBuilderTask.java b/anttasks/src/com/android/ant/ApkBuilderTask.java index bc5f53c3a..d7ffd9c4d 100644 --- a/anttasks/src/com/android/ant/ApkBuilderTask.java +++ b/anttasks/src/com/android/ant/ApkBuilderTask.java @@ -17,9 +17,9 @@ package com.android.ant; import com.android.sdklib.build.ApkBuilder; -import com.android.sdklib.build.ApkBuilder.ApkCreationException; -import com.android.sdklib.build.ApkBuilder.DuplicateFileException; -import com.android.sdklib.build.ApkBuilder.SealedApkException; +import com.android.sdklib.build.ApkCreationException; +import com.android.sdklib.build.DuplicateFileException; +import com.android.sdklib.build.SealedApkException; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ApkBuilderHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ApkBuilderHelper.java index 3c2d86a2b..5915ebb69 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ApkBuilderHelper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/ApkBuilderHelper.java @@ -28,10 +28,10 @@ import com.android.prefs.AndroidLocation.AndroidLocationException; import com.android.sdklib.IAndroidTarget; import com.android.sdklib.SdkConstants; import com.android.sdklib.build.ApkBuilder; -import com.android.sdklib.build.ApkBuilder.ApkCreationException; -import com.android.sdklib.build.ApkBuilder.DuplicateFileException; +import com.android.sdklib.build.ApkCreationException; +import com.android.sdklib.build.DuplicateFileException; +import com.android.sdklib.build.SealedApkException; import com.android.sdklib.build.ApkBuilder.JarStatus; -import com.android.sdklib.build.ApkBuilder.SealedApkException; import com.android.sdklib.internal.build.DebugKeyProvider; import com.android.sdklib.internal.build.SignedJarBuilder; import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException; diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java index 9f1fc84df..cd6d37c75 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java @@ -22,7 +22,6 @@ import com.android.sdklib.internal.build.SignedJarBuilder; import com.android.sdklib.internal.build.DebugKeyProvider.IKeyGenOutput; import com.android.sdklib.internal.build.DebugKeyProvider.KeytoolException; import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter; -import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; import java.io.File; import java.io.FileInputStream; @@ -166,78 +165,6 @@ public final class ApkBuilder { private final HashMap<String, File> mAddedFiles = new HashMap<String, File>(); /** - * An exception thrown during packaging of an APK file. - */ - public final static class ApkCreationException extends Exception { - private static final long serialVersionUID = 1L; - - public ApkCreationException(String format, Object... args) { - super(String.format(format, args)); - } - - public ApkCreationException(Throwable cause, String format, Object... args) { - super(String.format(format, args), cause); - } - - public ApkCreationException(Throwable cause) { - super(cause); - } - } - - /** - * An exception thrown during packaging of an APK file. - */ - public final static class DuplicateFileException extends ZipAbortException { - private static final long serialVersionUID = 1L; - private final String mArchivePath; - private final File mFile1; - private final File mFile2; - - public DuplicateFileException(String archivePath, File file1, File file2) { - super(); - mArchivePath = archivePath; - mFile1 = file1; - mFile2 = file2; - } - - public String getArchivePath() { - return mArchivePath; - } - - public File getFile1() { - return mFile1; - } - - public File getFile2() { - return mFile2; - } - - @Override - public String getMessage() { - return "Duplicate files at the same path inside the APK"; - } - } - - /** - * An exception thrown when trying to add files to a sealed APK. - */ - public final static class SealedApkException extends Exception { - private static final long serialVersionUID = 1L; - - public SealedApkException(String format, Object... args) { - super(String.format(format, args)); - } - - public SealedApkException(Throwable cause, String format, Object... args) { - super(String.format(format, args), cause); - } - - public SealedApkException(Throwable cause) { - super(cause); - } - } - - /** * Status for the addition of a jar file resources into the APK. * This indicates possible issues with native library inside the jar file. */ diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java index 626e285d2..f139eec50 100644 --- a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilderMain.java @@ -16,9 +16,6 @@ package com.android.sdklib.build; -import com.android.sdklib.build.ApkBuilder.ApkCreationException; -import com.android.sdklib.build.ApkBuilder.DuplicateFileException; -import com.android.sdklib.build.ApkBuilder.SealedApkException; import java.io.File; import java.io.FilenameFilter; diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java new file mode 100644 index 000000000..2379915dc --- /dev/null +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkCreationException.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 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.sdklib.build; + +/** + * An exception thrown during packaging of an APK file. + */ +public final class ApkCreationException extends Exception { + private static final long serialVersionUID = 1L; + + public ApkCreationException(String format, Object... args) { + super(String.format(format, args)); + } + + public ApkCreationException(Throwable cause, String format, Object... args) { + super(String.format(format, args), cause); + } + + public ApkCreationException(Throwable cause) { + super(cause); + } +}
\ No newline at end of file diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java new file mode 100644 index 000000000..ba53ba37c --- /dev/null +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/DuplicateFileException.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2010 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.sdklib.build; + +import com.android.sdklib.internal.build.SignedJarBuilder.IZipEntryFilter.ZipAbortException; + +import java.io.File; + +/** + * An exception thrown during packaging of an APK file. + */ +public final class DuplicateFileException extends ZipAbortException { + private static final long serialVersionUID = 1L; + private final String mArchivePath; + private final File mFile1; + private final File mFile2; + + public DuplicateFileException(String archivePath, File file1, File file2) { + super(); + mArchivePath = archivePath; + mFile1 = file1; + mFile2 = file2; + } + + public String getArchivePath() { + return mArchivePath; + } + + public File getFile1() { + return mFile1; + } + + public File getFile2() { + return mFile2; + } + + @Override + public String getMessage() { + return "Duplicate files at the same path inside the APK"; + } +}
\ No newline at end of file diff --git a/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java new file mode 100644 index 000000000..97f03bdec --- /dev/null +++ b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/SealedApkException.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 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.sdklib.build; + +/** + * An exception thrown when trying to add files to a sealed APK. + */ +public final class SealedApkException extends Exception { + private static final long serialVersionUID = 1L; + + public SealedApkException(String format, Object... args) { + super(String.format(format, args)); + } + + public SealedApkException(Throwable cause, String format, Object... args) { + super(String.format(format, args), cause); + } + + public SealedApkException(Throwable cause) { + super(cause); + } +}
\ No newline at end of file |