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

Avoid extra copying of r docs #4811

Merged
merged 2 commits into from
Nov 10, 2023
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
29 changes: 14 additions & 15 deletions R/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def buildRClient = Docker.registerDockerTask(project, 'rClient') {
include 'rdeephaven/NAMESPACE'
include 'rdeephaven/README.md'
include 'rdeephaven/inst/**'
include 'rdeephaven/man/**'
include 'rdeephaven/etc/**'
include 'rdeephaven/R/**'
include 'rdeephaven/src/*.cpp'
Expand All @@ -54,14 +53,13 @@ def buildRClient = Docker.registerDockerTask(project, 'rClient') {
/out \\
${prefix}/log \\
${prefix}/bin/rdeephaven \\
${prefix}/src/rdeephaven/{inst,man,etc,src,R,bin}
${prefix}/src/rdeephaven/{inst,etc,src,R,bin}
""")
copyFile('rdeephaven/DESCRIPTION', "${prefix}/src/rdeephaven/")
copyFile('rdeephaven/LICENSE', "${prefix}/src/rdeephaven/")
copyFile('rdeephaven/NAMESPACE', "${prefix}/src/rdeephaven/")
copyFile('rdeephaven/README.md', "${prefix}/src/rdeephaven/")
copyFile('rdeephaven/inst/', "${prefix}/src/rdeephaven/inst/")
copyFile('rdeephaven/man/', "${prefix}/src/rdeephaven/man/")
copyFile('rdeephaven/etc/', "${prefix}/src/rdeephaven/etc/")
copyFile('rdeephaven/R/', "${prefix}/src/rdeephaven/R/")
copyFile('rdeephaven/src/*.cpp', "${prefix}/src/rdeephaven/src/")
Expand Down Expand Up @@ -115,7 +113,7 @@ def rClientDoc = Docker.registerDockerTask(project, 'rClientDoc') {
}
}
copyOut {
into layout.buildDirectory.dir('man')
into layout.projectDirectory.dir('rdeephaven/man')
}
dockerfile {
from('deephaven/r-client:local-build')
Expand Down Expand Up @@ -153,19 +151,20 @@ def rClientDoc = Docker.registerDockerTask(project, 'rClientDoc') {
copyFile('r-doc.sh', "${prefix}/bin/rdeephaven")
}
parentContainers = [ project.tasks.getByName('rClient') ]
entrypoint = ["${prefix}/bin/rdeephaven/r-doc.sh", '/out']
entrypoint = ["${prefix}/bin/rdeephaven/r-doc.sh"]
containerOutPath = "${prefix}/src/rdeephaven/man"
}

task updateRClientDoc {
dependsOn rClientDoc
doLast {
exec {
workingDir '.'
commandLine 'rm', '-f', 'man/*'
commandLine 'tar', '-C', 'rdeephaven', '-zxvf', 'build/man/man.tgz'
}
}
}
//task updateRClientDoc {
niloc132 marked this conversation as resolved.
Show resolved Hide resolved
// dependsOn rClientDoc
// doLast {
// exec {
// workingDir '.'
// commandLine 'rm', '-f', 'rdeephaven/man/*'
// commandLine 'tar', '-C', 'rdeephaven', '-zxvf', 'build/man/man.tgz'
// }
// }
//}

deephavenDocker.shouldLogIfTaskFails testRClient
tasks.check.dependsOn(testRClient)
11 changes: 0 additions & 11 deletions R/r-doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -euo pipefail

if [ "$#" -ne 1 ]; then
echo "Usage: $0 output-dir" 1>&2
exit 1
fi

if [ -z "${DH_PREFIX}" ]; then
echo "$0: Environment variable DH_PREFIX is not set, aborting." 1>&2
exit 1
Expand All @@ -16,8 +11,6 @@ source $DH_PREFIX/env.sh

cd $DH_PREFIX/src/rdeephaven

OUT_DIR="$1"

R --no-save --no-restore <<EOF
library('roxygen2')
status = tryCatch(
Expand All @@ -30,7 +23,3 @@ status = tryCatch(
print(paste0('status=', status))
quit(save='no', status=status)
EOF

tar -zcf $OUT_DIR/man.tgz man

exit 0
Loading