]> git.tdb.fi Git - builder.git/blobdiff - source/androidresourcefile.cpp
A bunch of new tools and targets to build Android packages
[builder.git] / source / androidresourcefile.cpp
diff --git a/source/androidresourcefile.cpp b/source/androidresourcefile.cpp
new file mode 100644 (file)
index 0000000..d88f786
--- /dev/null
@@ -0,0 +1,19 @@
+#include <msp/fs/utils.h>
+#include "androidresourcefile.h"
+#include "component.h"
+
+using namespace std;
+using namespace Msp;
+
+AndroidResourceFile::AndroidResourceFile(Builder &b, const Component &c, const FS::Path &p):
+       FileTarget(b, c.get_package(), p)
+{
+       string ext = FS::extpart(FS::basename(p));
+       if(ext==".png" || ext==".jpg")
+               resource_type = "drawable";
+       // TODO recognize various xml files; must inspect contents
+       else
+               resource_type = "raw";
+
+       install_location = "res/"+resource_type;
+}