2021-07-07 05:42:39 +02:00
|
|
|
// Copyright 2021 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
|
|
|
|
//
|
2022-08-16 19:27:33 +02:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2021-07-07 05:42:39 +02:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
package snapshot
|
|
|
|
|
|
|
|
import (
|
|
|
|
"android/soong/android"
|
|
|
|
)
|
|
|
|
|
2024-04-04 02:56:15 +02:00
|
|
|
var pctx = android.NewPackageContext("android/soong/snapshot")
|
2021-07-07 05:42:39 +02:00
|
|
|
|
2024-04-04 02:56:15 +02:00
|
|
|
func init() {
|
|
|
|
pctx.Import("android/soong/android")
|
2021-07-07 05:42:39 +02:00
|
|
|
}
|
2021-08-10 22:42:03 +02:00
|
|
|
|
|
|
|
// This is to be saved as .json files, which is for development/vendor_snapshot/update.py.
|
|
|
|
// These flags become Android.bp snapshot module properties.
|
|
|
|
//
|
|
|
|
// Attributes are optional and will be populated based on each module's need.
|
|
|
|
// Common attributes are defined here, languages may extend this struct to add
|
|
|
|
// additional attributes.
|
|
|
|
type SnapshotJsonFlags struct {
|
|
|
|
ModuleName string `json:",omitempty"`
|
|
|
|
RelativeInstallPath string `json:",omitempty"`
|
|
|
|
Filename string `json:",omitempty"`
|
|
|
|
ModuleStemName string `json:",omitempty"`
|
2022-03-23 22:31:39 +01:00
|
|
|
RustProcMacro bool `json:",omitempty"`
|
|
|
|
CrateName string `json:",omitempty"`
|
2021-08-10 22:42:03 +02:00
|
|
|
|
|
|
|
// dependencies
|
2022-10-04 07:42:02 +02:00
|
|
|
Required []string `json:",omitempty"`
|
|
|
|
Overrides []string `json:",omitempty"`
|
2023-04-11 11:20:07 +02:00
|
|
|
|
|
|
|
// license information
|
|
|
|
LicenseKinds []string `json:",omitempty"`
|
|
|
|
LicenseTexts []string `json:",omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (prop *SnapshotJsonFlags) InitBaseSnapshotPropsWithName(m android.Module, name string) {
|
|
|
|
prop.ModuleName = name
|
|
|
|
|
|
|
|
prop.LicenseKinds = m.EffectiveLicenseKinds()
|
|
|
|
prop.LicenseTexts = m.EffectiveLicenseFiles().Strings()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (prop *SnapshotJsonFlags) InitBaseSnapshotProps(m android.Module) {
|
|
|
|
prop.InitBaseSnapshotPropsWithName(m, m.Name())
|
2021-08-10 22:42:03 +02:00
|
|
|
}
|