|
15 | 15 |
|
16 | 16 | import com.google.common.collect.ImmutableList; |
17 | 17 | import com.google.devtools.build.docgen.annot.DocCategory; |
| 18 | +import com.google.devtools.build.docgen.annot.StarlarkConstructor; |
18 | 19 | import com.google.devtools.build.lib.starlarkbuildapi.FileApi; |
19 | 20 | import com.google.devtools.build.lib.starlarkbuildapi.core.ProviderApi; |
20 | 21 | import com.google.devtools.build.lib.starlarkbuildapi.core.StructApi; |
21 | 22 | import javax.annotation.Nullable; |
22 | 23 | import net.starlark.java.annot.Param; |
| 24 | +import net.starlark.java.annot.ParamType; |
23 | 25 | import net.starlark.java.annot.StarlarkBuiltin; |
24 | 26 | import net.starlark.java.annot.StarlarkMethod; |
25 | | -import net.starlark.java.eval.Dict; |
26 | 27 | import net.starlark.java.eval.EvalException; |
| 28 | +import net.starlark.java.eval.NoneType; |
| 29 | +import net.starlark.java.eval.Sequence; |
27 | 30 |
|
28 | 31 | /** A provider for targets that produce an apk file. */ |
29 | 32 | @StarlarkBuiltin( |
@@ -120,15 +123,73 @@ public interface ApkInfoApi<FileT extends FileApi> extends StructApi { |
120 | 123 | "Do not use this module. It is intended for migration purposes only. If you depend on " |
121 | 124 | + "it, you will be broken when it is removed.", |
122 | 125 | documented = false) |
123 | | - interface ApkInfoApiProvider extends ProviderApi { |
| 126 | + interface ApkInfoApiProvider<FileT extends FileApi> extends ProviderApi { |
124 | 127 |
|
125 | 128 | @StarlarkMethod( |
126 | 129 | name = "ApkInfo", |
127 | | - // This is left undocumented as it throws a "not-implemented in Starlark" error when |
128 | | - // invoked. |
| 130 | + doc = "The <code>ApkInfo<code> constructor.", |
129 | 131 | documented = false, |
130 | | - extraKeywords = @Param(name = "kwargs"), |
| 132 | + parameters = { |
| 133 | + @Param( |
| 134 | + name = "signed_apk", |
| 135 | + doc = "The signed APK file.", |
| 136 | + allowedTypes = { |
| 137 | + @ParamType(type = FileApi.class), |
| 138 | + }, |
| 139 | + named = true), |
| 140 | + @Param( |
| 141 | + name = "unsigned_apk", |
| 142 | + doc = "The unsigned APK file.", |
| 143 | + allowedTypes = { |
| 144 | + @ParamType(type = FileApi.class), |
| 145 | + }, |
| 146 | + named = true), |
| 147 | + @Param( |
| 148 | + name = "deploy_jar", |
| 149 | + doc = "The deploy jar file.", |
| 150 | + allowedTypes = { |
| 151 | + @ParamType(type = FileApi.class), |
| 152 | + }, |
| 153 | + named = true), |
| 154 | + @Param( |
| 155 | + name = "coverage_metadata", |
| 156 | + doc = "The coverage metadata file generated in the transitive closure.", |
| 157 | + allowedTypes = {@ParamType(type = FileApi.class), @ParamType(type = NoneType.class)}, |
| 158 | + named = true), |
| 159 | + @Param( |
| 160 | + name = "merged_manifest", |
| 161 | + doc = "The merged manifest file.", |
| 162 | + allowedTypes = { |
| 163 | + @ParamType(type = FileApi.class), |
| 164 | + }, |
| 165 | + named = true), |
| 166 | + @Param( |
| 167 | + name = "signing_keys", |
| 168 | + doc = "The list of signing keys used to sign the APK.", |
| 169 | + allowedTypes = {@ParamType(type = Sequence.class, generic1 = FileApi.class)}, |
| 170 | + named = true), |
| 171 | + @Param( |
| 172 | + name = "signing_lineage", |
| 173 | + doc = "The signing lineage file. If present, that was used to sign the APK", |
| 174 | + allowedTypes = {@ParamType(type = FileApi.class), @ParamType(type = NoneType.class)}, |
| 175 | + named = true), |
| 176 | + @Param( |
| 177 | + name = "signing_min_v3_rotation_api_version", |
| 178 | + doc = "The minimum API version for signing the APK with key rotation.", |
| 179 | + allowedTypes = {@ParamType(type = String.class), @ParamType(type = NoneType.class)}, |
| 180 | + named = true), |
| 181 | + }, |
131 | 182 | selfCall = true) |
132 | | - ApkInfoApi<?> createInfo(Dict<String, Object> kwargs) throws EvalException; |
| 183 | + @StarlarkConstructor |
| 184 | + ApkInfoApi<FileT> createInfo( |
| 185 | + FileT signedApk, |
| 186 | + FileT unsignedApk, |
| 187 | + FileT deployJar, |
| 188 | + Object coverageMetadata, |
| 189 | + FileT mergedManifest, |
| 190 | + Sequence<?> signingKeys, // <Artifact> expected |
| 191 | + Object signingLineage, |
| 192 | + Object signingMinV3RotationApiVersion) |
| 193 | + throws EvalException; |
133 | 194 | } |
134 | 195 | } |
0 commit comments