Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build docs #724

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 52 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
}

// TODO NOW test shadow jar works in groups - remove JNA - commit 2
var buildDocsDir = "$buildDir/docs/otherdoc/"

// TODO NOW test shadow jar works in groups - need test controller - commit 2
// TODO NOW get docserver working in WAR and test in docker-compose <- edit to start test server - commit 3
// TODO NOW client jar - commit 4
// TODO NOW client jar javadoc - needs java_common source - commit 4
Expand All @@ -32,6 +34,54 @@ compileJava {
options.release = 11
}

javadoc {
Xiangs18 marked this conversation as resolved.
Show resolved Hide resolved
/* We don't actually need the full javadoc for anything, so just hijack this task for
* building the client javadocs. If we ever need the full javadocs make a new task for the
* client java docs
*/
/* TODO DOCS currently java-common and auth links don't work. ROI for fixing them is low.
* Ideally, in the future make github actions publish docs on release and ref them
* here.
* https://github.com/marketplace/actions/deploy-publish-javadoc
* https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry
*/
/* TODO DOCS the current sdk documenation looks like invalid html to javadoc
* need to go through and remove
* also some spots with < / > that need to be wrapped with {@code } in internal code
*/
failOnError = false
options {
links "https://docs.oracle.com/en/java/javase/11/docs/api/"
links "https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.9.9/"
links "https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.9.9/"
Xiangs18 marked this conversation as resolved.
Show resolved Hide resolved
}
include "**/workspace/*.java"
exclude "**/workspace/WorkspaceServer.java"
include "**/common/service/Tuple*.java"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ialarmedalien I know you laboriously copied over all the options from ant in your PR, but frankly I have no idea why they were there in the first place or if they're needed. The docs without them look fine to me so in the interests of simplicity I left them out. If we find we need them in the future it's easy enough to put them back in

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you didn't just reuse the code that I'd already written, esp since I laboriously tested it to ensure that it generated the same stuff. Also IMO it would have made more sense to start by building the jars, then the wars, then the docs, rather than going at things the other way around.

Copy link
Member Author

@MrCreosote MrCreosote Apr 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need the docs for the war and the shadow jar, which is why I'm doing them first

}

task buildDocs {
// ideally we'd add the inputs and outputs spec but that's too much work for too little gain
dependsOn javadoc
doLast {
// need to make sure we remove any docs that no longer exist in the source
delete "$buildDocsDir"
copy {
from "$rootDir/workspace.spec" into "$buildDocsDir"
}
copy {
from "$rootDir/docshtml/" into "$buildDocsDir" include "*"
}
exec {
commandLine "pod2html", "--infile=$rootDir/lib/Bio/KBase/workspace/Client.pm", "--outfile=$buildDocsDir/workspace_perl.html"
}
exec {
commandLine "sphinx-build", "$rootDir/docsource/", "$buildDocsDir"
}
delete fileTree(".").matching { include "pod2htm*.tmp" }
}
}

tasks.withType(Test) {
/*
* TODO TEST Figure out why tests fail without this and remove. Might have something to do
Expand Down Expand Up @@ -114,14 +164,6 @@ sourceSets {
}
}

javadoc {
options {
links "https://docs.oracle.com/en/java/javase/11/docs/api/"
links "https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.9.9/"
links "https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/2.9.9/"
}
}

war {
webXml = file('war/web.xml')
}
Expand Down Expand Up @@ -189,7 +231,7 @@ dependencies {
'kbase-common-0.2.0'
)
// Pull from jars repo vs a maven repository to avoid the JNA dependency
// Need to rework the java common logger to not use syslog4j at all since it's abandonware
// TODO DEPS Need to rework the java common logger to not use syslog4j at all since it's abandonware
// and has a ton of CVEs, even in the newer versions.
implementation fromURL(
'https://github.com/kbase/jars/raw/master/lib/jars/syslog4j/syslog4j-0.9.46.jar',
Expand Down
2 changes: 1 addition & 1 deletion docshtml/Workspace.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Bio/KBase/workspace/Client.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10783,7 +10783,7 @@ compatibility.
UnspecifiedObject data - The object's data.
object_metadata metadata - Metadata for object retrieved/

@deprecated Workspaces.ObjectData
@deprecated Workspace.ObjectData


=item Definition
Expand Down
2 changes: 1 addition & 1 deletion lib/biokbase/workspace/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def get_object(self, params, context=None):
the "get_object" function. Provided for backwards compatibility.
UnspecifiedObject data - The object's data. object_metadata
metadata - Metadata for object retrieved/ @deprecated
Workspaces.ObjectData) -> structure: parameter "data" of
Workspace.ObjectData) -> structure: parameter "data" of
unspecified object, parameter "metadata" of type "object_metadata"
(Meta data associated with an object stored in a workspace.
Provided for backwards compatibility. obj_name id - name of the
Expand Down
2 changes: 1 addition & 1 deletion src/us/kbase/workspace/GetObjectOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* compatibility.
* UnspecifiedObject data - The object's data.
* object_metadata metadata - Metadata for object retrieved/
* @deprecated Workspaces.ObjectData
* @deprecated Workspace.ObjectData
* </pre>
*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/us/kbase/workspace/WorkspaceServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class WorkspaceServer extends JsonServerServlet {
private static final long serialVersionUID = 1L;
private static final String version = "0.0.1";
private static final String gitUrl = "https://github.com/mrcreosote/workspace_deluxe";
private static final String gitCommitHash = "5154d57474407fb8e21e5bcd238c6db20666fca8";
private static final String gitCommitHash = "8d0c78b928ca21c63ad05b0ee7dbe608065d44d1";

//BEGIN_CLASS_HEADER
//TODO JAVADOC really low priority, sorry
Expand Down
2 changes: 1 addition & 1 deletion workspace.spec
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ module Workspace {
UnspecifiedObject data - The object's data.
object_metadata metadata - Metadata for object retrieved/

@deprecated Workspaces.ObjectData
@deprecated Workspace.ObjectData
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, it's only the spec... not a proper code file!

*/
typedef structure {
UnspecifiedObject data;
Expand Down
Loading