[Git][java-team/grpc-java][bazel-build-test] Convert to Bazel build

Olek Wojnar gitlab at salsa.debian.org
Tue Dec 15 16:40:56 GMT 2020



Olek Wojnar pushed to branch bazel-build-test at Debian Java Maintainers / grpc-java


Commits:
fda9c718 by Olek Wojnar at 2020-12-15T11:40:34-05:00
Convert to Bazel build

- - - - -


5 changed files:

- debian/changelog
- debian/control
- + debian/gitlab-ci.yml
- debian/patches/series
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -4,6 +4,7 @@ grpc-java (1.25.0+ds-1) unstable; urgency=high
     - Refresh fix-gradle-build.patch
     - Refresh remove-android-annotations.patch
   * Update standards to 4.5.1 (no changes)
+  * Build using Bazel due to Gradle build limitations
 
  -- Olek Wojnar <olek at debian.org>  Mon, 14 Dec 2020 15:30:20 -0500
 


=====================================
debian/control
=====================================
@@ -4,12 +4,10 @@ Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Olek Wojnar <olek at debian.org>,
            Andreas Tille <tille at debian.org>,
-Build-Depends: debhelper-compat (= 13),
+Build-Depends: bazel-bootstrap,
+               debhelper-compat (= 13),
                default-jdk,
                gem2deb,
-               gradle-apt-plugin,
-               gradle-debian-helper,
-               gradle-plugin-protobuf,
                javahelper,
                jdupes,
                libanimal-sniffer-java,


=====================================
debian/gitlab-ci.yml
=====================================
@@ -0,0 +1,10 @@
+include:
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+ - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
+
+reprotest:
+  allow_failure: true
+
+variables:
+  SALSA_CI_DISABLE_VERSION_BUMP: 1
+  SALSA_CI_DISABLE_BUILD_PACKAGE_I386: 1


=====================================
debian/patches/series
=====================================
@@ -1,4 +1,3 @@
 python3.patch
-fix-gradle-build.patch
 build-plugin.patch
 remove-android-annotations.patch


=====================================
debian/rules
=====================================
@@ -5,33 +5,53 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 
-export ORG_GRADLE_PROJECT_skipAndroid=true
-export ORG_GRADLE_PROJECT_errorProne=false
+#export ORG_GRADLE_PROJECT_skipAndroid=true
+#export ORG_GRADLE_PROJECT_errorProne=false
 export DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
 export DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
 export DEB_TARGET_GNU_CPU ?= $(shell dpkg-architecture -qDEB_TARGET_GNU_CPU)
 export DEB_TARGET_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_TARGET_GNU_SYSTEM)
 
-export ORG_GRADLE_PROJECT_protoc="/usr/bin/protoc"
+#export ORG_GRADLE_PROJECT_protoc="/usr/bin/protoc"
+
+# BAZEL_CXXOPTS and BAZEL_LINKOPTS take a list of flags seperated by colons
+export space = $() $()
+export BAZEL_CXXOPTS = $(subst $(space),:,-std=c++0x ${CPPFLAGS} ${CXXFLAGS})
+export BAZEL_LINKOPTS = $(subst $(space),:,-lstdc++ -lm ${LDFLAGS})
+
+export DEFAULT_BAZEL_ARGS = \
+    --spawn_strategy=standalone \
+    --nojava_header_compilation \
+    --strategy=Javac=worker --worker_quit_after_build --ignore_unsupported_sandboxing \
+    --java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \
+    --host_java_toolchain=//src/java_tools/buildjar:bootstrap_toolchain \
+    --action_env=PATH \
+    --host_platform=@local_config_platform//:host \
+    --platforms=@local_config_platform//:host
+
+export EXTRA_BAZEL_ARGS = \
+    --host_javabase=@local_jdk//:jdk \
+    --define=distribution=debian \
+    --noremote_accept_cached \
+    --verbose_failures \
+    --compilation_mode dbg \
+    --sandbox_debug \
+    --sandbox_writable_path=${HOME}/.ccache/tmp \
+    --distinct_host_configuration=false
 
 # Ensure packages build with no Internet access
 export http_proxy=127.0.0.1:9
 export https_proxy=127.0.0.1:9
 
 %:
-	dh $@ --buildsystem=gradle --with maven_repo_helper
+	dh $@ --with maven_repo_helper
 
 override_dh_auto_configure:
-	dh_auto_configure --buildsystem=autoconf
-	dh_auto_configure
 
 override_dh_auto_build:
-	dh_auto_build --buildsystem=autoconf
-	dh_auto_build
+	bazel build ${DEFAULT_BAZEL_ARGS} ${EXTRA_BAZEL_ARGS} //:java_grpc_library__external_repo_test
 
-override_dh_auto_install:
-	dh_auto_install --buildsystem=autoconf
-	dh_auto_install
+#override_dh_auto_install:
 
 override_dh_installexamples:
 	dh_installexamples



View it on GitLab: https://salsa.debian.org/java-team/grpc-java/-/commit/fda9c71842acec233db419bb0b3fcc7a168a8b1c

-- 
View it on GitLab: https://salsa.debian.org/java-team/grpc-java/-/commit/fda9c71842acec233db419bb0b3fcc7a168a8b1c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20201215/de4d9989/attachment.html>


More information about the pkg-java-commits mailing list