In the previous commit 46ddf071b ("gradle: add Android jar to
smack-android-extensions compile classpath") we already added the
Android jar using compileClasspath to smack-android-extensions. Now
use the same configuration for smack-android, since compileOnly is
deprecated.
gradles compile command (which is deprecated and should be replaced with implementation) includes the arguments resources into the result jar.
That means that smack-android will contain resources found at the android boot classpath.
This results in a +~11mb increase in size of the resulting apk when including Smack as a composite build. The increase comes from 11mb of Android resources, mainly drawables.
compileOnly (formerly provided) on the other hand will assert that the android.jar classes are provided by the system, which is probably what we want in this case.
This is needed for javadocAll since otherwhise there will be
smack-core/src/main/java/org/jivesoftware/smack/package-info.java:21:
warning: a package-info.java file has already been seen for
package org.jivesoftware.smack
warnings.
which is the probably the better choice here anyway. And it also
prevents the following failure on POM creation:
$ gradle uploadArchives
> Task :smack-android:uploadArchives FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':smack-android:uploadArchives'.
> Could not publish configuration 'archives'
> Could not write to file
'/home/flo/data/code/smack/smack-android/build/poms/pom-default.xml'.
See also
https://discuss.gradle.org/t/gradle-fails-to-create-pom-with-the-configuration-to-scope-mapping-is-not-unique/32087
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.
Fixes SMACK-591.
Also introduce JUnit 5 and non-strict javadoc projects.
This commit also changes the usage of the android.jar found in the
androidBootClasspath gradle variable, because
AndroidSmackInitializer.initialize(Context) pulls in
org.minidns.dnsserverlookup.android21.AndroidUsingLinkProperties
from minidns-android21, which has a @TargetApi annotation which is
only available on Android SDK API level 16 or higher. Otherwhise we
would get
> Task :smack-android:compileJava FAILED
/home/flo/.gradle/caches/modules-2/files-2.1/org.minidns/minidns-android21/0.3.0/13f273d095e51d701283062a25e867f3ff26d258/minidns-android21-0.3.0.jar(/org/minidns/dnsserverlookup/android21/AndroidUsingLinkProperties.class): warning: Cannot find annotation method 'value()' in type 'TargetApi': class file for android.annotation.TargetApi not found
/home/flo/.gradle/caches/modules-2/files-2.1/org.minidns/minidns-android21/0.3.0/13f273d095e51d701283062a25e867f3ff26d258/minidns-android21-0.3.0.jar(/org/minidns/dnsserverlookup/android21/AndroidUsingLinkProperties.class): warning: Cannot find annotation method 'value()' in type 'TargetApi'
error: warnings found and -Werror specified
1 error
when compiling smack-android.
- Lines containing tab(s) after space
- Usage of printStackTrace
- Usage of println
- Add SupressionCommentFilter module
SuppressionCommentFilter can be enabled with
// CHECKSTYLE:OFF
and disabled with
// CHECKSTYLE:ON
smack-bosh was recently added to androidProjects, but it was not
filtered out from the dependencies for smack-android. Since it is an
optional dependency, it should not be a dependency of smack-android.
on package layer instead of Declarative Service (DS) approach.
Restructuring and cleanup of initialization process to ensure that all
internal config files are found by the corresponding bundle
classloaders.
SMACK-343
there was a lot of duplicate code in ConsoleDebugger and
AndroidDebugger, which resides now in AbstractDebugger. Those two and
the new JulDebugger subclass AbstractDebugger.
This commit marks an important milestone with the addition of the
smack-android subproject. Smack is now able to run native on Android
without requiring any modifications, which makes the aSmack build
environment obsolete.
It was necessary to redesign the code for SASL authentication to achieve
this. Smack now comes with smack-sasl-provided for SASL implementations
that do not rely on additional APIs like javax for platforms where those
APIs are not available like Android.