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

Commit 0d1c4a0f authored by Sam Delmerico's avatar Sam Delmerico
Browse files

disable usage of plugins as static libs

Test: m auto_value_plugin
Test: m androidx.appsearch_appsearch-compiler
Test: m intdef-annotation-processor-test
Test: atest intdef-annotation-processor-test
Test: m view-inspector-annotation-processor-test
Test: atest view-inspector-annotation-processor-test
Test: m Robolectric_processor_tests
Test: atest Robolectric_processor_tests
Bug: 225388628
Change-Id: I9e3dd81f44333b680f2e81283c02a9be5a4de15b
parent 5e745599
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1908,6 +1908,9 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
			case bootClasspathTag:
				deps.bootClasspath = append(deps.bootClasspath, dep.HeaderJars...)
			case libTag, instrumentationForTag:
				if _, ok := module.(*Plugin); ok {
					ctx.ModuleErrorf("a java_plugin (%s) cannot be used as a libs dependency", otherName)
				}
				deps.classpath = append(deps.classpath, dep.HeaderJars...)
				deps.dexClasspath = append(deps.dexClasspath, dep.HeaderJars...)
				deps.aidlIncludeDirs = append(deps.aidlIncludeDirs, dep.AidlIncludeDirs...)
@@ -1916,6 +1919,9 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps {
			case java9LibTag:
				deps.java9Classpath = append(deps.java9Classpath, dep.HeaderJars...)
			case staticLibTag:
				if _, ok := module.(*Plugin); ok {
					ctx.ModuleErrorf("a java_plugin (%s) cannot be used as a static_libs dependency", otherName)
				}
				deps.classpath = append(deps.classpath, dep.HeaderJars...)
				deps.staticJars = append(deps.staticJars, dep.ImplementationJars...)
				deps.staticHeaderJars = append(deps.staticHeaderJars, dep.HeaderJars...)