Java Question SLC - generating library documentation

moster67

Expert
Licensed User
Longtime User
I note that when I include a description of my java-wrapper, the description never gets included in the generated xml-file.

I had a look at some of the libs which Anywheresoftware has published on Github and it seems like I am inserting the description just as Erel does in his libraries. I normally insert the description just before the @ShortName annotation and then I insert the static method LIBRARY_DOC after the Class declaration. Here is an example:

B4X:
@BA.Version(0.25f)
@BA.Author("Github: tastelessjolt, Wrapped by: moster67/Mikael Osterhed")
@BA.DependsOn(values = {"B4AYouTubeDLSupport","kotlin-stdlib-1.3.0","named-regexp-0.2.5","okhttp-3.5.0","okio-1.11.0"})
@BA.Permissions(values = { "android.permission.INTERNET"})
@BA.Events(values = {"OnResult(VideoInfo as Object, StreamInfo as Object)","OnError"})

/**
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 * You need to initialize the library, then you pass on the shortened YouTube link (in Google's
 * Share format such as https://youtu.be/IfHG7bj-CE3) to the ExtractLink-method.
 * You will then need to monitor the two available events: OnError and OnResult.
 * OnError will trigger if something goes wrong. The OnResult-event will trigger if everything worked fine
 * and returns two Map-objects. THe first object, VideoInfo, contains general information about the
 * video while the second object, StreamInfo, contains direct-links of the video. The StreamInfo
 * contains different formats of the links and another Map-object which holds the url and other
 * information indicating quality, with or without video/audio etc for each format. Normally the
 * first (0) item in the Map is the best one (quality-wise) but being a Map, the order cannot be guaranteed.
 * You can use the "itag" information to also get the best url. The lowest value of "itag" should be the best one.
 */
@BA.ShortName("B4AYouTubeDL")

public class B4aYouTubeDL {

    public static void LIBRARY_DOC() {}

    private BA ba;
//......
}

I noted that Erel does not seem to include the static method LIBRARY_DOC and I also tried without it but still no luck.

I am using SLC version 1.06 and the Doclet version seems to 1.07 as follows:
B4X:
<doclet-version-NOT-library-version>1.07</doclet-version-NOT-library-version>

I fix this by hand so it is not a big deal but I am curious if it is only me having this problem....

All other method-descriptions are correctly generated and shown.

I attach a wrapper and its generated xml file for reference.

Thanks.
 

Attachments

  • B4aYouTubeDL.java
    7 KB · Views: 224
  • B4AYouTubeDL.xml
    1.8 KB · Views: 295

moster67

Expert
Licensed User
Longtime User
Try to move the @BA.ShortName line above the comment. Do you now see the comment?
No, it doesn't get included in the xml-file. I already tried that previously.

I tried various things such as:
-to move my SLC directory to C but still no luck.
-changed Android platform from 28 to 26 (bootclasspath)
-to run SLC from command-line
-to remove items in the b4aignore field
but no luck.

B4X:
Starting step: Compiling Java code.
Completed successfully.
Starting step: Creating jar file.
Completed successfully.
Starting step: Creating XML file.
Loading source file C:\SimpleLibraryCompiler\B4AYouTubeDL\src\main\java\com\tillekesoft\youtubedl\B4aYouTubeDL.java...
Constructing Javadoc information...
[-doclet, BADoclet]
[-docletpath, C:\SimpleLibraryCompiler]
[-doclet, BADoclet]
[-docletpath, C:\SimpleLibraryCompiler]
[-bootclasspath, C:\AndroidSDKB4A\platforms\android-28\android.jar]
[-classpath, C:\Anywhere Software\Basic4android\B4A.exe\../libraries\B4AShared.jar;C:\Anywhere Software\Basic4android\B4A.exe\../libraries\Core.jar;C:\SimpleLibraryCompiler\B4AYouTubeDL\libs\B4AYouTubeDLSupport.jar;C:\SimpleLibraryCompiler\B4AYouTubeDL\libs\kotlin-stdlib-1.3.0.jar;C:\SimpleLibraryCompiler\B4AYouTubeDL\libs\named-regexp-0.2.5.jar;]
[-sourcepath, src]
[-b4atarget, C:\Anywhere Software\Basic4android\AdditionalLIBS\B4aYouTubeDL.xml]
starting....
Working with class: com.tillekesoft.youtubedl.B4aYouTubeDL
finish: C:\Anywhere Software\Basic4android\AdditionalLIBS\B4aYouTubeDL.xml

Completed successfully.
*** Don't forget to refresh the libraries list in the IDE (right click and choose Refresh) ***
 

moster67

Expert
Licensed User
Longtime User
I also updated Java JDK and Runtime environment:
B4X:
Microsoft Windows [Version 10.0.17134.472]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\moste>javac -version
javac 1.8.0_191

C:\Users\moste>java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

C:\Users\moste>

but no luck.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've just tested it with this source code:
B4X:
package anywheresoftware.b4a.objects;

import android.app.Activity;
import android.view.MotionEvent;
import anywheresoftware.b4a.BA;
/**
*slkdfjlksdfjlksdf
*sd;l fks;ld fkls;d fl;sdf l;sdf
*/
@BA.ShortName("test")
public class ActivityEx  {

   
}

The result is:

B4X:
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <doclet-version-NOT-library-version>1.05</doclet-version-NOT-library-version>
    <class>
        <name>anywheresoftware.b4a.objects.ActivityEx</name>
        <shortname>test</shortname>
        <comment>slkdfjlksdfjlksdf
sd;l fks;ld fkls;d fl;sdf l;sdf</comment>
        <owner>process</owner>
    </class>
</root>
 

moster67

Expert
Licensed User
Longtime User
OK, now I found the error:

The description must be inserted above the annotations like this:
B4X:
package com.tilekesoft.youtubedl;

import android.content.Context;
import android.os.AsyncTask;

import java.util.List;
import java.util.regex.Pattern;

import anywheresoftware.b4a.BA;
import me.harshithgoka.youtubedl.YoutubeDL.Extractor;
import me.harshithgoka.youtubedl.YoutubeDL.Format;
import me.harshithgoka.youtubedl.YoutubeDL.VideoInfo;


/**
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 * can be used to download or stream a video.
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 * This is a wrap of an Android version of YouTube-DL which will extract a direct link which
 * can be used to download or stream a video.
 */
@BA.ShortName("B4AYouTubeDL")
@BA.Version(0.25f)
@BA.Author("Github: tastelessjolt, Wrapped by: moster67/Mikael Osterhed")
@BA.DependsOn(values = {"B4AYouTubeDLSupport","kotlin-stdlib-1.3.0","named-regexp-0.2.5","okhttp-3.5.0","okio-1.11.0"})
@BA.Permissions(values = { "android.permission.INTERNET"})
@BA.Events(values = {"OnResult(VideoInfo as Object, StreamInfo as Object)","OnError"})

public class B4aYouTubeDL {
}

If one puts any of the annotations, even only one, above the description, the class-comment will be empty in the generated xml.

Well, now I know what I did wrong....
 
Top