Primary OpenSHA code repository
This repository contains OpenSHA code and model implementations. This project is intended for the core APIs and stable models. Exploratory code or one-off tests should instead go in our development sandbox, opensha-dev, which has this project as a dependency.
- Java 11 JDK or later, 64-bit: AdoptOpenJDK or OpenJDK
- Git
- Git is included in the macOS developer tools.
- Windows users may want to consider Git for Windows, which includes a linux-like terminal (Git BASH) in which subsequent commands listed here will work.
Other dependencies are managed with Gradle, which does not require a separate installation. Gradle is clever about finding Java, but some users may have to explicitly define a JAVA_HOME
environment variable.
To clone this project in a terminal (simplest and quickest for most users):
cd ~/git # create this directory or navigate an alternative directory of your choosing
git clone https://github.com/opensha/opensha.git
OpenSHA uses Gradle to handle the build process from dependency management to compilation. You should compile OpenSHA from your lowest level project, opensha-dev for the example above.
cd opensha
./gradlew assemble
This will build all source files in opensha. It will also build a jar file for each project, not including any dependencies. You can build a "fat jar" which includes dependent libraries as follows:
cd opensha
./gradlew fatJar
Most active OpenSHA development is done through Eclipse. You will need the Eclipse IDE for Java Developers.
NOTE: The following instructions assume that you have already cloned the OpenSHA projects on a terminal, though you can clone them through Eclipse. If you chose to go this route, be sure to leave the "Import all existing Eclipse projects after clone finishes" check-box UNSELECTED, as this feature will cause issues with gradle.
Once you have eclipse installed and running, do the following:
File > Import
- Select
Gradle > Existing Gradle Project
and hitNext
- Browse to the location of
opensha
underProject root directory
- Hit
Finish
You can either use Eclipse's built in Git tools, or the Git command line client to pull/push changes. Any time any of the .gradle
files are modified, or you see many unexpected compilation errors, right click on the project within eclipse and select Gradle > Refresh Gradle Project
.
OpenSHA has been in active development since the early 2000's. It was originally in CVS version control, and was ported to this SVN repository circa 2008. In 2017, it was migrated to GitHub and split into a number of sub-projects. History from the SVN repository was not retained, but it is archived here. The main codebase, which was re-unified into this repository in 2021, was previously stored in the now-archived opensha-commons, opensha-core, opensha-ucerf3, and opensha-apps.
A development sandbox, with which we're more relaxed with write-permissions, can be found here. Otherwise, outside contributions should come in the form of pull requests on this repository.