[Git][java-team/gradle-debian-helper][master] 4 commits: Implementing support for dh_auto_test.

Andrius Merkys gitlab at salsa.debian.org
Fri Nov 8 12:58:00 GMT 2019



Andrius Merkys pushed to branch master at Debian Java Maintainers / gradle-debian-helper


Commits:
1e47fda9 by Andrius Merkys at 2019-11-06T12:39:21Z
Implementing support for dh_auto_test.

- - - - -
a7f4a809 by Andrius Merkys at 2019-11-08T06:24:11Z
Renaming private method execute_gradle_task() to _execute_gradle_task().

- - - - -
9417606c by Andrius Merkys at 2019-11-08T07:03:49Z
Running tests automatically for debhelper compat levels > 12 only to prevent unexpected FTBFSes of old packages.

- - - - -
76a281ae by Andrius Merkys at 2019-11-08T12:57:55Z
Merge branch 'dh_auto_test' into 'master'

Implementing support for dh_auto_test (Closes: #934729)

See merge request java-team/gradle-debian-helper!1
- - - - -


1 changed file:

- gradle-helper-plugin/src/main/perl/gradle.pm


Changes:

=====================================
gradle-helper-plugin/src/main/perl/gradle.pm
=====================================
@@ -6,6 +6,7 @@
 package Debian::Debhelper::Buildsystem::gradle;
 
 use strict;
+use Debian::Debhelper::Dh_Lib;
 use Dpkg::Control;
 use base 'Debian::Debhelper::Buildsystem';
 
@@ -53,20 +54,24 @@ sub new {
 sub build {
 	my $this=shift;
 
-	# Copy the init script under .gradle/init.d to work around a bug with the --init-script parameter (GRADLE-3197)
-	$this->doit_in_builddir("mkdir", "-p", ".gradle/init.d");
-	$this->doit_in_builddir("cp", "/usr/share/gradle-debian-helper/init.gradle", ".gradle/init.d/");
-	
 	if (!@_) {
 		push(@_, "jar");
 	}
 
-	# Add the hook to the classpath
-	my $hookClasspath = "/usr/share/java/gradle-helper-hook.jar:/usr/share/java/maven-repo-helper.jar";
-	$ENV{JAVA_OPTS} .= " -Xbootclasspath/a:$hookClasspath";
-	$ENV{JAVA_OPTS} .= " -Dorg.gradle.jvmargs=-Xbootclasspath/a:$hookClasspath";
-	
-	$this->doit_in_builddir(@{$this->{gradle_cmd}}, @_);
+	$this->_execute_gradle_task(@_);
+}
+
+sub test {
+	my $this=shift;
+
+	# Running tests automatically for debhelper compat levels > 12 only to prevent unexpected FTBFSes of old packages
+	return if compat(12, 1);
+
+	if (!@_) {
+		push(@_, "test");
+	}
+
+	$this->_execute_gradle_task(@_);
 }
 
 sub clean {
@@ -77,4 +82,21 @@ sub clean {
 	$this->doit_in_builddir("rm", "-Rf", "$this->{cwd}/.gradle", "$this->{cwd}/buildSrc/.gradle", ".m2");
 }
 
+# Private methods
+
+sub _execute_gradle_task {
+	my $this=shift;
+
+	# Copy the init script under .gradle/init.d to work around a bug with the --init-script parameter (GRADLE-3197)
+	$this->doit_in_builddir("mkdir", "-p", ".gradle/init.d");
+	$this->doit_in_builddir("cp", "/usr/share/gradle-debian-helper/init.gradle", ".gradle/init.d/");
+
+	# Add the hook to the classpath
+	my $hookClasspath = "/usr/share/java/gradle-helper-hook.jar:/usr/share/java/maven-repo-helper.jar";
+	$ENV{JAVA_OPTS} .= " -Xbootclasspath/a:$hookClasspath";
+	$ENV{JAVA_OPTS} .= " -Dorg.gradle.jvmargs=-Xbootclasspath/a:$hookClasspath";
+
+	$this->doit_in_builddir(@{$this->{gradle_cmd}}, @_);
+}
+
 1



View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/compare/6922ce279b2ec9d348609db9bac9ffee620dca53...76a281aee95efbc7f9d559941d67f5b7eec31bed

-- 
View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/compare/6922ce279b2ec9d348609db9bac9ffee620dca53...76a281aee95efbc7f9d559941d67f5b7eec31bed
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/20191108/8def192b/attachment.html>


More information about the pkg-java-commits mailing list