Skip to content

Commit f953e6e

Browse files
authored
Merge pull request #80 from NeuroML/development
For NML v2.1 release
2 parents 7d1aa12 + 5174bf8 commit f953e6e

File tree

9 files changed

+410
-203
lines changed

9 files changed

+410
-203
lines changed

.github/workflows/docs.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Publish Javadocs
5+
6+
on:
7+
push:
8+
branches: [ development ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: nelonoel/[email protected]
18+
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 11
23+
java-package: jdk
24+
25+
- name: Set up Python 3.9
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.9
29+
30+
- name: Install GH import
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install ghp-import
34+
35+
- name: Checkout NeuroML2
36+
uses: actions/checkout@v2
37+
with:
38+
repository: NeuroML/NeuroML2
39+
ref: development
40+
path: NeuroML2
41+
42+
- name: Checkout org.lemsml
43+
uses: actions/checkout@v2
44+
with:
45+
repository: LEMS/jLEMS
46+
ref: development
47+
path: jLEMS
48+
49+
- name: Checkout org.neuroml.model.injectingplugin
50+
uses: actions/checkout@v2
51+
with:
52+
repository: NeuroML/org.neuroml.model.injectingplugin
53+
ref: development
54+
path: org.neuroml.model.injectingplugin
55+
56+
- name: Checkout org.neuroml1.model
57+
uses: actions/checkout@v2
58+
with:
59+
repository: NeuroML/org.neuroml1.model
60+
ref: development
61+
path: org.neuroml1.model
62+
63+
- name: Checkout org.neuroml.model
64+
uses: actions/checkout@v2
65+
with:
66+
repository: NeuroML/org.neuroml.model
67+
ref: development
68+
path: org.neuroml.model
69+
70+
- name: Checkout org.neuroml.export
71+
uses: actions/checkout@v2
72+
with:
73+
repository: NeuroML/org.neuroml.export
74+
ref: development
75+
path: org.neuroml.export
76+
77+
- name: Checkout org.neuroml.import
78+
uses: actions/checkout@v2
79+
with:
80+
repository: NeuroML/org.neuroml.import
81+
ref: development
82+
path: org.neuroml.import
83+
84+
85+
- name: Install NeuroML deps
86+
run: |
87+
pushd jLEMS
88+
mvn install
89+
popd
90+
pushd NeuroML2
91+
mvn install
92+
popd
93+
pushd org.neuroml.model.injectingplugin
94+
mvn install
95+
popd
96+
pushd org.neuroml1.model
97+
mvn install
98+
popd
99+
pushd org.neuroml.model
100+
mvn install
101+
popd
102+
pushd org.neuroml.export
103+
mvn install
104+
popd
105+
pushd org.neuroml.import
106+
mvn install
107+
popd
108+
109+
- name: Build docs
110+
run: |
111+
mvn javadoc:javadoc
112+
113+
- name: Publish documentation on GH pages
114+
run: |
115+
ghp-import -f -m "Regenerate documentation" -b gh-pages -n -p target/site/apidocs
116+

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
dist: trusty
2-
sudo: false
1+
dist: xenial
32

43
language: java
54

65
jdk:
7-
- openjdk7
6+
- oraclejdk11
7+
88
- openjdk8
9-
- oraclejdk8
10-
# - oraclejdk9
9+
#- openjdk10 # Some non deterministic recurring error with jdk10...
10+
- openjdk11
1111

1212
install:
1313
- export main_repo_branch=$TRAVIS_BRANCH
@@ -18,6 +18,7 @@ install:
1818
- ls -alt
1919
- git branch
2020
- python getNeuroML.py $main_repo_branch # will call mvn install on this & other repos
21+
- mvn dependency:tree
2122
- pwd
2223

2324
script:

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
jNeuroML
22
========
33

4+
[![GitHub](https://img.shields.io/github/license/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/blob/master/LICENSE.lesser)
5+
[![GitHub pull requests](https://img.shields.io/github/issues-pr/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/pulls)
6+
[![GitHub issues](https://img.shields.io/github/issues/NeuroML/jNeuroML)](https://github.com/NeuroML/jNeuroML/issues)
7+
[![GitHub Org's stars](https://img.shields.io/github/stars/NeuroML?style=social)](https://github.com/NeuroML)
8+
[![Twitter Follow](https://img.shields.io/twitter/follow/NeuroML?style=social)](https://twitter.com/NeuroML)
9+
10+
411
There are a number of repositories in active development under GitHub for handling [NeuroML](https://github.com/NeuroML)
512
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.
613

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

31+
32+
### Fedora
33+
34+
The [NeuroFedora](https://neuro.fedoraproject.org) community initiative provides jNeuroML for use on the [Fedora Linux Distribution](https://getfedora.org).
35+
Fedora users can install jNeuroML using the following commands:
36+
37+
sudo dnf copr enable @neurofedora/neurofedora-extra
38+
sudo dnf install jneuroml
39+
40+
Please see the [project documentation](https://docs.fedoraproject.org/en-US/neurofedora/copr/) for more information.
41+
42+
2443
Usage
2544
-----
2645

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

7897
This code is distributed under the terms of the GNU Lesser General Public License.
79-
80-
81-
82-
83-
84-
85-

getNeuroML.py

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import sys
55
import os.path as op
66
import subprocess
7+
from textwrap import dedent
8+
79

810
def main():
911
"""Main"""
@@ -50,9 +52,7 @@ def main():
5052
# Which repos use a development branch?
5153
dev_branch_repos = neuroml2_spec_repo + neuroml_repos + jlems_repo
5254

53-
54-
all_repos = lems_repos + neuroml_repos
55-
55+
all_repos = lems_repos + neuroml_repos
5656

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

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

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

78-
if mode is "update":
79-
80-
print("------ Updating: %s -------" %repo)
78+
if mode == "update":
79+
print("------ Updating: %s -------" % repo)
8180

8281
runMvnInstall = False
8382

8483
if not op.isdir(local_dir):
8584
command = "git clone %s%s" % (pre_gh[github_pref], repo)
86-
print ("Creating a new directory: %s by cloning from GitHub" % \
87-
(local_dir))
85+
print("Creating a new directory: %s by cloning from GitHub" %
86+
(local_dir))
8887
execute_command_in_dir(command, "..")
8988

9089
runMvnInstall = True
9190

9291
if switch_to_branch:
9392
if (repo in dev_branch_repos):
9493
command = "git checkout %s" % (switch_to_branch)
95-
print ("Switching to branch: %s" % (switch_to_branch))
96-
exit_on_fail = switch_to_branch is not "experimental"
94+
print("Switching to branch: %s" % (switch_to_branch))
95+
exit_on_fail = switch_to_branch != "experimental"
9796
execute_command_in_dir(command, local_dir, exit_on_fail)
9897
runMvnInstall = True
9998

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

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

115-
#The code below needs a non trivial rewrite due to python3 differences.
116-
117-
#
115+
# The code below needs a non trivial rewrite due to python3
116+
# differences.
118117
if str("BUILD SUCCESS") in str(info):
119-
print("Successful installation using : %s!" %command)
118+
print("Successful installation using : %s!" % command)
120119
else:
121-
print("Problem installing using : %s!" %command)
120+
print("Problem installing using : %s!" % command)
122121
print(info)
123122
exit(1)
124123

125-
if mode is "update":
124+
if mode == "update":
126125
print("All repositories successfully updated & Java modules built!")
127-
print("You should be able to run some examples straight " \
128-
"away using jnml: ")
129-
if os.name is not 'nt':
130-
print(" ./jnml "\
131-
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
132-
print(" ./jnml " \
133-
"../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
126+
print("You should be able to run examples straight away using jnml: ")
127+
if os.name != 'nt':
128+
print(" ./jnml " +
129+
"-validate ../NeuroML2/examples/NML2_FullNeuroML.nml")
130+
print(" ./jnml " +
131+
"../NeuroML2/LEMSexamples/LEMS_NML2_Ex2_Izh.xml")
134132
else:
135-
print(" jnml -validate " \
136-
"..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
137-
print(" jnml " \
138-
"..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
139-
if mode is "clean":
133+
print(" jnml -validate " +
134+
"..\\NeuroML2\\examples\\NML2_FullNeuroML.nml")
135+
print(" jnml " +
136+
"..\\NeuroML2\\LEMSexamples\\LEMS_NML2_Ex2_Izh.xml")
137+
if mode == "clean":
140138
print("All repositories successfully cleaned!")
141139

142140

143-
144-
145141
def execute_command_in_dir(command, directory, exit_on_fail=True):
146142
"""Execute a command in specific working directory"""
147143
if os.name == 'nt':
148144
directory = os.path.normpath(directory)
149145

150-
print(">>> Executing: (%s) in dir: %s (%s)" % (command, directory, os.path.abspath(directory)))
146+
print(">>> Executing: (%s) in dir: %s (%s)" %
147+
(command, directory, os.path.abspath(directory)))
151148

152-
p = subprocess.Popen(command, cwd=directory, shell=True, stdout=subprocess.PIPE)
149+
p = subprocess.Popen(command, cwd=directory, shell=True,
150+
stdout=subprocess.PIPE)
153151
return_str = p.communicate()
154152

155-
if p.returncode != 0:
156-
print("Error: %s" % p.returncode)
153+
if p.returncode != 0:
154+
print("Error: %s" % p.returncode)
157155
print(return_str[0])
158-
if exit_on_fail:
156+
if exit_on_fail:
159157
exit(p.returncode)
160158
if (sys.version_info > (3, 0)):
161159
return return_str[0].decode("utf-8")
@@ -164,15 +162,27 @@ def execute_command_in_dir(command, directory, exit_on_fail=True):
164162

165163

166164
def help_info():
167-
print("\nUsage:\n\n python getNeuroML.py\n " \
168-
"Pull (or clone) the latest version of all NeuroML 2 repos & " \
169-
"compile/install with Maven if applicable\n\n" \
170-
" python getNeuroML.py clean\n "
171-
"Run 'mvn clean' on all Java repos\n\n" \
172-
" python getNeuroML.py master\n " \
173-
"Switch all repos to master branch\n\n" \
174-
" python getNeuroML.py development\n " \
175-
"Switch relevant repos to development branch\n\n")
165+
usage = (
166+
"""\
167+
Usage: python getNeuroML.py [OPTION]
168+
Script to install NeuroML libraries.
169+
Note: requires internet connectivity.
170+
171+
python getNeuroML.py
172+
Pull (or clone) the latest version of all NeuroML 2 repos &
173+
compile/install with Maven if applicable
174+
175+
python getNeuroML.py clean
176+
Run 'mvn clean' on all Java repos
177+
178+
python getNeuroML.py master
179+
Switch all repos to master branch
180+
181+
python getNeuroML.py development
182+
Switch relevant repos to development branch
183+
"""
184+
)
185+
print(dedent(usage))
176186

177187

178188
if __name__ == "__main__":

0 commit comments

Comments
 (0)