Build Smack Library source to .jar files

I’m very new to android developing. previously, i followed the step specified in the documentation to get smack to my project (adding some “compile” directive in the “dependencies” tag of build.gradle file). But now, I made some minor change to smack, and want to test it. After some researching, I find that I could build Smack library from source to .jar file, and import it in my project.

In my current project, I use
dependencies {
compile ‘org.igniterealtime.smack:smack-tcp:4.2.0’

}

So I cloned the source code of smack from github, and checkout to tag 4.2.0, and then copied it to another folder and made my changes.

then, in the root folder of the smack copy, i run gradle assemble. (my gradle version is 4.4.1). after i run the command, i got this prompt:

Please enter your signing de…
GnuPG Private Key Password:

But I don’t know what to put in it.

Has anyone succeeded in building the library from source? could you show me a detailed guide on how to do it? Thank you very much!

You most definelty want to use gradle’s composite build feature in such situations.

Hi Flow

Thank you for you answer. I have done some research yesterday, and find the document of gradle composite a bit difficult to understand (maybe because i have not worked with multi build before)

Could you kindly show me a more detailed step on how to do it?

Here is the structure of my current project

├── AndroidManifest.xml
├── build.gradle
├── google-services.json
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradle.properties~
├── gradlew
├── gradlew.bat
├── local.properties
├── local.properties~
├── multidex-config.pro
├── res
│ ├── drawable-hdpi
│ ├── drawable-ldpi
│ ├── drawable-mdpi
│ ├── drawable-xhdpi
│ ├── drawable-xxhdpi
│ ├── drawable-xxxhdpi
│ └── values
│ └── libs.xml
└── src
└── com…
├── MainActivity.java

Take a look at this project for an example.
Note that the settings.xml contains a reference to the Smack source tree.

Thats mostly it.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.