Commit graph

121 commits

Author SHA1 Message Date
Paul Duffin
f45775edbe Merge "Add sdk_version:"none" to replace no_standard_libs:true" am: b11c72b0b8
am: e34bbae1ca

Change-Id: I9465a810dad7f3ea95b6c883844358d817f8cc8e
2019-06-14 01:32:45 -07:00
Paul Duffin
52d398a841 Add sdk_version:"none" to replace no_standard_libs:true
Where possible this duplicates any tests that use no_standard_libs:true
with ones that use sdk_version:"none". If not possible (e.g. in the
default targets included in java/testing.go) it switches some to use
sdk_version:"none" to ensure that there is no regression in the
behavior of no_standard_libs:true.

Follow up changes will switch all usages of no_standard_libs:true over
to use sdk_version:"none" at which point no_standard_libs will be
removed.

Bug: 134566750
Test: m droid
Change-Id: I5f0fd3daa980f6b223abe454cba7f25a97a39d7a
2019-06-13 19:15:10 +01:00
Paul Duffin
065000e3f5 Merge "Never allow java_library_host with no_standard_libs: true" am: 393590d8a8
am: 3321670746

Change-Id: Iebd7f4cd4979860ea1b2f9433373546c114d2160
2019-06-13 00:17:11 -07:00
Paul Duffin
b815ada8c0 Never allow java_library_host with no_standard_libs: true
This combination makes no sense.

Bug: 134566750
Test: m droid
Change-Id: Ib37bbac165395c003d23225e0469ba60fa6a56ea
2019-06-12 14:08:13 +01:00
Paul Duffin
a4973e8fec Add tests for core library neverallow rules am: b6c6bdd1c2
am: 28630e0c47

Change-Id: If9ac14fe90a21e80d8c7748cb505f53c3983d3c5
2019-06-12 03:11:54 -07:00
Paul Duffin
b6c6bdd1c2 Add tests for core library neverallow rules
Bug: 134566750
Test: m
Change-Id: I65e2afdf726937c29fc4f62a317024dc133254bf
2019-06-12 10:50:24 +01:00
Paul Duffin
25f35fa650 Remove unnecessary core library neverallow rules
The rules that restricted access to core library targets are no longer
required as they have been replaced with visibility rules. The
visibility rules are safer because they check all dependencies whereas
the neverallow rules that have been removed only checked dependencies
in the libs property and so missed dependencies in static_libs and
java_libs properties.

Bug: 112158820
Test: m core-tests
Change-Id: Ibfef74db0769992266ebadf445836d2a183df3f7
Merged-In: Ibfef74db0769992266ebadf445836d2a183df3f7
(cherry picked from commit 8e8c01c382)
2019-05-01 20:31:24 +00:00
Paul Duffin
ff5a177879 Remove unnecessary core library neverallow rules
The rules that restricted access to core library targets are no longer
required as they have been replaced with visibility rules. The
visibility rules are safer because they check all dependencies whereas
the neverallow rules that have been removed only checked dependencies
in the libs property and so missed dependencies in static_libs and
java_libs properties.

(cherry picked from 8e8c01c382)

Bug: 112158820
Test: m core-tests
Change-Id: I3b50b705b7cd6fcdc55d26cd71b9149b3abd2b88
Merged-In: Ibfef74db0769992266ebadf445836d2a183df3f7
2019-05-01 09:39:32 +01:00
Colin Cross
97add50354 Allow guava to use java_host_for_device
Guava can't compile against a device bootclasspath, it uses methods
that only exist in the host bootclasspath, and then avoids calling
them at runtime.

Bug: 130306229
Test: m checkbuild
Change-Id: I012030cb701c01ea9ff554c1b6156d0242365a4c
Merged-In: I012030cb701c01ea9ff554c1b6156d0242365a4c
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit b5191a573d)
2019-04-15 21:44:51 -07:00
Colin Cross
b5191a573d Allow guava to use java_host_for_device
Guava can't compile against a device bootclasspath, it uses methods
that only exist in the host bootclasspath, and then avoids calling
them at runtime.

Bug: 130306229
Test: m checkbuild
Change-Id: I012030cb701c01ea9ff554c1b6156d0242365a4c
2019-04-11 16:42:34 -07:00
Colin Cross
c35c5f9824 Add neverallow rules for java_device_for_host
java_device_for_host and java_host_for_device should rarely be
used and could cause problems if used incorrectly, so restrict them
to only the necessary projects through a neverallow whitelist.

Bug: 117920228
Test: neverallow_test.go
Change-Id: I37dce489c2fb8bca71bd46dbabaaa514bf6f7eee
Merged-In: I37dce489c2fb8bca71bd46dbabaaa514bf6f7eee
2019-03-07 15:23:21 +00:00
Colin Cross
fd4f743bf4 Add neverallow rules for java_device_for_host
java_device_for_host and java_host_for_device should rarely be
used and could cause problems if used incorrectly, so restrict them
to only the necessary projects through a neverallow whitelist.

Bug: 117920228
Test: neverallow_test.go
Change-Id: I37dce489c2fb8bca71bd46dbabaaa514bf6f7eee
2019-03-06 12:29:36 -08:00
Dongwon Kang
50a299f7c7 Disallow linking against updatable-media.
Test: make
Bug: 123253805
Change-Id: I93a86bd8210cf72dbcaa8f7dde96c72acd660934
2019-02-04 09:00:51 -08:00
Neil Fuller
9b0d1f47fa Remove references to core-simple
core-simple was a demonstration jar and is being removed.

Bug: 119301609
Test: build
Change-Id: Ieb5e12ce0ce96f597da92660ea83dbf0e1860edb
2019-01-14 16:01:01 +00:00
Neil Fuller
df5f356c86 Add soong build restrictions for libcore targets
Add soong build restrictions for libcore targets to stop
other targets depending on internals.

Test: cd build/soong/; ./build_test.bash --products aosp_arm
Bug: 113148576
Change-Id: I2c15924fbecaf0c2076d08de65814a6dcb790e73
2018-10-25 18:10:57 +01:00
Neil Fuller
fe385b001c Expand projects allowed to use no_standard_libs
There are a set of git projects that are part of or
closely related to "core libraries" and will need to
be allowed to compile against core library implementations
(and not stubs) after we've switched the default to use
stubs.

Bug: 113148576
Test: build
Change-Id: Id10b7dd83b173bdbfdb07b404d0e5f1ff621e543
2018-10-11 16:03:39 +01:00
Neil Fuller
1fee9f3dd0 Include all core libs in default boot classpath
To migrate the default compilation over to using
"core platform api" stubs we need to make the "before"
state as close to the "after" state as possible.

The stubs will include all "core libraries" so it
makes sense to include those that contribute to the
"core platform api": okhttp, bouncycastle and conscrypt.

(apache-xml is not included because it doesn't contribute
to the core platform API).

After this change all explicit dependencies to okhttp,
bouncycastle and conscrypt in situations where the
default boot classpath is used can be removed.

A knock-on of this change is that the conscrypt, bouncycastle
and okhttp targets need to be adjusted to explicitly
depend on core-oj / core-libart with no_standard_libs: true
to avoid a cycle.

Bug: 113148576
Test: treehugger
Change-Id: I1677af8d9d48fd026874ebce4c864f39ec1a5a3d
2018-10-10 08:42:12 +00:00
Neil Fuller
cf157ccb16 Allow conscrypt to depend on core.intra.stubs
conscrypt is built against an API surface we define
in libcore as core.intra.stubs. Therefore we need
an exception to the libcore dependency rules.

Bug: 113148576
Bug: 110404540
Test: make conscrypt
Change-Id: If36e05b2d8339741393752bd864bdb5d6c0f503e
2018-09-26 16:19:46 +01:00
Logan Chien
af29bada75 Allow VNDK extensions under vendor or device
This commit allows VNDK extensions (vndk.enabled:true and vendor:true)
to reside under vendor/* or device/*.  VNDK extensions will be installed
into /vendor/lib[64]/vndk[-sp].  It is reasonable for their source being
under vendor/* or device/*.

Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
2018-03-15 11:02:38 +08:00
Nan Zhang
b2b33de3c0 Fetch generated srcs from java libs for droiddoc.
api-stubs, system-api-stubs and etc need generated sources and srcjars from "framework",
so add a property that tell module to fetch srcs and srcjars from its
dependency libraries. The libraries in that property has to be in the
module's classpath.

Also add doc_defaults targets.

Bug: b/70351683
Test: m -j
Change-Id: I05831fbcad488037710950e4f05dc8fb2a12f403
2018-03-09 10:53:42 -08:00
Steven Moreland
65b3fd900a neverallows in Soong
Straightforward way of expressing policy inspired by a similar
syntax in SELinux.

Bug: 70165717
Test: no neverallows hit
Test: manually checking neverallow rules by changing them/adding violations
Change-Id: I7e15a0094d1861391bfe21a2ea30797d7593c142
2017-12-19 15:26:08 -08:00