Skip to content

Commit

Permalink
Avoid extra copying of r docs (#4811)
Browse files Browse the repository at this point in the history
Also prevents a dependency cycle that Gradle might complain about.
  • Loading branch information
niloc132 authored Nov 10, 2023
1 parent eb704d8 commit 611ce0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
20 changes: 4 additions & 16 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,18 +151,8 @@ 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']
}

task updateRClientDoc {
dependsOn rClientDoc
doLast {
exec {
workingDir '.'
commandLine 'rm', '-f', 'man/*'
commandLine 'tar', '-C', 'rdeephaven', '-zxvf', 'build/man/man.tgz'
}
}
entrypoint = ["${prefix}/bin/rdeephaven/r-doc.sh"]
containerOutPath = "${prefix}/src/rdeephaven/man"
}

deephavenDocker.shouldLogIfTaskFails testRClient
Expand Down
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

0 comments on commit 611ce0e

Please sign in to comment.