-#include <cstdlib>
+#include <msp/core/environ.h>
#include <msp/fs/dir.h>
#include <msp/fs/stat.h>
#include <msp/strings/format.h>
builder(b)
{
string var = format("ANDROID_%s_ROOT", type);
- if(const char *value = getenv(var.c_str()))
- root = value;
- else if(!default_path.empty() && FS::exists(default_path))
- root = default_path;
- else
+ root = getenv(var);
+ if(root.empty())
{
- builder.get_logger().log("problems", format("Android %s not found", type));
- return;
+ if(!default_path.empty() && FS::exists(default_path))
+ root = default_path;
+ else
+ {
+ builder.get_logger().log("problems", format("Android %s not found", type));
+ return;
+ }
}
FS::Path platforms_dir = root/"platforms";
-#include <cstdlib>
+#include <msp/core/environ.h>
#include <msp/fs/utils.h>
#include "component.h"
#include "externaltask.h"
argv.push_back(executable->get_path().str());
// TODO Make this generic
- FS::Path home_dir = getenv("HOME");
+ FS::Path home_dir = Msp::getenv("HOME");
argv.push_back("-keystore");
argv.push_back((home_dir/".android"/"debug.keystore").str());
argv.push_back("-storepass");
-#include <cstdlib>
+#include <msp/core/environ.h>
#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include <msp/io/print.h>
SearchPath path;
if(FS::Path(name).is_absolute())
path.push_back("/");
- else if(const char *env_path = getenv("PATH"))
- {
- vector<string> parts = split(env_path, ':');
- for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
- path.push_back(*i);
- }
else
{
- path.push_back("/bin");
- path.push_back("/usr/bin");
+ string env_path = Msp::getenv("PATH");
+ if(!env_path.empty())
+ {
+ vector<string> parts = split(env_path, ':');
+ for(vector<string>::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ path.push_back(*i);
+ }
+ else
+ {
+ path.push_back("/bin");
+ path.push_back("/usr/bin");
+ }
}
for(SearchPath::const_iterator i=path.begin(); i!=path.end(); ++i)