mirror of https://git.sr.ht/~hrbrmstr/cruxjars
18 changed files with 922 additions and 14 deletions
@ -0,0 +1,29 @@ |
|||
PACKAGE := $(shell grep '^Package:' DESCRIPTION | sed -E 's/^Package:[[:space:]]+//') |
|||
RSCRIPT = Rscript --no-init-file |
|||
|
|||
all: install |
|||
|
|||
test: |
|||
${RSCRIPT} -e 'library(methods); devtools::test()' |
|||
|
|||
doc: |
|||
${RSCRIPT} -e "library(methods); devtools::document()" |
|||
|
|||
install: |
|||
${RSCRIPT} -e "library(methods); devtools::install()" |
|||
|
|||
build: |
|||
${RSCRIPT} -e "library(methods); devtools::build()" |
|||
|
|||
check: |
|||
_R_CHECK_CRAN_INCOMING_=FALSE make check_all |
|||
|
|||
check_all: |
|||
${RSCRIPT} -e "library(methods); devtools::check(cran=TRUE)" |
|||
|
|||
README.md: README.Rmd |
|||
Rscript -e 'library(methods); devtools::load_all(); rmarkdown::render("README.Rmd", output_file="README.md")' |
|||
sed -i.bak 's/[[:space:]]*$$//' $@ |
|||
rm -f $@.bak |
|||
|
|||
.PHONY: all test doc install check check_all |
@ -1,4 +1,3 @@ |
|||
# Generated by roxygen2: do not edit by hand |
|||
|
|||
import(httr) |
|||
importFrom(jsonlite,fromJSON) |
|||
import(rJava) |
|||
|
@ -0,0 +1,21 @@ |
|||
#' @title rJava logging |
|||
#' @description Toggle verbose rJava logging |
|||
#' @details This function turns off the somewhat verbose rJava logging, most of which is |
|||
#' uninformative. It is called automatically when tabulizer is attached via |
|||
#' \code{library()}, \code{require}, etc. To keep logging on, load the package |
|||
#' namespace using \code{requireNamespace("htmlunit")} and reference functions |
|||
#' in using fully qualified references. |
|||
#' @note This resets a global Java setting and may affect logging of other rJava operations, |
|||
#' requiring a restart of R. |
|||
#' @return `NULL`, invisibly. |
|||
#' @author Thomas J. Leeper <thosjleeper@@gmail.com> |
|||
#' @noRd |
|||
#' @md |
|||
#' @examples |
|||
#' \dontrun{ |
|||
#' stop_logging() |
|||
#' } |
|||
stop_logging <- function() { |
|||
rJava::J("java.util.logging.LogManager")$getLogManager()$reset() |
|||
invisible(NULL) |
|||
} |
@ -0,0 +1,5 @@ |
|||
.onLoad <- function(libname, pkgname) { |
|||
rJava::.jpackage(pkgname, jars = "*", lib.loc = libname) |
|||
rJava::.jaddClassPath(dir(file.path(getwd(), "inst/java"), full.names = TRUE)) |
|||
stop_logging() |
|||
} |
File diff suppressed because one or more lines are too long
@ -1,2 +1,56 @@ |
|||
|
|||
[](https://travis-ci.org/hrbrmstr/cruxjars) |
|||
[](https://codecov.io/gh/hrbrmstr/cruxjars) |
|||
[](https://cran.r-project.org/package=cruxjars) |
|||
|
|||
# cruxjars |
|||
|
|||
Java Archive Wrapper Supporting the ‘crux’ Package |
|||
|
|||
## Description |
|||
|
|||
Contents of the ‘crux’ & supporting Java archives |
|||
<https://github.com/chimbori/crux>.Version number reflects the version |
|||
number of the included ‘JAR’ file. |
|||
|
|||
## What’s Inside The Tin |
|||
|
|||
The following functions are implemented: |
|||
|
|||
## Installation |
|||
|
|||
``` r |
|||
devtools::install_git("https://sr.ht.com/~hrbrmstr/cruxjars.git") |
|||
# or |
|||
devtools::install_git("https://gitlab.com/hrbrmstr/cruxjars.git") |
|||
# or (if you must) |
|||
devtools::install_github("hrbrmstr/cruxjars") |
|||
``` |
|||
|
|||
## Usage |
|||
|
|||
``` r |
|||
library(cruxjars) |
|||
|
|||
# current version |
|||
packageVersion("cruxjars") |
|||
## [1] '2.0.2' |
|||
``` |
|||
|
|||
## cruxjars Metrics |
|||
|
|||
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | |
|||
| :---- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: | |
|||
| Java | 2 | 0.2 | 28 | 0.36 | 5 | 0.18 | 18 | 0.21 | |
|||
| Maven | 1 | 0.1 | 17 | 0.22 | 0 | 0.00 | 1 | 0.01 | |
|||
| R | 5 | 0.5 | 15 | 0.19 | 2 | 0.07 | 32 | 0.38 | |
|||
| make | 1 | 0.1 | 10 | 0.13 | 4 | 0.14 | 0 | 0.00 | |
|||
| Rmd | 1 | 0.1 | 8 | 0.10 | 17 | 0.61 | 33 | 0.39 | |
|||
|
|||
## Code of Conduct |
|||
|
|||
Please note that this project is released with a [Contributor Code of |
|||
Conduct](CONDUCT.md). By participating in this project you agree to |
|||
abide by its terms. |
|||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@ |
|||
.PHONY: clean pkg deps run |
|||
|
|||
pkg: |
|||
mvn --quiet package |
|||
cp target/crux-1.0-SNAPSHOT.jar ../../inst/java |
|||
|
|||
clean: |
|||
mvn clean |
|||
|
|||
deps: |
|||
mvn dependency:copy-dependencies -DoutputDirectory=../../inst/java |
|||
|
|||
new: |
|||
mvn archetype:generate -DgroupId=is.rud.crux -DartifactId=crux -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false && mv Makefile crux |
@ -0,0 +1,18 @@ |
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<groupId>is.rud.crux</groupId> |
|||
<artifactId>crux</artifactId> |
|||
<packaging>jar</packaging> |
|||
<version>1.0-SNAPSHOT</version> |
|||
<name>crux</name> |
|||
<url>http://maven.apache.org</url> |
|||
<dependencies> |
|||
<!-- https://mvnrepository.com/artifact/com.chimbori.crux/crux --> |
|||
<dependency> |
|||
<groupId>com.chimbori.crux</groupId> |
|||
<artifactId>crux</artifactId> |
|||
<version>2.0.2</version> |
|||
</dependency> |
|||
</dependencies> |
|||
</project> |
@ -0,0 +1,13 @@ |
|||
package is.rud.crux; |
|||
|
|||
/** |
|||
* Hello world! |
|||
* |
|||
*/ |
|||
public class App |
|||
{ |
|||
public static void main( String[] args ) |
|||
{ |
|||
System.out.println( "Hello World!" ); |
|||
} |
|||
} |
@ -0,0 +1,38 @@ |
|||
package is.rud.crux; |
|||
|
|||
import junit.framework.Test; |
|||
import junit.framework.TestCase; |
|||
import junit.framework.TestSuite; |
|||
|
|||
/** |
|||
* Unit test for simple App. |
|||
*/ |
|||
public class AppTest |
|||
extends TestCase |
|||
{ |
|||
/** |
|||
* Create the test case |
|||
* |
|||
* @param testName name of the test case |
|||
*/ |
|||
public AppTest( String testName ) |
|||
{ |
|||
super( testName ); |
|||
} |
|||
|
|||
/** |
|||
* @return the suite of tests being tested |
|||
*/ |
|||
public static Test suite() |
|||
{ |
|||
return new TestSuite( AppTest.class ); |
|||
} |
|||
|
|||
/** |
|||
* Rigourous Test :-) |
|||
*/ |
|||
public void testApp() |
|||
{ |
|||
assertTrue( true ); |
|||
} |
|||
} |
Loading…
Reference in new issue