Skip to content

Commit

Permalink
Delete native android_ndk_repository and its tests.
Browse files Browse the repository at this point in the history
See #23199

RELNOTES: Bazel no longer has the android_ndk_repository rule. Use https://github.com/bazelbuild/rules_android_ndk instead. See #23199
PiperOrigin-RevId: 659683534
Change-Id: Iff04cbfc7d1fcf51f20ec5655350b359c1c71d25
  • Loading branch information
ahumesky authored and copybara-github committed Aug 5, 2024
1 parent 3820bc1 commit cd8a155
Show file tree
Hide file tree
Showing 91 changed files with 19 additions and 121,549 deletions.
28 changes: 9 additions & 19 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
tasks:
centos7:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand Down Expand Up @@ -52,8 +51,7 @@ tasks:
- test
fedora39:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand All @@ -68,8 +66,7 @@ tasks:
- test
ubuntu2204:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand Down Expand Up @@ -105,8 +102,7 @@ tasks:
CC_CONFIGURE_DEBUG: 1
name: "Clang"
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand All @@ -126,8 +122,7 @@ tasks:
- test
ubuntu2004:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand Down Expand Up @@ -159,8 +154,7 @@ tasks:
macos:
shards: 20
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand Down Expand Up @@ -217,8 +211,7 @@ tasks:
macos_arm64:
shards: 5
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
- rm -rf $HOME/bazeltest
- mkdir $HOME/bazeltest
Expand Down Expand Up @@ -326,9 +319,7 @@ tasks:
platform: ubuntu2004
name: "RBE"
shell_commands:
- sed -i.bak
-e 's/^# android_sdk_repository/android_sdk_repository/'
-e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
build_flags:
- "--config=remote"
Expand Down Expand Up @@ -382,8 +373,7 @@ tasks:
- test
kythe_ubuntu2204:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/'
-e 's/^# android_ndk_repository/android_ndk_repository/' WORKSPACE.bzlmod
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' WORKSPACE.bzlmod
- rm -f WORKSPACE.bzlmod.bak
# Remove _nowkt suffix because it's only available in newer protobuf releases. See b/329055020.
# TODO(chiwang): Remove this once we have upgraded to protobuf 25+.
Expand Down
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ genrule(
cmd = "\n".join([
"cp $< $@",
# Comment out the android repos if they exist.
"sed -i.bak -e 's/^android_sdk_repository/# android_sdk_repository/' -e 's/^android_ndk_repository/# android_ndk_repository/' $@",
"sed -i.bak -e 's/^android_sdk_repository/# android_sdk_repository/' $@",
]),
)

Expand Down
12 changes: 3 additions & 9 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ bind(
actual = "@bazel_tools//tools/android:empty",
)

bind(
name = "android_ndk_for_testing",
actual = "@bazel_tools//tools/android:empty",
)

bind(
name = "databinding_annotation_processor",
actual = "@bazel_tools//tools/android:empty",
Expand All @@ -46,12 +41,11 @@ bind(
# To run the Android integration tests in //src/test/shell/bazel/android:all or
# build the Android sample app in //examples/android/java/bazel:hello_world
#
# 1. Install an Android SDK and NDK from https://developer.android.com
# 2. Set the $ANDROID_HOME and $ANDROID_NDK_HOME environment variables
# 3. Uncomment the two lines below
# 1. Install an Android SDK from https://developer.android.com
# 2. Set the $ANDROID_HOME environment variables
# 3. Uncomment the line below
#
# android_sdk_repository(name = "androidsdk")
# android_ndk_repository(name = "androidndk")

# Introduce the "kythe_release" repo for Kythe build.
local_repository(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
import com.google.devtools.build.lib.bazel.repository.downloader.UrlRewriterParseException;
import com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryFunction;
import com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryModule;
import com.google.devtools.build.lib.bazel.rules.android.AndroidNdkRepositoryFunction;
import com.google.devtools.build.lib.bazel.rules.android.AndroidNdkRepositoryRule;
import com.google.devtools.build.lib.bazel.rules.android.AndroidSdkRepositoryFunction;
import com.google.devtools.build.lib.bazel.rules.android.AndroidSdkRepositoryRule;
import com.google.devtools.build.lib.clock.Clock;
Expand Down Expand Up @@ -198,7 +196,6 @@ public static ImmutableMap<String, RepositoryFunction> repositoryRules() {
.put(LocalRepositoryRule.NAME, new LocalRepositoryFunction())
.put(NewLocalRepositoryRule.NAME, new NewLocalRepositoryFunction())
.put(AndroidSdkRepositoryRule.NAME, new AndroidSdkRepositoryFunction())
.put(AndroidNdkRepositoryRule.NAME, new AndroidNdkRepositoryFunction())
.put(LocalConfigPlatformRule.NAME, new LocalConfigPlatformFunction())
.buildOrThrow();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public class RepositoryOptions extends OptionsBase {
help =
"If false, native repo rules can be used in WORKSPACE; otherwise, Starlark repo rules "
+ "must be used instead. Native repo rules include local_repository, "
+ "new_local_repository, local_config_platform, android_sdk_repository, and "
+ "android_ndk_repository.")
+ "new_local_repository, local_config_platform, and android_sdk_repository.")
public boolean disableNativeRepoRules;

@Option(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.google.devtools.build.lib.analysis.config.RequiresOptions;
import com.google.devtools.build.lib.bazel.BazelConfiguration;
import com.google.devtools.build.lib.bazel.repository.LocalConfigPlatformRule;
import com.google.devtools.build.lib.bazel.rules.android.AndroidNdkRepositoryRule;
import com.google.devtools.build.lib.bazel.rules.android.AndroidSdkRepositoryRule;
import com.google.devtools.build.lib.bazel.rules.android.BazelAndroidBinaryRule;
import com.google.devtools.build.lib.bazel.rules.android.BazelAndroidDeviceScriptFixture;
Expand Down Expand Up @@ -457,7 +456,6 @@ public void init(ConfiguredRuleClassProvider.Builder builder) {
// TODO(ulfjack): Split this up by conceptual units.
builder.addRuleDefinition(new NewLocalRepositoryRule());
builder.addRuleDefinition(new AndroidSdkRepositoryRule());
builder.addRuleDefinition(new AndroidNdkRepositoryRule());
builder.addRuleDefinition(new LocalConfigPlatformRule());

try {
Expand Down
Loading

0 comments on commit cd8a155

Please sign in to comment.