1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-14 16:22:07 +01:00
Smack/resources
Florian Schmaus 1e5d34eacf Bump to Gradle 8.10.2, require Java 11
Bump Gradle from 6.8.3 to 8.10.2 and increase the minimum required
Java version from 8 to 11 (SMACK-953).

The switch from Java 8 to 11 caused some Bytecode portability issues
regarding NIO Buffers. Java changed with version 9 the return type of
some subclasses of Buffer to return the specific Buffer type instead
of the Buffer superclass [JDK-4774077]. For example, ByteBuffer.filp()
previously returned Buffer, while it does return ByteBuffer now.

This sensible change was not reflected by the Android API [1], which
means that AnimalSniffer rightfully started to complain that there is
no method "ByteBuffer ByteBuffer.flip()" in Android, there is only
"Buffer ByteBuffer.flip()", and those are incompatible methods on
Java's Bytecode layer.

As workaround, this changes

    return charBuffer.flip().toString();

to

    ((java.nio.Buffer) charBuffer).flip();
    return charBuffer.toString();

to restore the Bytecode portability between Android and Java.

Errorprone also got new checks, of which JavaUtilDate and JdkObsolete
are wroth mentioning.

JavaUtilData basically strongly recommends to use Java's newer time
API over java.util.Date. But since Smack was Java 8 until now,
j.u.Date is widely used.

Similar JdkObsolete mentions obsolete JDK APIs, like data structures
like Vector and Stack. But mostly LinkedList, which should usually be
replaced by ArrayList. And this is what this commit largely does.

JDK-4774077: https://bugs.openjdk.org/browse/JDK-4774077
1: https://issuetracker.google.com/issues/369219141
2024-09-25 12:08:50 +02:00
..
eclipse SmackReactor/NIO, Java8/Android19, Pretty print XML, FSM connections 2019-02-05 13:18:03 +01:00
intellij [doc] Initial IDE config guide 2021-06-16 17:48:59 +01:00
logo Add smack-logo-plain-minimized.svg using scour 2017-09-29 17:18:42 +02:00
old-documentation-images Migrate markdown documentation to javadoc 2023-02-03 09:50:35 +01:00
sample Remove legacy CVS keywords 2017-01-05 12:03:36 -06:00
fix-a-javadoc.sh Fixes spelling (includes one API change) 2024-09-11 20:03:43 +02:00
generate-notice-file [resources] Rename get-contributors.sh to generate-notice-file 2021-11-01 17:53:01 +01:00
getCopyright.sh Fixes spelling (includes one API change) 2024-09-11 20:03:43 +02:00
gradle.properties.example Change keyringfile example to real file 2014-04-17 13:47:19 +02:00
javadoc-overview.html Migrate markdown documentation to javadoc 2023-02-03 09:50:35 +01:00
README.html Replace references to 'smack.jar' 2014-07-05 12:10:43 +02:00
sample.providers Normalize newlines to '\n' 2014-02-17 23:58:40 +01:00
smacklint.sh Introduce CloseableUtil 2018-08-15 17:25:22 +02:00

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Smack Source Distribution</title>
    <style type="text/css">
        BODY {
            font-size : 100%;
        }
        BODY, TD, TH {
            font-family : tahoma, verdana, arial, helvetica, sans-serif;
            font-size : 0.8em;
        }
        A:hover {
            text-decoration : none;
        }
        TT {
            font-family : courier new, monospace;
            font-weight : bold;
            color : #060;
        }
        PRE, CODE {
            font-family : courier new, monospace;
            font-size : 100%;
        }
    </style>
</head>

<body>

<font size=4>
Smack Source Distribution<br>
</font><br>
<p>

This document provides detailed information for developers that wish to 
compile and make changes to the Smack source code.

<p>For additional developer resources, please visit: 
<a href="http://www.igniterealtime.org/projects/smack">
http://www.igniterealtime.org/projects/smack</a>. The Smack build process is based on Gradle. Visit the
<a href="http://www.gradle.org">Gradle website</a>
for more information and downloads.
<p>
This documentation is divided into two sections:
<ol>
	<li> <a href="#setup">Setup</a> -- how to setup your environment for Smack development.
	<li> <a href="#tasks">Build tasks</a> -- tasks that can be performed using the build program.
</ol>

<p><a name="setup"><b><font color="#0066cc">1.</font> Setup Your Environment</b></a><p>

Getting your machine ready for Smack development requires a few steps. Wherever
possible, instructions are provided for both Unix/Linux and Windows users.
<p>
<b><a name="javaSetup">Configure Java</a></b>
<ul>
	A Java Development Kit (JDK) must be installed and setup on your machine. To test the installation,
	open a shell in a Unix or a MS-DOS prompt in Windows. Check your version of
	Java with "javac -version".
	If Java isn't installed, download a copy from the 
	<a href="http://java.oracle.com/">Java website</a>.
</ul>

<b><a name="antSetup">Configure Gradle</a></b>
<ul>
Download Gradle from the <a href="http://www.gradle.org">Gradle website</a>. Follow
the setup instructions for your operating system.
</ul>

<p><b><a name="checkout">Test the Build Script</a></b><p>
<ul>

<p>
Now, invoke the build tool to compile the Smack source code

<p>
</font><code>gradle build</code><font face="verdana, arial, helvetica" size=2>
<p>

If the build tool is invoked correctly and Smack compiles, you've correctly
configured your copy of the Smack developer distribution.
</font>
</ul>

<p><b>Finished!</b><p>
<ul>
If you've gotten this far, you've finished setting up the Smack developer
distribution. Now, read below to learn about all of the tasks that you can perform
with the build tool.
</ul>

<br><br>
	
<p><b><a name="tasks"><font color="#0066cc">2.</font> Gradle Tasks</a></b><p>

	The list of build tasks is below.

	<br><br>

	For a list of the commands and a brief description from the command line, type
	<code>gradle tasks</code>. For more complete help, read the documentation below.

	<br><br>

	To execute a build task, type <code>gradle [options] targetname</code> where "targetname" is
	one of the targets listed below:
	
	<ul>
        <li><a href="#build">build</a>
        <li><a href="#javadoc">javadocAll</a>
        <li><a href="#clean">clean</a>
        <li><a href="#eclipse">eclipse</a>
		<li><a href="#projects">projects</a>
	</ul>
<p>
Each task is documented with a syntax guide and description. Optional paramaters 
for each task are enclosed with braces.
	
<p><b><a name="build">build</a></b>
<ul>
<i>Syntax:</i><p>

<code>
gradle build <br>
</code>

<p><i>Description:</i></p>

Compiles all the Smack source code and run the test suite. The
artifacts of the sub-projects can be found
at <code>&lt;subprojectDir&gt;/build/libs</code>

<p>[<a href="#tasks">return to task list</a>]
</ul>

<p><b><a name="javadoc">javadocAll</a></b>
<ul>
<i>Syntax:</i><p>

<code>
gradle javadocAll<br>
</code>

<p><i>Description:</i></p>

JavaDocs all Smack source code and saves it under <code>build/javadoc</code>.

<p>[<a href="#tasks">return to task list</a>]
</ul>

<p><b><a name="clean">clean</a></b>
<ul>
<i>Syntax:</i><p>

<code>
gradle clean<br>
</code>

<p><i>Description:</i></p>

Cleans your Smack distribution directory by deleting compiled class
files and artifacts.

<p>[<a href="#tasks">return to task list</a>]
</ul>

<p><b><a name="eclipse">eclipse</a></b>
<ul>
<i>Syntax:</i><p>

<code>
gradle eclipse<br>
</code>

<p><i>Description:</i></p>

Generates Eclipse configuration files for every project. After
running <code>gradle build eclipse</code> you can import Smack in
Eclipse by selecting <code>File</code> &rarr; <code>Import...</code>
&rarr; <code>Existing Projects into Workspace</code>
<br>
Make sure to check "<code>Search for nested projects</code>". It may be
also a good idea to create a working set for Smack, and add all Smack
projects to that working set.
<br>
Note that it's recommended to also call the <code>build</code> target
when generating the Eclipse files, or else Eclipse may not find all
requirements.

<p>[<a href="#tasks">return to task list</a>]
</ul>

<p><b><a name="projects">projects</a></b>
<ul>
<i>Syntax:</i><p>

<code>
gradle projects<br>
</code>

<p><i>Description:</i></p>

Show all Smack projects and  their description.

<p>[<a href="#tasks">return to task list</a>]
</ul>


</body>
</html>