OSDN Git Service

Convert more of system/extras to Android.bp
authorDan Willemsen <dwillemsen@google.com>
Sat, 23 Mar 2019 20:53:03 +0000 (13:53 -0700)
committerDan Willemsen <dwillemsen@google.com>
Thu, 28 Mar 2019 16:00:55 +0000 (16:00 +0000)
See build/soong/README.md for more information about Soong.

Bug: 122331914
Test: cd system/extras; mma
Test: treehugger
Change-Id: Ic1cf293df2c848c7476ca93c150106a4a3cd849c

16 files changed:
app-launcher/Android.bp
app-launcher/Android.mk [deleted file]
boottime_tools/bootanalyze/Android.mk [deleted file]
boottime_tools/bootanalyze/stressfs/Android.bp [new file with mode: 0644]
boottime_tools/bootanalyze/stressfs/Android.mk [deleted file]
boottime_tools/bootio/Android.bp [new file with mode: 0644]
boottime_tools/bootio/Android.mk [deleted file]
f2fs_utils/Android.bp
ioblame/Android.bp [new file with mode: 0644]
ioblame/Android.mk [deleted file]
postinst/Android.bp [new file with mode: 0644]
postinst/Android.mk [deleted file]
squashfs_utils/Android.bp
squashfs_utils/Android.mk [deleted file]
verity/Android.bp
verity/Android.mk [deleted file]

index 7585607..bf7b279 100644 (file)
@@ -24,3 +24,17 @@ cc_binary_host {
     defaults: ["computestats-defaults"],
     srcs: ["computestatsf.c"],
 }
+
+sh_binary_host {
+    name: "app-launcher",
+    src: "app-launcher",
+    required: [
+        "computestats",
+        "computestatsf",
+    ],
+    target: {
+        darwin: {
+            enabled: false,
+        },
+    },
+}
diff --git a/app-launcher/Android.mk b/app-launcher/Android.mk
deleted file mode 100644 (file)
index 5df6eb9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := app-launcher
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_SRC_FILES := app-launcher
-LOCAL_MODULE_HOST_OS := linux
-LOCAL_REQUIRED_MODULES := computestats computestatsf
-include $(BUILD_PREBUILT)
diff --git a/boottime_tools/bootanalyze/Android.mk b/boottime_tools/bootanalyze/Android.mk
deleted file mode 100644 (file)
index 5df0dd8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (C) 2017 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.
-#
-#
-
-LOCAL_PATH := $(call my-dir)
-
-# Include the sub-makefiles
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/boottime_tools/bootanalyze/stressfs/Android.bp b/boottime_tools/bootanalyze/stressfs/Android.bp
new file mode 100644 (file)
index 0000000..f342d1a
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2017 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.
+//
+//
+
+android_test {
+    name: "StressFS",
+    srcs: ["src/**/*.java"],
+
+    sdk_version: "current",
+
+    optimize: {
+        proguard_flags_files: ["proguard.flags"],
+    },
+}
diff --git a/boottime_tools/bootanalyze/stressfs/Android.mk b/boottime_tools/bootanalyze/stressfs/Android.mk
deleted file mode 100644 (file)
index 2e54e64..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2017 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.
-#
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_PACKAGE_NAME := StressFS
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_SDK_VERSION := current
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-include $(BUILD_PACKAGE)
diff --git a/boottime_tools/bootio/Android.bp b/boottime_tools/bootio/Android.bp
new file mode 100644 (file)
index 0000000..7c8ef26
--- /dev/null
@@ -0,0 +1,63 @@
+//
+// Copyright (C) 2016 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.
+//
+
+cc_defaults {
+    name: "bootio_defaults",
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+    shared_libs: [
+        "libbase",
+        "libcutils",
+        "liblog",
+        "libprotobuf-cpp-lite",
+    ],
+}
+
+// bootio library
+// -----------------------------------------------------------------------------
+
+cc_library_shared {
+    name: "libbootio",
+    defaults: ["bootio_defaults"],
+
+    include_dirs: ["system/extras/boottime_tools"],
+
+    export_include_dirs: ["."],
+    proto: {
+        canonical_path_from_root: false,
+        type: "lite",
+    },
+    srcs: [
+        "protos.proto",
+        "bootio_collector.cpp",
+    ],
+}
+
+// bootio binary
+// -----------------------------------------------------------------------------
+
+cc_binary {
+    name: "bootio",
+    defaults: ["bootio_defaults"],
+    shared_libs: ["libbootio"],
+
+    init_rc: ["bootio.rc"],
+    srcs: ["bootio.cpp"],
+}
diff --git a/boottime_tools/bootio/Android.mk b/boottime_tools/bootio/Android.mk
deleted file mode 100644 (file)
index e4db835..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Copyright (C) 2016 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-bootio_lib_src_files := \
-        protos.proto \
-        bootio_collector.cpp \
-
-bootio_src_files := \
-        bootio.cpp \
-
-bootio_shared_libs := \
-        libbase \
-        libcutils \
-        liblog \
-        libprotobuf-cpp-lite \
-
-bootio_cflags := \
-        -Wall \
-        -Werror \
-        -Wextra \
-
-define bootio_proto_include
-$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
-endef
-
-# bootio static library
-# -----------------------------------------------------------------------------
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libbootio
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-
-LOCAL_C_INCLUDES := \
-    $(LOCAL_PATH)/.. \
-    $(call bootio_proto_include) \
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-LOCAL_CFLAGS := $(bootio_cflags)
-LOCAL_SHARED_LIBRARIES := $(bootio_shared_libs)
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-LOCAL_SRC_FILES := $(bootio_lib_src_files)
-
-include $(BUILD_SHARED_LIBRARY)
-
-
-# bootio binary
-# -----------------------------------------------------------------------------
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bootio
-LOCAL_CFLAGS := $(bootio_cflags)
-LOCAL_SHARED_LIBRARIES := \
-    $(bootio_shared_libs) \
-    libbootio \
-
-LOCAL_INIT_RC := bootio.rc
-LOCAL_SRC_FILES := $(bootio_src_files)
-
-include $(BUILD_EXECUTABLE)
index f673eca..c3d3995 100644 (file)
@@ -36,10 +36,10 @@ cc_binary {
     ],
 }
 
-cc_prebuilt_binary {
+sh_binary {
     name: "mkf2fsuserimg.sh",
 
-    srcs: ["mkf2fsuserimg.sh"],
+    src: "mkf2fsuserimg.sh",
     required: ["make_f2fs", "sload_f2fs"],
     host_supported: true,
 }
diff --git a/ioblame/Android.bp b/ioblame/Android.bp
new file mode 100644 (file)
index 0000000..4b0fa71
--- /dev/null
@@ -0,0 +1,5 @@
+sh_binary_host {
+    name: "ioblame",
+    src: "ioblame.sh",
+    filename_from_src: true,
+}
diff --git a/ioblame/Android.mk b/ioblame/Android.mk
deleted file mode 100644 (file)
index 9f981b0..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_PREBUILT_EXECUTABLES := ioblame.sh
-include $(BUILD_HOST_PREBUILT)
diff --git a/postinst/Android.bp b/postinst/Android.bp
new file mode 100644 (file)
index 0000000..25e9dfe
--- /dev/null
@@ -0,0 +1,20 @@
+//
+// Copyright (C) 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.
+//
+
+sh_binary {
+    name: "postinst_example",
+    src: "postinst.sh",
+}
diff --git a/postinst/Android.mk b/postinst/Android.mk
deleted file mode 100644 (file)
index c804cfc..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Copyright (C) 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.
-#
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE:= postinst_example
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_SRC_FILES := postinst.sh
-include $(BUILD_PREBUILT)
index d09dad6..350ed88 100644 (file)
@@ -17,8 +17,17 @@ cc_library {
 
     target: {
         host: {
-            cflags: ["-Wall", "-Werror", "-D_GNU_SOURCE", "-DSQUASHFS_NO_KLOG"]
+            cflags: [
+                "-Wall",
+                "-Werror",
+                "-D_GNU_SOURCE",
+                "-DSQUASHFS_NO_KLOG",
+            ],
         },
     },
+}
 
+sh_binary_host {
+    name: "mksquashfsimage.sh",
+    src: "mksquashfsimage.sh",
 }
diff --git a/squashfs_utils/Android.mk b/squashfs_utils/Android.mk
deleted file mode 100644 (file)
index bf60cf4..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2015 The Android Open Source Project
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := mksquashfsimage.sh
-LOCAL_SRC_FILES := mksquashfsimage.sh
-LOCAL_MODULE_CLASS := EXECUTABLES
-# We don't need any additional suffix.
-LOCAL_MODULE_SUFFIX :=
-LOCAL_BUILT_MODULE_STEM := $(notdir $(LOCAL_SRC_FILES))
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_HOST_OS := linux darwin
-include $(BUILD_PREBUILT)
index f0460db..550b800 100644 (file)
@@ -130,3 +130,23 @@ cc_test {
         "libverity_tree",
     ],
 }
+
+// VeritySigner should probably just be a java_binary
+sh_binary_host {
+    name: "verity_signer",
+    src: "verity_signer",
+    required: ["VeritySigner"],
+}
+
+// BootSignature should probably just be a java_binary
+sh_binary_host {
+    name: "boot_signer",
+    src: "boot_signer",
+    required: ["BootSignature"],
+}
+
+// This should probably be a python_binary_host
+sh_binary_host {
+    name: "build_verity_metadata.py",
+    src: "build_verity_metadata.py",
+}
diff --git a/verity/Android.mk b/verity/Android.mk
deleted file mode 100644 (file)
index 4cf136a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := verity_signer
-LOCAL_MODULE := verity_signer
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_TAGS := optional
-LOCAL_REQUIRED_MODULES := VeritySigner
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := boot_signer
-LOCAL_MODULE := boot_signer
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_TAGS := optional
-LOCAL_REQUIRED_MODULES := BootSignature
-include $(BUILD_PREBUILT)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := build_verity_metadata.py
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_SRC_FILES := build_verity_metadata.py
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_PREBUILT)