]> git.tdb.fi Git - builder.git/blobdiff - source/androidmanifestgenerator.cpp
Refactor transitive dependencies to work on all targets
[builder.git] / source / androidmanifestgenerator.cpp
diff --git a/source/androidmanifestgenerator.cpp b/source/androidmanifestgenerator.cpp
deleted file mode 100644 (file)
index 0c48982..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#include <msp/io/file.h>
-#include <msp/io/print.h>
-#include "androidmanifestfile.h"
-#include "androidmanifestgenerator.h"
-#include "component.h"
-#include "internaltask.h"
-#include "sharedlibrary.h"
-#include "sourcepackage.h"
-
-using namespace std;
-using namespace Msp;
-
-AndroidManifestGenerator::AndroidManifestGenerator(Builder &b):
-       Tool(b, "AMG")
-{
-       set_run_internal(_run);
-}
-
-Target *AndroidManifestGenerator::create_target(const vector<Target *> &, const string &)
-{
-       throw logic_error("not implemented");
-}
-
-bool AndroidManifestGenerator::_run(const AndroidManifestFile &manifest)
-{
-       const Component &comp = *manifest.get_component();
-       const SourcePackage &pkg = comp.get_package();
-
-       BuildInfo binfo;
-       manifest.collect_build_info(binfo);
-
-       IO::BufferedFile out(manifest.get_path().str(), IO::M_WRITE);
-       out.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
-       IO::print(out, "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\" package=\"%s\">\n", comp.get_name());
-       out.write("\t<uses-sdk android:minSdkVersion=\"9\" />\n");
-       // TODO Make the icon name configurable
-       bool debuggable = binfo.debug;
-       IO::print(out, "\t<application android:icon=\"@drawable/icon\" android:label=\"%s\" android:hasCode=\"false\" android:debuggable=\"%s\">\n", pkg.get_label(), debuggable);
-       if(SharedLibrary *native_lib = manifest.get_native_library())
-       {
-               out.write("\t\t<activity android:name=\"android.app.NativeActivity\"");
-               const string &orientation = manifest.get_orientation();
-               if(!orientation.empty())
-                       IO::print(out, " android:screenOrientation=\"%s\"", orientation);
-               out.write(">\n");
-               IO::print(out, "\t\t\t<meta-data android:name=\"android.app.lib_name\" android:value=\"%s\" />\n", native_lib->get_libname());
-               out.write("\t\t\t<intent-filter>\n");
-               out.write("\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\n");
-               out.write("\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />\n");
-               out.write("\t\t\t</intent-filter>\n");
-               out.write("\t\t</activity>\n");
-       }
-       out.write("\t</application>\n");
-       for(const string &p: manifest.get_permissions())
-               IO::print(out, "\t<uses-permission android:name=\"%s\" />\n", p);
-       out.write("</manifest>\n");
-
-       return true;
-}