From 5c0eca5fa732c75113adca07059615a6cd9223ad Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 4 Jul 2012 12:00:35 +0200 Subject: [PATCH] Started fat (multi-architecture) libraries support (work in progress) --- app/src/processing/app/Base.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 3f8d1793e..025d0d475 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -1038,12 +1038,27 @@ public class Base { continue; } + subfolder = scanFatLibrary(subfolder); + // (also replace previously found libs with the same name) - res.put(libName, subfolder); + if (subfolder != null) + res.put(libName, subfolder); } return res; } + public File scanFatLibrary(File libFolder) { + // Fat libraries must have metadata.txt file + File propFile = new File(libFolder, "metadata.txt"); + if (!propFile.exists()) + return libFolder; + // Search for a subfolder for actual architecture, return null if not found + File archSubfolder = new File(libFolder, Base.getTargetPlatform().getName()); + if (!archSubfolder.exists() || !archSubfolder.isDirectory()) + return null; + return archSubfolder; + } + public void onBoardOrPortChange() { // Calculate paths for libraries and examples examplesFolder = getContentFile("examples");