Skip to content

Commit e90921f

Browse files
committed
override default build scripts for cardboard libraries
1 parent ac43510 commit e90921f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/processing/mode/android/AndroidBuild.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,17 @@ public File createProject() throws IOException, SketchException {
306306
commonRes = referenceLibraryProject(targetID, tmpFolder.getAbsolutePath(), "libs/cardboard_common");
307307
coreRes = referenceLibraryProject(targetID, tmpFolder.getAbsolutePath(), "libs/cardboard_core");
308308
if (audioRes && commonRes && coreRes) {
309-
System.out.println("Library projects referenced succesfully!");
309+
System.out.println("Library projects referenced succesfully!");
310+
// Finally, re-write the build files so they use org.eclipse.jdt.core.JDTCompilerAdapter
311+
// instead of com.sun.tools.javac.Main
312+
// TODO: use the build file generated by the android tools, and
313+
// add the custom section redefining the target
314+
File audioBuildFile = new File(audioLibsFolder, "build.xml");
315+
writeBuildXML(audioBuildFile, "cardboard_audio");
316+
File commonBuildFile = new File(commonLibsFolder, "build.xml");
317+
writeBuildXML(commonBuildFile, "cardboard_common");
318+
File coreBuildFile = new File(coreLibsFolder, "build.xml");
319+
writeBuildXML(coreBuildFile, "cardboard_core");
310320
}
311321
}
312322
}
@@ -819,7 +829,7 @@ private void writeBuildXML(final File file, final String projectName) {
819829

820830
writer.println(" <echo message=\"${build.compiler}\" />");
821831

822-
// Override target from maint android build file
832+
// Override target from main android build file
823833
writer.println(" <target name=\"-compile\" depends=\"-pre-build, -build-setup, -code-gen, -pre-compile\">");
824834
writer.println(" <do-only-if-manifest-hasCode elseText=\"hasCode = false. Skipping...\">");
825835
writer.println(" <path id=\"project.javac.classpath\">");

0 commit comments

Comments
 (0)