From e62c2af9193da7d59eeca6cbf2e90d9985582a36 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 7 Sep 2026 14:24:38 +0100 Subject: [PATCH] Exclude the loopback HTTP server test from the animalsniffer check ParseUrlRedirectTest (added in #113) starts a com.sun.net.httpserver server on loopback to pin redirect following. That package is not in the Android API signature animalsniffer checks against, so animalsnifferTest reports 19 undefined references and ./gradlew check fails. The signature describes what the published artifact may use. Test code never ships and never runs on Android, so exclude just this file rather than weaken the signature for main. Excluding the whole test source set would also work - the animalsniffer block already carries a commented-out "sourceSets = [sourceSets.main]" for that - but this keeps the rest of the tests covered. Co-Authored-By: Claude Opus 5 (1M context) --- build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle b/build.gradle index f0ed7e68e..ad3af066c 100644 --- a/build.gradle +++ b/build.gradle @@ -789,3 +789,10 @@ animalsniffer { ignore 'javax.xml.namespace.*' } +// The Android API signature only makes sense for code we ship. ParseUrlRedirectTest +// runs a loopback com.sun.net.httpserver server, which is JDK-only and never leaves +// the test source set. +animalsnifferTest { + exclude '**/ParseUrlRedirectTest*' +} +