Merge "Modify LOCAL_DROIDDOC_* to export the exportable artifacts" into main
This commit is contained in:
@@ -549,8 +549,8 @@ func (jd *Javadoc) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
if BoolDefault(jd.properties.Installable, true) {
|
if BoolDefault(jd.properties.Installable, true) {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", jd.docZip)
|
entries.SetPath("LOCAL_DROIDDOC_DOC_ZIP", jd.docZip)
|
||||||
}
|
}
|
||||||
if jd.stubsSrcJar != nil {
|
if jd.exportableStubsSrcJar != nil {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", jd.stubsSrcJar)
|
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", jd.exportableStubsSrcJar)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -596,17 +596,17 @@ func (dstubs *Droidstubs) AndroidMkEntries() []android.AndroidMkEntries {
|
|||||||
Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk",
|
Include: "$(BUILD_SYSTEM)/soong_droiddoc_prebuilt.mk",
|
||||||
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
||||||
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
|
||||||
if dstubs.Javadoc.stubsSrcJar != nil {
|
if dstubs.Javadoc.exportableStubsSrcJar != nil {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", dstubs.Javadoc.stubsSrcJar)
|
entries.SetPath("LOCAL_DROIDDOC_STUBS_SRCJAR", dstubs.Javadoc.exportableStubsSrcJar)
|
||||||
}
|
}
|
||||||
if dstubs.everythingArtifacts.apiVersionsXml != nil {
|
if dstubs.everythingArtifacts.apiVersionsXml != nil {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.everythingArtifacts.apiVersionsXml)
|
entries.SetPath("LOCAL_DROIDDOC_API_VERSIONS_XML", dstubs.exportableArtifacts.apiVersionsXml)
|
||||||
}
|
}
|
||||||
if dstubs.everythingArtifacts.annotationsZip != nil {
|
if dstubs.everythingArtifacts.annotationsZip != nil {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.everythingArtifacts.annotationsZip)
|
entries.SetPath("LOCAL_DROIDDOC_ANNOTATIONS_ZIP", dstubs.exportableArtifacts.annotationsZip)
|
||||||
}
|
}
|
||||||
if dstubs.everythingArtifacts.metadataZip != nil {
|
if dstubs.everythingArtifacts.metadataZip != nil {
|
||||||
entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.everythingArtifacts.metadataZip)
|
entries.SetPath("LOCAL_DROIDDOC_METADATA_ZIP", dstubs.exportableArtifacts.metadataZip)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -333,66 +333,89 @@ func (d *Droidstubs) OutputFiles(tag string) (android.Paths, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) AnnotationsZip(stubsType StubsType) (android.Path, error) {
|
func (d *Droidstubs) AnnotationsZip(stubsType StubsType) (ret android.Path, err error) {
|
||||||
switch stubsType {
|
switch stubsType {
|
||||||
case Everything:
|
case Everything:
|
||||||
return d.everythingArtifacts.annotationsZip, nil
|
ret, err = d.everythingArtifacts.annotationsZip, nil
|
||||||
case Exportable:
|
case Exportable:
|
||||||
return d.exportableArtifacts.annotationsZip, nil
|
ret, err = d.exportableArtifacts.annotationsZip, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("annotations zip not supported for the stub type %s", stubsType.String())
|
ret, err = nil, fmt.Errorf("annotations zip not supported for the stub type %s", stubsType.String())
|
||||||
}
|
}
|
||||||
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) ApiFilePath(stubsType StubsType) (android.Path, error) {
|
func (d *Droidstubs) ApiFilePath(stubsType StubsType) (ret android.Path, err error) {
|
||||||
switch stubsType {
|
switch stubsType {
|
||||||
case Everything:
|
case Everything:
|
||||||
return d.apiFile, nil
|
ret, err = d.apiFile, nil
|
||||||
case Exportable:
|
case Exportable:
|
||||||
return d.exportableApiFile, nil
|
ret, err = d.exportableApiFile, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("api file path not supported for the stub type %s", stubsType.String())
|
ret, err = nil, fmt.Errorf("api file path not supported for the stub type %s", stubsType.String())
|
||||||
}
|
}
|
||||||
|
if ret == nil && err == nil {
|
||||||
|
err = fmt.Errorf("stubs srcjar is null for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) ApiVersionsXmlFilePath(stubsType StubsType) (android.Path, error) {
|
func (d *Droidstubs) ApiVersionsXmlFilePath(stubsType StubsType) (ret android.Path, err error) {
|
||||||
switch stubsType {
|
switch stubsType {
|
||||||
case Everything:
|
case Everything:
|
||||||
return d.everythingArtifacts.apiVersionsXml, nil
|
ret, err = d.everythingArtifacts.apiVersionsXml, nil
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("api versions xml file path not supported for the stub type %s", stubsType.String())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *Droidstubs) DocZip(stubsType StubsType) (android.Path, error) {
|
|
||||||
switch stubsType {
|
|
||||||
case Everything:
|
|
||||||
return d.docZip, nil
|
|
||||||
default:
|
|
||||||
return nil, fmt.Errorf("docs zip not supported for the stub type %s", stubsType.String())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d *Droidstubs) RemovedApiFilePath(stubsType StubsType) (android.Path, error) {
|
|
||||||
switch stubsType {
|
|
||||||
case Everything:
|
|
||||||
return d.removedApiFile, nil
|
|
||||||
case Exportable:
|
case Exportable:
|
||||||
return d.exportableRemovedApiFile, nil
|
ret, err = d.exportableArtifacts.apiVersionsXml, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("removed api file path not supported for the stub type %s", stubsType.String())
|
ret, err = nil, fmt.Errorf("api versions xml file path not supported for the stub type %s", stubsType.String())
|
||||||
}
|
}
|
||||||
|
if ret == nil && err == nil {
|
||||||
|
err = fmt.Errorf("api versions xml file is null for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) StubsSrcJar(stubsType StubsType) (android.Path, error) {
|
func (d *Droidstubs) DocZip(stubsType StubsType) (ret android.Path, err error) {
|
||||||
switch stubsType {
|
switch stubsType {
|
||||||
case Everything:
|
case Everything:
|
||||||
return d.stubsSrcJar, nil
|
ret, err = d.docZip, nil
|
||||||
case Exportable:
|
|
||||||
return d.exportableStubsSrcJar, nil
|
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("stubs srcjar not supported for the stub type %s", stubsType.String())
|
ret, err = nil, fmt.Errorf("docs zip not supported for the stub type %s", stubsType.String())
|
||||||
}
|
}
|
||||||
|
if ret == nil && err == nil {
|
||||||
|
err = fmt.Errorf("docs zip is null for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *Droidstubs) RemovedApiFilePath(stubsType StubsType) (ret android.Path, err error) {
|
||||||
|
switch stubsType {
|
||||||
|
case Everything:
|
||||||
|
ret, err = d.removedApiFile, nil
|
||||||
|
case Exportable:
|
||||||
|
ret, err = d.exportableRemovedApiFile, nil
|
||||||
|
default:
|
||||||
|
ret, err = nil, fmt.Errorf("removed api file path not supported for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
if ret == nil && err == nil {
|
||||||
|
err = fmt.Errorf("removed api file is null for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d *Droidstubs) StubsSrcJar(stubsType StubsType) (ret android.Path, err error) {
|
||||||
|
switch stubsType {
|
||||||
|
case Everything:
|
||||||
|
ret, err = d.stubsSrcJar, nil
|
||||||
|
case Exportable:
|
||||||
|
ret, err = d.exportableStubsSrcJar, nil
|
||||||
|
default:
|
||||||
|
ret, err = nil, fmt.Errorf("stubs srcjar not supported for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
if ret == nil && err == nil {
|
||||||
|
err = fmt.Errorf("stubs srcjar is null for the stub type %s", stubsType.String())
|
||||||
|
}
|
||||||
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *Droidstubs) CurrentApiTimestamp() android.Path {
|
func (d *Droidstubs) CurrentApiTimestamp() android.Path {
|
||||||
@@ -982,8 +1005,11 @@ func (d *Droidstubs) exportableStubCmd(ctx android.ModuleContext, params stubsCo
|
|||||||
stubConfig: params,
|
stubConfig: params,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if params.generateStubs {
|
||||||
d.Javadoc.exportableStubsSrcJar = android.PathForModuleOut(ctx, params.stubsType.String(), ctx.ModuleName()+"-"+"stubs.srcjar")
|
d.Javadoc.exportableStubsSrcJar = android.PathForModuleOut(ctx, params.stubsType.String(), ctx.ModuleName()+"-"+"stubs.srcjar")
|
||||||
optionalCmdParams.stubsSrcJar = d.Javadoc.exportableStubsSrcJar
|
optionalCmdParams.stubsSrcJar = d.Javadoc.exportableStubsSrcJar
|
||||||
|
}
|
||||||
|
|
||||||
if params.writeSdkValues {
|
if params.writeSdkValues {
|
||||||
d.exportableArtifacts.metadataZip = android.PathForModuleOut(ctx, params.stubsType.String(), ctx.ModuleName()+"-metadata.zip")
|
d.exportableArtifacts.metadataZip = android.PathForModuleOut(ctx, params.stubsType.String(), ctx.ModuleName()+"-metadata.zip")
|
||||||
d.exportableArtifacts.metadataDir = android.PathForModuleOut(ctx, params.stubsType.String(), "metadata")
|
d.exportableArtifacts.metadataDir = android.PathForModuleOut(ctx, params.stubsType.String(), "metadata")
|
||||||
|
Reference in New Issue
Block a user