B4J Question SLC and dependent JARS ?

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I created a library according to https://www.b4x.com/android/forum/t...uild-libraries-without-eclipse.29918/#content

The source is in \src
the dependent JARS are in \libs

When I compile using SLC everything works out fine, BUT: the resulting JAR (that is put in my libraries folder) only contains the compiled classes in \src. It does not contain any code of the referring jars in the libs folder.

This results in ClassDefNotFounds in runtime.

PS: I also added the @BA.DependsOn(values={...}) to no avail.

Many thanks
 

wl

Well-Known Member
Licensed User
Longtime User
thanks, but what do you mean ? I would like to create a single JAR library I can distribute...

thanks!
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
hanks, but what do you mean ? I would like to create a single JAR library I can distribute...
This is how it works. SLC does not add any additional jars in.
You can add the jars sources and add them to the SRC folder. You can can define a ignore-entry in the b4aignore line in SLC
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi,

So for a single JAR I could use IntelliJ or similar and then use SLC for the XML file ?

Is that the way most external libraries are currently being created ?

Thanks
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Is that the way most external libraries are currently being created ?
In the early days I used Eclipse to both compile the libraries and generate the XML using the B4Adoclet plugin. Now that my library set is mature I occasionally use Notepad++ and SLC to update them although I did do the CodeEditorView in BasicIDE from scratch this latter way - though I did miss the the Intellisence that Eclipse provides.
 
  • Like
Reactions: wl
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi Andrew,

I don't really understand: if SLC never includes the depending JARS in the generated JAR file, and you are using it for updates on your own libraries. How do you make sure the JAR of you latest library version includes the depending JARS/classes ?

Thanks!
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
This is how it works. SLC does not add any additional jars in.
You can add the jars sources and add them to the SRC folder. You can can define a ignore-entry in the b4aignore line in SLC

Ok the "add the jars sources" ...as I have dependencies on quite some libraries I'm not sure I will be able to have the sources of all of these...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Ok the "add the jars sources" ...as I have dependencies on quite some libraries I'm not sure I will be able to have the sources of all of these...
then you need to add a reference to the jars/aars. #additionaljar or depends_on in the wrapper.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
How do you make sure the JAR of you latest library version includes the depending JARS/classes ?
It doesn't. Any dependant jars are included in a posted library archive together with the compiled library jar and xml files. All those files should be copied together to the additional libraries folder and #AdditionalJar: entries for them made in the application code.
 
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Just a quick update:

I used IntelliJ to create a JAR file with all my compiled code + the needed classes from imported libraries (jars)
Then I used the SLC for the XML description file of the library

Now I have a single JAR file for my library containing all code needed (no extra JAR's needed).

FYI: I create a simple SMTP server wrapper based on https://github.com/voodoodyne/subethasmtp
 
Upvote 0
Top