Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ipeaGIT/r5r
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapereirabr committed Nov 21, 2023
2 parents 8b4f9ab + 7a8153b commit a022f1d
Show file tree
Hide file tree
Showing 42 changed files with 731 additions and 340 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/java-r5rcore-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Java R5RCore build

on:
push:
paths:
- java-r5rcore/**
- .github/workflows/java-r5rcore-build.yaml

jobs:
build:
env:
GH_TOKEN: ${{ github.token }}

runs-on: ubuntu-latest

# don't build on merges to master
if: ${{ !github.ref_protected }}

steps:
- uses: actions/checkout@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R packages
run: |
install.packages(c('devtools', 'remotes'))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
working-directory: r-package

- name: Install system dependencies
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
working-directory: r-package

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
- name: Build with Gradle
uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629
with:
arguments: build
build-root-directory: java-r5rcore

- name: Create pull request
# https://github.com/actions/checkout/pull/1184
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
mv java-r5rcore/build/libs/java-r5rcore-*.jar r-package/inst/jar/r5r.jar
git add r-package/inst/jar/r5r.jar
git commit -m "Rebuild JAR for commit ${GITHUB_SHA}"
git push
3 changes: 3 additions & 0 deletions java-r5rcore/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.gradle
build
3 changes: 0 additions & 3 deletions java-r5rcore/.idea/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion java-r5rcore/.idea/.name

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions java-r5rcore/.idea/libraries/JRI.xml

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion java-r5rcore/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions java-r5rcore/.idea/modules.xml

This file was deleted.

124 changes: 0 additions & 124 deletions java-r5rcore/.idea/uiDesigner.xml

This file was deleted.

6 changes: 0 additions & 6 deletions java-r5rcore/.idea/vcs.xml

This file was deleted.

37 changes: 37 additions & 0 deletions java-r5rcore/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
plugins {
id 'java'
}

group 'org.ipea'
version '1.0.2-SNAPSHOT'

// Build against the version of R5 that the current r5r download_r5 function will
// grab
def baos = new ByteArrayOutputStream()
exec {
commandLine 'R', '--no-save', '-q', '-s', '-e', 'setwd("../r-package"); devtools::load_all(quiet=T); cat(download_r5());'
standardOutput = baos
}
def r5Path = baos.toString()

def rjava_baos = new ByteArrayOutputStream()
exec {
commandLine 'R', '--no-save', '-q', '-s', '-e', 'cat(system.file("jri/JRI.jar", package="rJava"))'
standardOutput = rjava_baos
}
def rJavaPath = rjava_baos.toString()

println(rJavaPath)

sourceSets {
main {
java {
srcDirs = ['src']
}
}
}

dependencies {
implementation files(r5Path)
implementation files(rJavaPath)
}
Binary file added java-r5rcore/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions java-r5rcore/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit a022f1d

Please sign in to comment.