Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b603808
Test other jdks
pgleeson Dec 5, 2019
3ab3db5
Ensure runs on xenial
pgleeson Dec 5, 2019
e01586c
To v0.10.0 for NMLv2.1
pgleeson Apr 28, 2020
9e4d06b
Merge branch 'development' into experimental
pgleeson Apr 28, 2020
0393fa0
Remove openjdk10
pgleeson Apr 28, 2020
4081185
Whitespace fixes
sanjayankur31 Jun 20, 2020
d1346e4
Use equality operators for comparison instead of 'is/is not'
sanjayankur31 Jun 20, 2020
bab1932
Improve help text
sanjayankur31 Jun 20, 2020
7096160
Fix whitespace warnings
sanjayankur31 Jun 20, 2020
163b307
To v0.10.1
pgleeson Aug 10, 2020
8f0641d
Merge pull request #67 from sanjayankur31/various-fixes
pgleeson Sep 25, 2020
cd0fd89
Merge pull request #68 from NeuroML/py3test
pgleeson Sep 25, 2020
ccabff8
Merge branch 'master' into experimental
pgleeson Oct 27, 2020
f379813
Limit jdks for branch used for geppetto
pgleeson Oct 28, 2020
0f01f5c
Merge branch 'experimental' into development
pgleeson Oct 28, 2020
82e4fd8
Test on all jdks
pgleeson Oct 28, 2020
afea57e
Using java 1.7 to compile
Jan 27, 2021
5d0ce18
Check termination status of graphviz command
sanjayankur31 Feb 3, 2021
c4a68cc
feat(jnml): adds -lems-graph flag to jnml
sanjayankur31 Feb 10, 2021
3326be0
Merge pull request #72 from NeuroML/enh/check-graphviz-error-code
pgleeson Feb 15, 2021
b23d819
More explicit that the -lems-graph option is the one to use now
pgleeson Feb 15, 2021
c1ca841
Merge branch 'development' of github.com:NeuroML/jNeuroML into develo…
pgleeson Feb 15, 2021
bbb0063
enh(docs): add badges
sanjayankur31 Feb 27, 2021
4efe8da
enh(docs): add Fedora/NeuroFedora usage instructions
sanjayankur31 Feb 27, 2021
735fcf3
Incrementing version jnml
pgleeson Mar 2, 2021
38975c2
enh: add script to "install" jNeuroML on Linux machines
sanjayankur31 Mar 3, 2021
e46b6e6
Add new bug report issue template
sanjayankur31 Mar 3, 2021
a3b58a6
Add feature request template
sanjayankur31 Mar 3, 2021
8aead37
enh: add workflow to publish javadocs
sanjayankur31 Mar 10, 2021
1bf77fd
enh: check for java in the installer script
sanjayankur31 Mar 10, 2021
179bbea
Merge pull request #76 from NeuroML/enh/add-installer-script
pgleeson Mar 18, 2021
15c0799
Merge branch 'master' into development
pgleeson Mar 18, 2021
5174bf8
To v0.10.3
pgleeson Mar 19, 2021
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
116 changes: 116 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Publish Javadocs

on:
push:
branches: [ development ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: nelonoel/branch-name@v1.0.1

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
java-package: jdk

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install GH import
run: |
python -m pip install --upgrade pip
pip install ghp-import

- name: Checkout NeuroML2
uses: actions/checkout@v2
with:
repository: NeuroML/NeuroML2
ref: development
path: NeuroML2

- name: Checkout org.lemsml
uses: actions/checkout@v2
with:
repository: LEMS/jLEMS
ref: development
path: jLEMS

- name: Checkout org.neuroml.model.injectingplugin
uses: actions/checkout@v2
with:
repository: NeuroML/org.neuroml.model.injectingplugin
ref: development
path: org.neuroml.model.injectingplugin

- name: Checkout org.neuroml1.model
uses: actions/checkout@v2
with:
repository: NeuroML/org.neuroml1.model
ref: development
path: org.neuroml1.model

- name: Checkout org.neuroml.model
uses: actions/checkout@v2
with:
repository: NeuroML/org.neuroml.model
ref: development
path: org.neuroml.model

- name: Checkout org.neuroml.export
uses: actions/checkout@v2
with:
repository: NeuroML/org.neuroml.export
ref: development
path: org.neuroml.export

- name: Checkout org.neuroml.import
uses: actions/checkout@v2
with:
repository: NeuroML/org.neuroml.import
ref: development
path: org.neuroml.import


- name: Install NeuroML deps
run: |
pushd jLEMS
mvn install
popd
pushd NeuroML2
mvn install
popd
pushd org.neuroml.model.injectingplugin
mvn install
popd
pushd org.neuroml1.model
mvn install
popd
pushd org.neuroml.model
mvn install
popd
pushd org.neuroml.export
mvn install
popd
pushd org.neuroml.import
mvn install
popd

- name: Build docs
run: |
mvn javadoc:javadoc

- name: Publish documentation on GH pages
run: |
ghp-import -f -m "Regenerate documentation" -b gh-pages -n -p target/site/apidocs

11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dist: trusty
sudo: false
dist: xenial

language: java

jdk:
- openjdk7
- oraclejdk11

- openjdk8
- oraclejdk8
# - oraclejdk9
#- openjdk10 # Some non deterministic recurring error with jdk10...
- openjdk11

install:
- export main_repo_branch=$TRAVIS_BRANCH
Expand All @@ -18,6 +18,7 @@ install:
- ls -alt
- git branch
- python getNeuroML.py $main_repo_branch # will call mvn install on this & other repos
- mvn dependency:tree
- pwd

script:
Expand Down
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
jNeuroML
========

[![GitHub](https://img.shields.io/github/license/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/blob/master/LICENSE.lesser)
[![GitHub pull requests](https://img.shields.io/github/issues-pr/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/pulls)
[![GitHub issues](https://img.shields.io/github/issues/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/issues)
[![GitHub Org's stars](https://img.shields.io/github/stars/NeuroML?style=social)](https://github.com/NeuroML)
[![Twitter Follow](https://img.shields.io/twitter/follow/NeuroML?style=social)](https://twitter.com/NeuroML)


There are a number of repositories in active development under GitHub for handling [NeuroML](https://github.com/NeuroML)
and [LEMS](https://github.com/LEMS) with Java. To make it easier to access all of this functionality, we've created a single package, jNeuroML, which allows access to most of this functionality through a simple command line interface and requires minimal installation.

Expand All @@ -21,6 +28,18 @@ You can also check out the most recent verson of the jar file using:
svn checkout svn://svn.code.sf.net/p/neuroml/code/jNeuroMLJar
cd jNeuroMLJar


### Fedora

The [NeuroFedora](https://neuro.fedoraproject.org) community initiative provides jNeuroML for use on the [Fedora Linux Distribution](https://getfedora.org).
Fedora users can install jNeuroML using the following commands:

sudo dnf copr enable @neurofedora/neurofedora-extra
sudo dnf install jneuroml

Please see the [project documentation](https://docs.fedoraproject.org/en-US/neurofedora/copr/) for more information.


Usage
-----

Expand Down Expand Up @@ -76,10 +95,3 @@ If you prefer using/installing/coding in Python, try out [pyNeuroML](https://git
[![Build Status](https://travis-ci.com/NeuroML/jNeuroML.png?branch=master)](https://travis-ci.com/NeuroML/jNeuroML)

This code is distributed under the terms of the GNU Lesser General Public License.







104 changes: 57 additions & 47 deletions getNeuroML.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import sys
import os.path as op
import subprocess
from textwrap import dedent


def main():
"""Main"""
Expand Down Expand Up @@ -50,9 +52,7 @@ def main():
# Which repos use a development branch?
dev_branch_repos = neuroml2_spec_repo + neuroml_repos + jlems_repo


all_repos = lems_repos + neuroml_repos

all_repos = lems_repos + neuroml_repos

# Set the preferred method for cloning from GitHub
github_pref = "HTTP"
Expand All @@ -68,32 +68,31 @@ def main():

local_dir = ".." + os.sep + repo.split("/")[1]

if mode is "clean":
print("------ Cleaning: %s -------"%repo)
if mode == "clean":
print("------ Cleaning: %s -------" % repo)
if repo in java_repos:
command = "mvn clean"
print("It's a Java repository, so cleaning using Maven...")
info = execute_command_in_dir(command, local_dir)

if mode is "update":

print("------ Updating: %s -------" %repo)
if mode == "update":
print("------ Updating: %s -------" % repo)

runMvnInstall = False

if not op.isdir(local_dir):
command = "git clone %s%s" % (pre_gh[github_pref], repo)
print ("Creating a new directory: %s by cloning from GitHub" % \
(local_dir))
print("Creating a new directory: %s by cloning from GitHub" %
(local_dir))
execute_command_in_dir(command, "..")

runMvnInstall = True

if switch_to_branch:
if (repo in dev_branch_repos):
command = "git checkout %s" % (switch_to_branch)
print ("Switching to branch: %s" % (switch_to_branch))
exit_on_fail = switch_to_branch is not "experimental"
print("Switching to branch: %s" % (switch_to_branch))
exit_on_fail = switch_to_branch != "experimental"
execute_command_in_dir(command, local_dir, exit_on_fail)
runMvnInstall = True

Expand All @@ -107,55 +106,54 @@ def main():
or not op.isdir(local_dir + os.sep + "target") \
or ("jNeuroML" in repo)

if (repo in java_repos or repo in neuroml2_spec_repo) and runMvnInstall:
if (repo in java_repos or repo in neuroml2_spec_repo) \
and runMvnInstall:
command = "mvn install"
print("It's a Java repository, so installing using Maven...")
info = execute_command_in_dir(command, local_dir)

#The code below needs a non trivial rewrite due to python3 differences.

#
# The code below needs a non trivial rewrite due to python3
# differences.
if str("BUILD SUCCESS") in str(info):
print("Successful installation using : %s!" %command)
print("Successful installation using : %s!" % command)
else:
print("Problem installing using : %s!" %command)
print("Problem installing using : %s!" % command)
print(info)
exit(1)

if mode is "update":
if mode == "update":
print("All repositories successfully updated & Java modules built!")
print("You should be able to run some examples straight " \
"away using jnml: ")
if os.name is not 'nt':
print(" ./jnml "\
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
print(" ./jnml " \
"../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
print("You should be able to run examples straight away using jnml: ")
if os.name != 'nt':
print(" ./jnml " +
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
print(" ./jnml " +
"../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
else:
print(" jnml -validate " \
"..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
print(" jnml " \
"..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
if mode is "clean":
print(" jnml -validate " +
"..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
print(" jnml " +
"..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
if mode == "clean":
print("All repositories successfully cleaned!")




def execute_command_in_dir(command, directory, exit_on_fail=True):
"""Execute a command in specific working directory"""
if os.name == 'nt':
directory = os.path.normpath(directory)

print(">>> Executing: (%s) in dir: %s (%s)" % (command, directory, os.path.abspath(directory)))
print(">>> Executing: (%s) in dir: %s (%s)" %
(command, directory, os.path.abspath(directory)))

p = subprocess.Popen(command, cwd=directory, shell=True, stdout=subprocess.PIPE)
p = subprocess.Popen(command, cwd=directory, shell=True,
stdout=subprocess.PIPE)
return_str = p.communicate()

if p.returncode != 0:
print("Error: %s" % p.returncode)
if p.returncode != 0:
print("Error: %s" % p.returncode)
print(return_str[0])
if exit_on_fail:
if exit_on_fail:
exit(p.returncode)
if (sys.version_info > (3, 0)):
return return_str[0].decode("utf-8")
Expand All @@ -164,15 +162,27 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):


def help_info():
print("\nUsage:\n\n python getNeuroML.py\n " \
"Pull (or clone) the latest version of all NeuroML 2 repos & " \
"compile/install with Maven if applicable\n\n" \
" python getNeuroML.py clean\n "
"Run 'mvn clean' on all Java repos\n\n" \
" python getNeuroML.py master\n " \
"Switch all repos to master branch\n\n" \
" python getNeuroML.py development\n " \
"Switch relevant repos to development branch\n\n")
usage = (
"""\
Usage: python getNeuroML.py [OPTION]
Script to install NeuroML libraries.
Note: requires internet connectivity.

python getNeuroML.py
Pull (or clone) the latest version of all NeuroML 2 repos &
compile/install with Maven if applicable

python getNeuroML.py clean
Run 'mvn clean' on all Java repos

python getNeuroML.py master
Switch all repos to master branch

python getNeuroML.py development
Switch relevant repos to development branch
"""
)
print(dedent(usage))


if __name__ == "__main__":
Expand Down
Loading