diff options
author | Xavier Ducrohet <xav@android.com> | 2011-03-07 16:16:05 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2011-03-07 16:28:44 -0800 |
commit | 42eacadbbc08117db91f04051fced92c157f3d53 (patch) | |
tree | f80507a3108e867bd2386b160950f5ab094be479 /eclipse | |
parent | 1d0a2869f34ff2c12e57bac5dcd85da8b5ce8e10 (diff) | |
download | sdk-42eacadbbc08117db91f04051fced92c157f3d53.zip sdk-42eacadbbc08117db91f04051fced92c157f3d53.tar.gz sdk-42eacadbbc08117db91f04051fced92c157f3d53.tar.bz2 |
Add logging to precompiler builder.
There are some reports of NPE in the builders on mDerivedProgressMonitor
which means startupOnInitialize would fail to finish.
This adds a log in the method should an exception be thrown.
Change-Id: I90170b0dcc3c97a772b5d72111db9dbbbf2ee277
Diffstat (limited to 'eclipse')
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java index 167f39f..945cd93 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java @@ -539,28 +539,32 @@ public class PreCompilerBuilder extends BaseBuilder { @Override protected void startupOnInitialize() { - super.startupOnInitialize(); - - IProject project = getProject(); + try { + super.startupOnInitialize(); - // load the previous IFolder and java package. - mManifestPackage = loadProjectStringProperty(PROPERTY_PACKAGE); + IProject project = getProject(); - // get the source folder in which all the Java files are created - mGenFolder = project.getFolder(SdkConstants.FD_GEN_SOURCES); + // load the previous IFolder and java package. + mManifestPackage = loadProjectStringProperty(PROPERTY_PACKAGE); - // Load the current compile flags. We ask for true if not found to force a recompile. - mMustCompileResources = loadProjectBooleanProperty(PROPERTY_COMPILE_RESOURCES, true); + // get the source folder in which all the Java files are created + mGenFolder = project.getFolder(SdkConstants.FD_GEN_SOURCES); + mDerivedProgressMonitor = new DerivedProgressMonitor(mGenFolder); - IJavaProject javaProject = JavaCore.create(project); + // Load the current compile flags. We ask for true if not found to force a recompile. + mMustCompileResources = loadProjectBooleanProperty(PROPERTY_COMPILE_RESOURCES, true); - // load the source processors - SourceProcessor aidlProcessor = new AidlProcessor(javaProject, mGenFolder); - mProcessors.add(aidlProcessor); - SourceProcessor renderScriptProcessor = new RenderScriptProcessor(javaProject, mGenFolder); - mProcessors.add(renderScriptProcessor); + IJavaProject javaProject = JavaCore.create(project); - mDerivedProgressMonitor = new DerivedProgressMonitor(mGenFolder); + // load the source processors + SourceProcessor aidlProcessor = new AidlProcessor(javaProject, mGenFolder); + mProcessors.add(aidlProcessor); + SourceProcessor renderScriptProcessor = new RenderScriptProcessor(javaProject, + mGenFolder); + mProcessors.add(renderScriptProcessor); + } catch (Throwable throwable) { + AdtPlugin.log(throwable, "Failed to finish PrecompilerBuilder#startupOnInitialize()"); + } } /** |