summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/Android.mk9
-rw-r--r--tools/aapt/CacheUpdater.h4
-rw-r--r--tools/aapt/Command.cpp4
-rw-r--r--tools/aapt/CrunchCache.cpp1
-rw-r--r--tools/aapt/Main.cpp1
-rw-r--r--tools/aapt/Resource.cpp2
-rw-r--r--tools/aapt/StringPool.h2
-rw-r--r--tools/aapt/XMLNode.cpp2
-rw-r--r--tools/aapt/XMLNode.h2
-rw-r--r--tools/aapt2/Android.mk8
-rw-r--r--tools/aapt2/Files.cpp4
-rw-r--r--tools/aapt2/SourceXmlPullParser.h2
-rw-r--r--tools/aapt2/XmlDom.cpp2
-rw-r--r--tools/aapt2/XmlDom.h2
-rw-r--r--tools/aidl/aidl.cpp15
-rw-r--r--tools/aidl/aidl_language.cpp2
-rw-r--r--tools/aidl/os.h26
-rw-r--r--tools/aidl/search_path.cpp5
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java2
19 files changed, 59 insertions, 36 deletions
diff --git a/tools/aapt/Android.mk b/tools/aapt/Android.mk
index b991d55dc343..769e2a172ce8 100644
--- a/tools/aapt/Android.mk
+++ b/tools/aapt/Android.mk
@@ -54,11 +54,6 @@ aaptTests := \
tests/ResourceFilter_test.cpp \
tests/ResourceTable_test.cpp
-aaptCIncludes := \
- system/core/base/include \
- external/libpng \
- external/zlib
-
aaptHostLdLibs :=
aaptHostStaticLibs := \
libandroidfw \
@@ -70,7 +65,7 @@ aaptHostStaticLibs := \
libziparchive-host \
libbase
-aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER)\"
+aaptCFlags := -DAAPT_VERSION=\"$(BUILD_NUMBER_FROM_FILE)\"
aaptCFlags += -Wall -Werror
ifeq ($(HOST_OS),linux)
@@ -97,8 +92,8 @@ LOCAL_CPPFLAGS += $(aaptCppFlags)
ifeq (darwin,$(HOST_OS))
LOCAL_CFLAGS += -D_DARWIN_UNLIMITED_STREAMS
endif
-LOCAL_C_INCLUDES += $(aaptCIncludes)
LOCAL_SRC_FILES := $(aaptSources)
+LOCAL_STATIC_LIBRARIES += $(aaptHostStaticLibs)
include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/tools/aapt/CacheUpdater.h b/tools/aapt/CacheUpdater.h
index fade53ac2629..10a1bbc2f4aa 100644
--- a/tools/aapt/CacheUpdater.h
+++ b/tools/aapt/CacheUpdater.h
@@ -12,7 +12,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include "Images.h"
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
#include <direct.h>
#endif
@@ -81,7 +81,7 @@ public:
// Advance to the next segment of the path
existsPath.appendPath(toCreate.walkPath(&remains));
toCreate = remains;
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_mkdir(existsPath.string());
#else
mkdir(existsPath.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 8a0a39cfb445..d12ab3b725c8 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -215,7 +215,7 @@ int doList(Bundle* bundle)
goto bail;
}
-#ifdef HAVE_ANDROID_OS
+#ifdef __ANDROID__
static const bool kHaveAndroidOs = true;
#else
static const bool kHaveAndroidOs = false;
@@ -633,7 +633,7 @@ int doDump(Bundle* bundle)
Asset* asset = NULL;
if (strcmp("resources", option) == 0) {
-#ifndef HAVE_ANDROID_OS
+#ifndef __ANDROID__
res.print(bundle->getValues());
#endif
diff --git a/tools/aapt/CrunchCache.cpp b/tools/aapt/CrunchCache.cpp
index 6c39d1d7753c..0d574cf127dd 100644
--- a/tools/aapt/CrunchCache.cpp
+++ b/tools/aapt/CrunchCache.cpp
@@ -5,6 +5,7 @@
// This file defines functions laid out and documented in
// CrunchCache.h
+#include <utils/Compat.h>
#include <utils/Vector.h>
#include <utils/String8.h>
diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp
index f832c605376c..bcf0d5e53c07 100644
--- a/tools/aapt/Main.cpp
+++ b/tools/aapt/Main.cpp
@@ -6,6 +6,7 @@
#include "Main.h"
#include "Bundle.h"
+#include <utils/Compat.h>
#include <utils/Log.h>
#include <utils/threads.h>
#include <utils/List.h>
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 5d208152e084..a4e5d3de69c1 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2682,7 +2682,7 @@ status_t writeResourceSymbols(Bundle* bundle, const sp<AaptAssets>& assets,
if (s > last && (*s == '.' || *s == 0)) {
String8 part(last, s-last);
dest.appendPath(part);
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_mkdir(dest.string());
#else
mkdir(dest.string(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt/StringPool.h b/tools/aapt/StringPool.h
index dbe8c8542185..4b0d920c3274 100644
--- a/tools/aapt/StringPool.h
+++ b/tools/aapt/StringPool.h
@@ -20,8 +20,6 @@
#include <ctype.h>
#include <errno.h>
-#include <libexpat/expat.h>
-
using namespace android;
#define PRINT_STRING_METRICS 0
diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp
index ca3f68748ef9..dc08eb806356 100644
--- a/tools/aapt/XMLNode.cpp
+++ b/tools/aapt/XMLNode.cpp
@@ -12,7 +12,7 @@
#include <errno.h>
#include <string.h>
-#ifndef HAVE_MS_C_RUNTIME
+#ifndef _WIN32
#define O_BINARY 0
#endif
diff --git a/tools/aapt/XMLNode.h b/tools/aapt/XMLNode.h
index 3161f6500291..b9e5cd574cdc 100644
--- a/tools/aapt/XMLNode.h
+++ b/tools/aapt/XMLNode.h
@@ -10,6 +10,8 @@
#include "StringPool.h"
#include "ResourceTable.h"
+#include <expat.h>
+
class XMLNode;
extern const char* const RESOURCES_ROOT_NAMESPACE;
diff --git a/tools/aapt2/Android.mk b/tools/aapt2/Android.mk
index 10f81502f268..e5c42d5f74c1 100644
--- a/tools/aapt2/Android.mk
+++ b/tools/aapt2/Android.mk
@@ -82,10 +82,6 @@ testSources := \
XmlDom_test.cpp \
XmlFlattener_test.cpp
-cIncludes := \
- external/libpng \
- external/libz
-
hostLdLibs :=
hostStaticLibs := \
@@ -114,7 +110,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libaapt2
LOCAL_SRC_FILES := $(sources)
-LOCAL_C_INCLUDES += $(cIncludes)
+LOCAL_STATIC_LIBRARIES += $(hostStaticLibs)
LOCAL_CFLAGS += $(cFlags)
LOCAL_CPPFLAGS += $(cppFlags)
@@ -130,7 +126,6 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(testSources)
-LOCAL_C_INCLUDES += $(cIncludes)
LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
LOCAL_LDLIBS += $(hostLdLibs)
LOCAL_CFLAGS += $(cFlags)
@@ -146,7 +141,6 @@ LOCAL_MODULE := aapt2
LOCAL_SRC_FILES := $(main)
-LOCAL_C_INCLUDES += $(cIncludes)
LOCAL_STATIC_LIBRARIES += libaapt2 $(hostStaticLibs)
LOCAL_LDLIBS += $(hostLdLibs)
LOCAL_CFLAGS += $(cFlags)
diff --git a/tools/aapt2/Files.cpp b/tools/aapt2/Files.cpp
index 8484148f29d3..b24ff6bb6291 100644
--- a/tools/aapt2/Files.cpp
+++ b/tools/aapt2/Files.cpp
@@ -22,7 +22,7 @@
#include <string>
#include <sys/stat.h>
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
// Windows includes.
#include <direct.h>
#endif
@@ -83,7 +83,7 @@ std::vector<std::string> listFiles(const StringPiece& root) {
}
inline static int mkdirImpl(const StringPiece& path) {
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
return _mkdir(path.toString().c_str());
#else
return mkdir(path.toString().c_str(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
diff --git a/tools/aapt2/SourceXmlPullParser.h b/tools/aapt2/SourceXmlPullParser.h
index 15936d655745..d8ed45952b31 100644
--- a/tools/aapt2/SourceXmlPullParser.h
+++ b/tools/aapt2/SourceXmlPullParser.h
@@ -20,7 +20,7 @@
#include "XmlPullParser.h"
#include <istream>
-#include <libexpat/expat.h>
+#include <expat.h>
#include <queue>
#include <stack>
#include <string>
diff --git a/tools/aapt2/XmlDom.cpp b/tools/aapt2/XmlDom.cpp
index 763029fd4157..b8b2d1295067 100644
--- a/tools/aapt2/XmlDom.cpp
+++ b/tools/aapt2/XmlDom.cpp
@@ -312,7 +312,7 @@ std::unique_ptr<Node> inflate(const void* data, size_t dataLen, SourceLogger* lo
}
}
}
- return std::move(root);
+ return root;
}
Node::Node(NodeType type) : type(type), parent(nullptr), lineNumber(0), columnNumber(0) {
diff --git a/tools/aapt2/XmlDom.h b/tools/aapt2/XmlDom.h
index 69318840445d..035e7c46d1b5 100644
--- a/tools/aapt2/XmlDom.h
+++ b/tools/aapt2/XmlDom.h
@@ -21,7 +21,7 @@
#include "StringPiece.h"
#include <istream>
-#include <libexpat/expat.h>
+#include <expat.h>
#include <memory>
#include <string>
#include <vector>
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index 14c9f95a247b..438007f527d5 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -1,6 +1,7 @@
#include "aidl_language.h"
#include "options.h"
+#include "os.h"
#include "search_path.h"
#include "Type.h"
#include "generate_java.h"
@@ -14,7 +15,7 @@
#include <string.h>
#include <map>
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <sys/stat.h>
@@ -177,7 +178,7 @@ check_filename(const char* filename, const char* package, buffer_type* name)
char cwd[MAXPATHLEN];
bool valid = false;
-#ifdef HAVE_WINDOWS_PATHS
+#ifdef _WIN32
if (isalpha(filename[0]) && filename[1] == ':'
&& filename[2] == OS_PATH_SEPARATOR) {
#else
@@ -217,7 +218,7 @@ check_filename(const char* filename, const char* package, buffer_type* name)
if (valid) {
p = fn.c_str() + (len - expected.length());
-#ifdef HAVE_WINDOWS_PATHS
+#ifdef _WIN32
if (OS_PATH_SEPARATOR != '/') {
// Input filename under cygwin most likely has / separators
// whereas the expected string uses \\ separators. Adjust
@@ -675,6 +676,10 @@ generate_dep_file(const Options& options, const document_item_type* items)
fprintf(to, "\n");
+ // Output "<input_aidl_file>: " so make won't fail if the input .aidl file
+ // has been deleted, moved or renamed in incremental build.
+ fprintf(to, "%s :\n", options.inputFileName.c_str());
+
// Output "<imported_file>: " so make won't fail if the imported file has
// been deleted, moved or renamed in incremental build.
import = g_imports;
@@ -749,7 +754,7 @@ check_outputFilePath(const string& path) {
if (path[i] == OS_PATH_SEPARATOR) {
string p = path.substr(0, i);
if (access(path.data(), F_OK) != 0) {
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_mkdir(p.data());
#else
mkdir(p.data(), S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP);
@@ -1108,7 +1113,7 @@ preprocess_aidl(const Options& options)
// write preprocessed file
int fd = open( options.outputFileName.c_str(),
O_RDWR|O_CREAT|O_TRUNC|O_BINARY,
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
_S_IREAD|_S_IWRITE);
#else
S_IRUSR|S_IWUSR|S_IRGRP);
diff --git a/tools/aidl/aidl_language.cpp b/tools/aidl/aidl_language.cpp
index cd6a3bd5dfc1..5fab6c26431a 100644
--- a/tools/aidl/aidl_language.cpp
+++ b/tools/aidl/aidl_language.cpp
@@ -3,7 +3,7 @@
#include <string.h>
#include <stdlib.h>
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
int isatty(int fd)
{
return (fd == 0);
diff --git a/tools/aidl/os.h b/tools/aidl/os.h
new file mode 100644
index 000000000000..79d2c35eea3d
--- /dev/null
+++ b/tools/aidl/os.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _FRAMEWORKS_BASE_TOOLS_AIDL_OS_SEP_H_
+#define _FRAMEWORKS_BASE_TOOLS_AIDL_OS_SEP_H_
+
+#if defined(_WIN32)
+#define OS_PATH_SEPARATOR '\\'
+#else
+#define OS_PATH_SEPARATOR '/'
+#endif
+
+#endif
diff --git a/tools/aidl/search_path.cpp b/tools/aidl/search_path.cpp
index ffb6cb2932e4..029e216b0abd 100644
--- a/tools/aidl/search_path.cpp
+++ b/tools/aidl/search_path.cpp
@@ -1,9 +1,10 @@
#include <unistd.h>
#include "search_path.h"
#include "options.h"
+#include "os.h"
#include <string.h>
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
#include <io.h>
#endif
@@ -41,7 +42,7 @@ find_import_file(const char* given)
}
f.append(expected);
-#ifdef HAVE_MS_C_RUNTIME
+#ifdef _WIN32
/* check that the file exists and is not write-only */
if (0 == _access(f.c_str(), 0) && /* mode 0=exist */
0 == _access(f.c_str(), 4) ) { /* mode 4=readable */
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
index 895f9c9eaeac..a410c53eb22b 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java
@@ -86,7 +86,7 @@ public class BridgePowerManager implements IPowerManager {
}
@Override
- public void shutdown(boolean confirm, boolean wait) {
+ public void shutdown(boolean confirm, String reason, boolean wait) {
// pass for now.
}