| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 1 | // 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 |  | 
|  | 15 | package sdk | 
|  | 16 |  | 
|  | 17 | import "android/soong/android" | 
|  | 18 |  | 
|  | 19 | func init() { | 
| Paul Duffin | 6d9108f0 | 2021-03-09 22:59:28 +0000 | [diff] [blame] | 20 | registerModuleExportsBuildComponents(android.InitRegistrationContext) | 
|  | 21 | } | 
|  | 22 |  | 
|  | 23 | func registerModuleExportsBuildComponents(ctx android.RegistrationContext) { | 
|  | 24 | ctx.RegisterModuleType("module_exports", ModuleExportsFactory) | 
|  | 25 | ctx.RegisterModuleType("module_exports_snapshot", ModuleExportsSnapshotsFactory) | 
| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 26 | } | 
|  | 27 |  | 
|  | 28 | // module_exports defines the exports of a mainline module. The exports are Soong modules | 
|  | 29 | // which are required by Soong modules that are not part of the mainline module. | 
|  | 30 | func ModuleExportsFactory() android.Module { | 
| Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 31 | return newSdkModule(true) | 
| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 32 | } | 
|  | 33 |  | 
| Paul Duffin | b01ac4b | 2022-05-24 20:10:05 +0000 | [diff] [blame] | 34 | // module_exports_snapshot is a snapshot of prebuilt versions of all the exports | 
| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 35 | // of a mainline module. | 
|  | 36 | func ModuleExportsSnapshotsFactory() android.Module { | 
| Paul Duffin | e602918 | 2019-12-16 17:43:48 +0000 | [diff] [blame] | 37 | s := newSdkModule(true) | 
| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 38 | s.properties.Snapshot = true | 
| Paul Duffin | 8150da6 | 2019-12-16 17:21:27 +0000 | [diff] [blame] | 39 | return s | 
|  | 40 | } |