Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_frameworks_base-old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Farzin Kazemzadeh
platform_frameworks_base-old
Commits
4671ab97
Commit
4671ab97
authored
1 year ago
by
Spandan Das
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Enforce bcp/sscp stubs do not compile against apps" into main
parents
48165939
67b7906e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/api.go
+38
-0
38 additions, 0 deletions
api/api.go
with
38 additions
and
0 deletions
api/api.go
+
38
−
0
View file @
4671ab97
...
...
@@ -79,7 +79,45 @@ func registerBuildComponents(ctx android.RegistrationContext) {
var
PrepareForCombinedApisTest
=
android
.
FixtureRegisterWithContext
(
registerBuildComponents
)
func
(
a
*
CombinedApis
)
apiFingerprintStubDeps
()
[]
string
{
ret
:=
[]
string
{}
ret
=
append
(
ret
,
transformArray
(
a
.
properties
.
Bootclasspath
,
""
,
".stubs"
)
...
,
)
ret
=
append
(
ret
,
transformArray
(
a
.
properties
.
Bootclasspath
,
""
,
".stubs.system"
)
...
,
)
ret
=
append
(
ret
,
transformArray
(
a
.
properties
.
Bootclasspath
,
""
,
".stubs.module_lib"
)
...
,
)
ret
=
append
(
ret
,
transformArray
(
a
.
properties
.
System_server_classpath
,
""
,
".stubs.system_server"
)
...
,
)
return
ret
}
func
(
a
*
CombinedApis
)
DepsMutator
(
ctx
android
.
BottomUpMutatorContext
)
{
ctx
.
AddDependency
(
ctx
.
Module
(),
nil
,
a
.
apiFingerprintStubDeps
()
...
)
}
func
(
a
*
CombinedApis
)
GenerateAndroidBuildActions
(
ctx
android
.
ModuleContext
)
{
ctx
.
WalkDeps
(
func
(
child
,
parent
android
.
Module
)
bool
{
if
_
,
ok
:=
child
.
(
java
.
AndroidLibraryDependency
);
ok
&&
child
.
Name
()
!=
"framework-res"
{
// Stubs of BCP and SSCP libraries should not have any dependencies on apps
// This check ensures that we do not run into circular dependencies when UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
ctx
.
ModuleErrorf
(
"Module %s is not a valid dependency of the stub library %s
\n
."
+
"If this dependency has been added via `libs` of java_sdk_library, please move it to `impl_only_libs`
\n
"
,
child
.
Name
(),
parent
.
Name
())
return
false
// error detected
}
return
true
})
}
type
genruleProps
struct
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment