|
82 | 82 | ensure_jar_exists "$PROJECT_ROOT_PATH" "$JAR_PATH" |
83 | 83 |
|
84 | 84 | echo "***** build CDM" |
85 | | -java -cp "$JAR_PATH" com.regnosys.rosetta.generator.python.PythonCodeGeneratorCLI -s $CDM_SOURCE_PATH -t $PYTHON_TARGET_PATH -n $CDM_PROJECT_NAME -v $CDM_VERSION -x $CDM_PREFIX|| error "Failed to generate CDM Python code" |
86 | | -# java -cp "$JAR_PATH" com.regnosys.rosetta.generator.python.PythonCodeGeneratorCLI -s $CDM_SOURCE_PATH -t $PYTHON_TARGET_PATH || error "Failed to generate CDM Python code" |
| 85 | +java -cp "$JAR_PATH" com.regnosys.rosetta.generator.python.PythonCodeGeneratorCLI -s $CDM_SOURCE_PATH -t $PYTHON_TARGET_PATH -p $CDM_PROJECT_NAME -v $CDM_VERSION -x $CDM_PREFIX || error "Failed to generate CDM Python code" |
87 | 86 | JAVA_EXIT_CODE=$? |
88 | 87 | if [[ $JAVA_EXIT_CODE -eq 1 ]]; then |
89 | 88 | echo "Java program returned exit code 1. Stopping script." |
90 | 89 | exit 1 |
91 | 90 | fi |
92 | 91 |
|
93 | | -echo "***** setting up common environment" |
94 | | -source $PYTHON_SETUP_PATH/setup_python_env.sh |
95 | | - |
96 | | -echo "***** activating virtual environment" |
97 | | -VENV_NAME=".pyenv" |
98 | | -if [ -z "${WINDIR}" ]; then PY_SCRIPTS='bin'; else PY_SCRIPTS='Scripts'; fi |
99 | | -source "$PROJECT_ROOT_PATH/$VENV_NAME/${PY_SCRIPTS}/activate" || error |
100 | | - |
101 | | -echo "***** removing prior instance of cdm" |
102 | | -python -m pip uninstall -y python-cdm 2>/dev/null |
103 | | - |
104 | 92 | echo "***** build CDM Python package" |
105 | 93 | cd $PYTHON_TARGET_PATH |
106 | | -rm -f *-*.*.*-py3-none-any.whl |
107 | | -python -m pip wheel --no-deps --only-binary :all: . || error |
| 94 | +rm -f *-py3-none-any.whl |
| 95 | +$PYEXE -m pip wheel --no-deps --only-binary :all: . || error |
108 | 96 |
|
109 | | -echo "***** install CDM Python package" |
110 | | -CDM_WHL=$(ls *-*.*.*-py3-none-any.whl 2>/dev/null | head -1) |
| 97 | +CDM_WHL=$(ls *-py3-none-any.whl 2>/dev/null | head -1) |
111 | 98 | if [ -z "$CDM_WHL" ]; then |
112 | | - echo "ERROR: cdm wheel was not produced. Stopping." |
| 99 | + echo "ERROR: CDM wheel was not produced. Stopping." |
113 | 100 | error |
114 | 101 | fi |
115 | | -python -m pip install --no-deps "$CDM_WHL" --force-reinstall || error |
116 | | - |
117 | | -echo "***** cleanup" |
118 | | - |
119 | | -deactivate |
120 | | -if [[ "${REUSE_ENV}" != "1" && "${REUSE_ENV}" != "true" ]]; then |
121 | | - source $PYTHON_SETUP_PATH/cleanup_python_env.sh |
122 | | -else |
123 | | - echo "Skipping cleanup (REUSE_ENV set)" |
124 | | -fi |
| 102 | +echo "***** CDM wheel produced: $CDM_WHL" |
125 | 103 |
|
126 | 104 | echo "" |
127 | 105 | echo "" |
|
0 commit comments