#!/usr/bin/make -f

B = $(CURDIR)/debian/.dh-scala

%:
	dh $@ --buildsystem=scala

# Upstream's build generates os/GeneratedTupleConversions.scala.
execute_before_dh_auto_build:
	sh debian/gen-tuple-conversions debian/generated

# Upstream's tests, compiled here and not as scala-build stanzas, which
# would need utest under the nocheck profile too.
execute_after_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	sh debian/tests/run-upstream-tests 2.13 \
		$(B)/os-lib_2.13/classes:$(B)/os-zip/classes $(B)/tests
	sh debian/tests/run-upstream-tests 3 \
		$(B)/os-lib_3/classes:$(B)/os-zip/classes $(B)/tests
endif

execute_after_dh_auto_clean:
	rm -rf debian/generated
