Skip to content

Commit

Permalink
Add PROJECT_NAME environment variable so that the xml2palette script …
Browse files Browse the repository at this point in the history
…can be used by multiple projects
  • Loading branch information
james-strauss-uwa committed Oct 8, 2021
1 parent 4611c43 commit d9a4ee2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,17 @@ matrix:
install:
- sudo apt-get update && sudo apt-get install -y doxygen xsltproc
before_script:
- export PROJECT_NAME=daliuge
- export PROJECT_VERSION=$(git rev-parse --short HEAD)
- export GIT_REPO=$(git config --get remote.origin.url)
- git config --global user.name $GITHUB_USERNAME
- git config --global user.email "$GITHUB_USERNAME@gmail.com"
script:
- python3 tools/xml2palette/xml2palette.py -i ./ -o daliuge-$TRAVIS_BRANCH.palette
- python3 tools/xml2palette/xml2palette.py -i ./ -o $PROJECT_NAME-$TRAVIS_BRANCH.palette
after_success:
- git clone https://$GITHUB_TOKEN@github.com/ICRAR/EAGLE_test_repo
- mv daliuge-$TRAVIS_BRANCH.palette EAGLE_test_repo/DALIUGE/
- mkdir -p EAGLE_test_repo/$PROJECT_NAME
- mv $PROJECT_NAME-$TRAVIS_BRANCH.palette EAGLE_test_repo/$PROJECT_NAME/
- cd EAGLE_test_repo
- git add *
- git diff-index --quiet HEAD || git commit -m "Automatically generated DALiuGE palette (branch $TRAVIS_BRANCH, commit $PROJECT_VERSION)"
Expand Down
4 changes: 2 additions & 2 deletions tools/xml2palette/xml2palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# NOTE: not sure if all of these are actually required
# make sure to retrieve some of these from environment variables
DOXYGEN_SETTINGS = [
("PROJECT_NAME", "DALIUGE"),
("OPTIMIZE_OUTPUT_JAVA", "YES"),
("AUTOLINK_SUPPORT", "NO"),
("IDL_PROPERTY_SUPPORT", "NO"),
Expand Down Expand Up @@ -58,7 +57,7 @@ def get_filenames_from_command_line(argv):


def check_environment_variables():
required_environment_variables = ["PROJECT_VERSION", "GIT_REPO"]
required_environment_variables = ["PROJECT_NAME", "PROJECT_VERSION", "GIT_REPO"]

for variable in required_environment_variables:
value = os.environ.get(variable)
Expand Down Expand Up @@ -476,6 +475,7 @@ def process_compounddef(compounddef):
sys.exit(1)

# add extra doxygen setting for input and output locations
DOXYGEN_SETTINGS.append(("PROJECT_NAME", os.environ.get("PROJECT_NAME")))
DOXYGEN_SETTINGS.append(("INPUT", inputdir))
DOXYGEN_SETTINGS.append(("OUTPUT_DIRECTORY", output_directory.name))

Expand Down

0 comments on commit d9a4ee2

Please sign in to comment.