-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for bazel to run with shrunken r8.jar
With Android Platform SDK build tools 30.0.1 the r8.jar included is shrunken (r8lib), so some of the internal APIs are not available. Change the integration to deal with that. This uses reflection to access the internal APIs if available and otherwise stick to the public API. If a shrunked r8.jar is used, bazel will not support the configuration of "check main dex" and "minimal main dex" flags which are not supported in the public D8 API. This will also make it possible for bazel to pull r8.jar from Google Maven, where only the shrunken r8.jar is published. RELNOTES: None. PiperOrigin-RevId: 326619633
- Loading branch information
1 parent
8d656cf
commit 6b591a7
Showing
4 changed files
with
121 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/tools/android/java/com/google/devtools/build/android/r8/CompatDxCompilationError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2020 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.android.r8; | ||
|
||
/** Compilation error in CompatDx */ | ||
public class CompatDxCompilationError extends RuntimeException { | ||
|
||
public CompatDxCompilationError() {} | ||
|
||
public CompatDxCompilationError(String message) { | ||
super(message); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/tools/android/java/com/google/devtools/build/android/r8/CompatDxUnimplemented.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2020 The Bazel Authors. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
package com.google.devtools.build.android.r8; | ||
|
||
/** Unimplemented in CompatDx */ | ||
public class CompatDxUnimplemented extends RuntimeException { | ||
|
||
public CompatDxUnimplemented() {} | ||
|
||
public CompatDxUnimplemented(String message) { | ||
super(message); | ||
} | ||
} |