summaryrefslogtreecommitdiff
path: root/android/sdk.go
diff options
context:
space:
mode:
author Paul Duffin <paulduffin@google.com> 2019-12-03 10:07:10 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-12-03 10:07:10 +0000
commite63106a08c328b5f23fa8dcdd73ab8e6d16486da (patch)
treef6d7e53c08997362a482581fe4e2f6a38e930873 /android/sdk.go
parentf6739a65dd1ceeb050249070e9407890f713e30c (diff)
parentb645ec8e34e2e94d7f5b93aae63edac42271bf2c (diff)
Merge "Add model to represent generated snapshot .bp file"
Diffstat (limited to 'android/sdk.go')
-rw-r--r--android/sdk.go47
1 files changed, 35 insertions, 12 deletions
diff --git a/android/sdk.go b/android/sdk.go
index 73cb2565f..01e18ed4b 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -167,16 +167,39 @@ type SnapshotBuilder interface {
// Unzip the supplied zip into the snapshot relative directory destDir.
UnzipToSnapshot(zipPath Path, destDir string)
- // Get the AndroidBpFile for the snapshot.
- AndroidBpFile() GeneratedSnapshotFile
-
- // Get a versioned name appropriate for the SDK snapshot version being taken.
- VersionedSdkMemberName(unversionedName string) interface{}
-}
-
-// Provides support for generating a file, e.g. the Android.bp file.
-type GeneratedSnapshotFile interface {
- Printfln(format string, args ...interface{})
- Indent()
- Dedent()
+ // Add a new prebuilt module to the snapshot. The returned module
+ // must be populated with the module type specific properties. The following
+ // properties will be automatically populated.
+ //
+ // * name
+ // * sdk_member_name
+ // * prefer
+ //
+ // This will result in two Soong modules being generated in the Android. One
+ // that is versioned, coupled to the snapshot version and marked as
+ // prefer=true. And one that is not versioned, not marked as prefer=true and
+ // will only be used if the equivalently named non-prebuilt module is not
+ // present.
+ AddPrebuiltModule(name string, moduleType string) BpModule
+}
+
+// A set of properties for use in a .bp file.
+type BpPropertySet interface {
+ // Add a property, the value can be one of the following types:
+ // * string
+ // * array of the above
+ // * bool
+ // * BpPropertySet
+ //
+ // It is an error is multiples properties with the same name are added.
+ AddProperty(name string, value interface{})
+
+ // Add a property set with the specified name and return so that additional
+ // properties can be added.
+ AddPropertySet(name string) BpPropertySet
+}
+
+// A .bp module definition.
+type BpModule interface {
+ BpPropertySet
}