blob: 5fbe01ebef35a8d85ee354e32cb329497de16e40 [file] [log] [blame]
Inseob Kimb554e592019-04-15 20:10:46 +09001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package selinux
16
17import (
18 "github.com/google/blueprint"
19
20 "android/soong/android"
21)
22
23type dependencyTag struct {
24 blueprint.BaseDependencyTag
25 name string
26}
27
28var (
29 pctx = android.NewPackageContext("android/soong/selinux")
30)
Inseob Kim6c6f53b2023-04-26 11:03:35 +090031
32// pathForModuleOut is same as android.PathForModuleOut, except that it uses DeviceName() as its
33// intermediate directory name for system_ext/product/vendor/odm modules, to avoid rebuilding upon
34// target change. Contents of system modules (core sepolicy) should be identical across devices, so
35// they falls back to android.PathForModuleOut.
36func pathForModuleOut(ctx android.ModuleContext, paths ...string) android.OutputPath {
37 if ctx.Platform() && !ctx.InstallInRecovery() {
38 return android.PathForModuleOut(ctx, paths...).OutputPath
39 }
40
41 return android.PathForModuleOut(ctx, ctx.Config().DeviceName()).Join(ctx, paths...)
42}