OSDN Git Service

Fix aidl build.
authorXavier Ducrohet <xav@android.com>
Thu, 10 Feb 2011 02:20:54 +0000 (18:20 -0800)
committerXavier Ducrohet <xav@android.com>
Thu, 10 Feb 2011 02:20:54 +0000 (18:20 -0800)
The aidl output location was not
computed anywhere.

Also added logging code.

Change-Id: I6d0f0d07477be0c3c605c910e6529cb76a8b4ac0

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/AidlProcessor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/SourceFileData.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PreCompilerBuilder.java

index 3d43dfd..9d6a819 100644 (file)
@@ -136,11 +136,16 @@ public class AidlProcessor extends SourceProcessor {
             // look if we already know the output
             SourceFileData data = getFileData(sourceFile);
             if (data == null) {
-                IFile javaFile = getAidlOutputFile(sourceFile, true /*createFolders*/, monitor);
-                data = new SourceFileData(sourceFile, javaFile);
+                data = new SourceFileData(sourceFile);
                 addData(data);
             }
 
+            // if there's no output file yet, compute it.
+            if (data.getOutput() == null) {
+                IFile javaFile = getAidlOutputFile(sourceFile, true /*createFolders*/, monitor);
+                data.setOutputFile(javaFile);
+            }
+
             // finish to set the command line.
             command[index] = quote(osSourcePath);
             command[index + 1] = quote(data.getOutput().getLocation().toOSString());
index 1b6d3fb..d06bf16 100644 (file)
@@ -113,7 +113,11 @@ public class SourceFileData {
      * one file.
      */
     public IFile getOutput() {
-        return mOutputFiles.get(0);
+        if (mOutputFiles.size() > 0) {
+            return mOutputFiles.get(0);
+        }
+
+        return null;
     }
 
     public List<IFile> getOutputFiles() {
index 55978dc..fd3a07d 100644 (file)
@@ -475,6 +475,7 @@ public class PreCompilerBuilder extends BaseBuilder {
                     processorStatus |= processor.compileFiles(this,
                             project, projectTarget, sourceFolderPathList, monitor);
                 } catch (Throwable t) {
+                    AdtPlugin.log(t, "Failed to run one of the source processor");
                 }
             }