-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cobigen CLI commandlet #273
Conversation
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'cg.sh' -d '${COBIGEN_CLI_HOME}'" | ||
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'class-loader-agent.jar' -d '${COBIGEN_CLI_HOME}'" | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "doIsWindows" is a bit misleading name: It (currently) results in "yes", when the local bash environment is either msys (typically installed by git-for-windows) or cygwin. But both those firewalls need the *.sh files, when cobigen shall be started from inside the environment. In addition to that, the *.bat may also help - but only, when a developer also uses windows-CMD.
It might be easiest to extract just all files in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when we install maven or other multi-platform tools, we just extract everything.
Cant you just use doInstall
function for cobigen as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I cannot use doInstall
as my .jar
extension is not on the list of compatible files for doExtract
(that method is called inside doInstall
)
Also that doExtract
would extract other useless files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can support .jar in doExtract
in a second. Why do you have "useless" files in your CLI release?
Can you change the way you bundle the release? (we do not have to block this PR now, but on the long run I would prefer cleaning this code as it appears odd to me).
Further the content of this JAR is designed/defined in CobiGen but here you are spreading redundant knowledge about it. What if some day CobiGen decides to rename or replace class-loader-agent.jar
? Then this will break and nobody will notice as the CobiGen team is not anymore aware about this dependency in another repo...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jdiazgon thanks for this PR already. I wont approve or merge already as you said. Generally this is looking good but what is confusing me is:
- why does
devon cobigen
not support any other arguments? E.g. for maven you can not only install it viadevon mvn setup
but also invoke it viadevon mvn «args»
instead ofmvn «args»
. My expectation ofcobigen
commandlet would be the same. - why do you distribute cobigen CLI as JAR if it technically is a software bundle containing even shell scripts like
cg.sh
that need executable permissions? IMHO you should distribute it as *.tgz and set permissions accordingly.
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'cg.sh' -d '${COBIGEN_CLI_HOME}'" | ||
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'class-loader-agent.jar' -d '${COBIGEN_CLI_HOME}'" | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, when we install maven or other multi-platform tools, we just extract everything.
Cant you just use doInstall
function for cobigen as well?
Thanks for the feedback! I will update it as soon as possible.
Seems a good idea! I think I will implement it for the next release as we are already on a hurry for the current version and I don't have time for new changes. |
I am not sure whether I got it right, but cobigen-cli is a runnable jar, so you cannot just release it as it tar.gz or something like this. @jdiazgon as far as I remember, we simply extract a pom.xml file to dynamically download other dependencies, nothing more right? |
That was right for the previous version. However, for JDK 11 I had to add a Java agent as the class loading has completely changed. Right now our runnable jar contains that pom.xml and the jar of the Java agent. |
@jdiazgon the java11 compatibility is fixed, right? so this could be merged? |
It is fixed but we should not merged yet as the download URL is not the correct one. Please see this. Also the Travis build is failing with the following error: In scripts/command/cobigen line 35:
doEcho "Running: ${cobigen_cmd} ${@}"
^--^ SC2145: Argument mixes string and array. Use * or separate argument.
In scripts/command/cobigen line 41:
"${cobigen_cmd}" "${@} --verbose"
^--^ SC2145: Argument mixes string and array. Use * or separate argument. It seems a Linux related error. I will fix it ASAP. |
With respect to
The findings of shellcheck (which is run as part of travis) are correct ones. An explanatory URL is available within the travis build details. I'd say, the correct fixes were to use the following code instead:
This is not only true for linux but for bash scripts on any platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks o.k. now to me.
Or more precise: Everything about the shell syntax. There had been other comments on / requests for this PR which I have not reviewed all for being fulfilled or not.
Besser spät als nie. This PR is ready to be merged as the CobiGen CLI has been released to public. |
@hohwille if this PR is fine for you as well now, please merge it. |
The link which should download the latest version of the CLI is returning 404: We guess that Maven Central needs to refresh its metadata and it will take some hours to be available. However, I released yesterday and it should have been enough time. IMHO, if in 3 hours it is not yet working, we should go for a URL that works like: |
I had to change the "LATEST" URL as it was not working yet. PR ready to be merged. |
@jdiazgon, the LATEST link is working now. |
This reverts commit d8a17d4 which changed the download URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey all. To me this is good enough to be merged. I still have some comments I would like to have reworked/improved in the future. Further I would like to kindly ask you to update the PR comments.
Thanks for your effort on this and all CobiGen. 👍
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'cg.sh' -d '${COBIGEN_CLI_HOME}'" | ||
doRunCommand "unzip -q '${COBIGEN_CLI_HOME}/${software_name}.jar' 'class-loader-agent.jar' -d '${COBIGEN_CLI_HOME}'" | ||
fi | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can support .jar in doExtract
in a second. Why do you have "useless" files in your CLI release?
Can you change the way you bundle the release? (we do not have to block this PR now, but on the long run I would prefer cleaning this code as it appears odd to me).
Further the content of this JAR is designed/defined in CobiGen but here you are spreading redundant knowledge about it. What if some day CobiGen decides to rename or replace class-loader-agent.jar
? Then this will break and nobody will notice as the CobiGen team is not anymore aware about this dependency in another repo...
Not entirely complete. See: |
Addressing #59. This PR adds a new commandlet capable of installing the CobiGen CLI inside of the ide.
Ready to be merged.