Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20ba0091 authored by Spandan Das's avatar Spandan Das Committed by Android (Google) Code Review
Browse files

Merge "Prefer the non package-private version of annotations library" into main

parents 517b9840 07c62390
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ package main

import (
	"bytes"
	"cmp"
	"container/list"
	"context"
	"encoding/json"
@@ -299,7 +300,18 @@ func findJavaModules(paths []string, modules map[string]*javaModule) map[string]
	for name := range modules {
		keys = append(keys, name)
	}
	slices.Sort(keys)
	slices.SortFunc(keys, func(k1, k2 string) int {
		// Some libraries use annotations by setting annotations_enabled: true.
		// To enable IDE integration for such libraries, prefer the non package-private
		// version of the annotations library.
		if k1 == "stub-annotations" && k2 == "private-stub-annotations" {
			return -1
		} else if k1 == "private-stub-annotations" && k2 == "stub-annotations" {
			return 1
		} else {
			return cmp.Compare(k1, k2)
		}
	})
	for _, name := range keys {
		if strings.HasSuffix(name, ".impl") {
			continue