Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2

updates:
- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
61 changes: 61 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Gradle CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
build:
name: Build and test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build and test
run: ./gradlew clean build

dependency-submission:
name: Submit Gradle dependencies
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v7

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Submit Gradle dependencies
uses: gradle/actions/dependency-submission@v6

65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
# REGI-Headless

This is a temporary readme file and will be updated in the future.
> [!IMPORTANT]
> **Notice: Project Refactor in Progress**
> This project is undergoing a large refactor for CWMS Data API support.
> It will transition from a Java project consuming Jython scripts to a **Python project** that
> utilizes **JPype** to call underlying REGI Java libraries.

`REGI-Headless` is a Java-based command-line tool and library designed to run
**REGI** calculations in a headless environment.
It allows users to execute complex hydrological calculations and manage gate settings via Jython
scripts without the need for a graphical interface.

## Features

- **Headless Execution**: Run REGI calculations as part of automated workflows or on servers.
- **Database Integration**: Connects to CWMS data retrieval and storage.
- **Modular Calculations**: Includes support for:
- Inflow calculations (Clone, Compute, Auto-Adjust, Balance All, etc.)
- Flow Group and gate settings calculations.

## Project Structure

- `regi-headless/`: Core Java implementation, including `RegiCLI`.
- `district-scripts/`: Example scripts and district-specific configurations.
- `docs/`: Additional documentation.

## Getting Started

### Prerequisites

- Java JDK 21 or higher.
- Access to a CWMS

### Building


```powershell
./gradlew build
```

Details TBD.

## Usage

TBD

### Command Line Options

TBD

### Example

TBD

## Testing

TBD

## Maintainers

See [MAINTAINERS.md](MAINTAINERS.md) for a list of project maintainers.

## License

See [LICENSE](LICENSE) for licensing information.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.palantir.git-version" version "3.0.0"
id "org.sonarqube" version "4.0.0.2929"
id "com.palantir.git-version" version "5.0.0"
id "org.sonarqube" version "7.3.1.8318"
}

def versionLabel(gitInfo) {
Expand Down
18 changes: 0 additions & 18 deletions buildSrc/src/main/groovy/regi-headless.deps-conventions.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@

def checkForNexusCredentials() {
if(!project.hasProperty('nexusUser')) {
println ('Please set the nexusUser property in the GRADLE_USER_HOME ($userHome/.gradle/gradle.properties) file or via -PnexusUser= .')
}
if(!project.hasProperty('nexusPassword')) {
println ('Please set the nexusPassword property in the GRADLE_USER_HOME ($userHome/.gradle/gradle.properties) file or via -PnexusPassword= .')
}
}

repositories {
maven {
url 'https://www.hec.usace.army.mil/nexus/repository/maven-public'
}
maven {
url 'https://www.hec.usace.army.mil/nexus/repository/hec-internal'
credentials {
checkForNexusCredentials()
username "$nexusUser"
password "$nexusPassword"
}
}
mavenCentral()
}
60 changes: 15 additions & 45 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,87 +1,57 @@
[versions]

# HEC Dependencies
service-annotations = "1.2.2"
win-java-heclib = "7-IE-win-x64"
solaris-java-heclib = "7-IE-Solaris64"
hec-core = "6.1-SNAPSHOT" # required for PasswordFileEditor
service-annotations = "2.1.0"
hec-server-suite = "8.4.5"

# REGI Dependencies
regi-tools = "3.4.3"
regi = "3.4.4"
regi-tools = "9.1.1"
regi = "3.5.0-alpha001"

# Third Party
jython-standalone = "2.7.2"
args4j = "2.32"

# Natives
windows-jre = "1.8.0_201"
solaris-jre = "1.8.0_202-Solaris-SPARC"
jython-starter = "2.2.4.0"

# Test
junit4 = "4.13.2"
junit = "5.9.3"
junit = "6.1.0"

[libraries]
# HEC Dependencies
service-annotations = { module = "mil.army.usace.hec:service-annotations", version.ref = "service-annotations" }
hec-core = { module="mil.army.usace.hec:hec-core", version.ref = "hec-core" }
win-java-heclib = {module="mil.army.usace.hec:javaHeclib", version.ref = "win-java-heclib"}
solaris-java-heclib = {module="mil.army.usace.hec:javaHeclib", version.ref = "solaris-java-heclib"}
serversuite = { module = "mil.army.usace.hec:hec-server-suite", version.ref = "hec-server-suite" }
serversuite-cda = { module = "mil.army.usace.hec:cda-server-suite", version.ref = "hec-server-suite" }
serversuite-jdbc = { module = "mil.army.usace.hec:jdbc-server-suite", version.ref = "hec-server-suite" }
hec-db-cda = { module = "mil.army.usace.hec:hec-db-cda", version = "14.1.0" }
hec-cwms-ratings-cda = { module = "mil.army.usace.hec:hec-cwms-ratings-io-cda", version = "4.2.2"}

# REGI Dependencies
regi-basinpie-ui = {module = "mil.army.wmist.regi:basin-pie-ui", version.ref = "regi"}
regi-computation = {module = "mil.army.wmist.regi:computation", version.ref = "regi"}
regi-decisionsupport-ui = {module = "mil.army.wmist.regi:decision-support-ui", version.ref = "regi"}
regi-mappanel-ui = {module = "mil.army.wmist.regi:map-panel-ui", version.ref = "regi"}
regi-ui = {module = "mil.army.wmist.regi:regi-ui", version.ref = "regi"}

# Regi-tools Dependencies
regi-tools-regi-core = {module = "mil.army.wmist.regi-tools:regi-core", version.ref = "regi-tools"}
regi-tools-regi-data = {module = "mil.army.wmist.regi-tools:regi-data", version.ref = "regi-tools"}
regi-tools-regi-dao = {module = "mil.army.wmist.regi-tools:regi-dao", version.ref = "regi-tools"}
regi-tools-regi-cwms = {module = "mil.army.wmist.regi-tools:regi-cwms", version.ref = "regi-tools"}
# Required for reservoir status graphics
regi-tools-regi-cache-ui = {module = "mil.army.wmist.regi-tools:regi-cache-ui", version.ref = "regi-tools"}

# Third Party
jython-standalone = {module = "org.python:jython-standalone", version.ref = "jython-standalone"}
args4j = {module = "args4j:args4j", version.ref = "args4j"}

# Natives
windows_jre = { module = "com.oracle:oracle-jre", version.ref = "windows-jre" }
solaris_jre = { module = "com.oracle:jre", version.ref = "solaris-jre" }
jython-starter = { module = 'mil.army.usace.hec.javastarter:javastarter-Jython', version.ref = "jython-starter"}

# Test
junit4 = { module = "junit:junit", version.ref = "junit4" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine", version.ref = "junit" }
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }

[bundles]
regi = [
"regi-basinpie-ui",
"regi-computation",
"regi-decisionsupport-ui",
"regi-mappanel-ui",
"regi-ui"]
regi = ["regi-computation"]
regi-tools = [
"regi-tools-regi-core",
"regi-tools-regi-cache-ui",
"regi-tools-regi-cwms",
"regi-tools-regi-dao",
"regi-tools-regi-data"
]
hec = [
"hec-core"
]
sys = [
"args4j",
"jython-standalone"
]
serversuite = ["serversuite", "serversuite-cda", "serversuite-jdbc", "hec-db-cda"]

junit-api = ["junit-jupiter-api", "junit-jupiter-params", "junit4"]
junit-engine = ["junit-jupiter-engine", "junit-vintage-engine"]
junit-api = ["junit-jupiter-api", "junit-jupiter-params"]
junit-engine = ["junit-jupiter-engine", "junit-platform-launcher"]
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 9 additions & 10 deletions gradlew

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

Loading
Loading