-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add auto-env setup #51
Comments
Hmm interesting. Gum already has a Given that there's more than on way to install a build tool ( |
@aalmiray well, this issue is not about installing - it is fine to assume it is installed - but auto-switch the env of the execution (and support at least sdkman by default ;)). For ex, if I have sdkman and the needed version for project1 (java 11, maven 3.6) and project2 (java 17, maven 3.8) then |
Hmm, how would gum know that Java 11 is needed? Or a particular version of a build tool for that matter? Even using a more regular syntax like With regards to the build tool version, that's precisely why the wrappers exist, to fix the version of the build tool that should be used with that particular project. If a project does not make use of the companion build tool wrapper, how would gum know which version should be switched to? There could be a "preferred" version found in Bottom line is, I'm not saying this is a bad idea, just trying to figure out the spread and how things could play out. |
Here are the points on my side - does not mean somebody can not see it differently is what i want to emphasize:
Hope it clarifies the idea/goal |
Yes, kind of, again there are more limited options to define Java versions than there are in Gradle and Ant. Bach doesn't have that setting, and JBang doesn't neet it as it's baked into the script if you really need a explicit version of Java to run it. So, this could be done for Maven and would leave Gradle support unmodified. Alternatively a set of predefined check points could be defined for both Maven and Gradle (say use these and that properties) so that Gum has an easier way to find the requirements. If you happen to use a different option then well, too bad. FWIW I'd rather not parse the |
@aalmiray you don't need maven model - which wouldnt being you anything but the fact you have a plugin with an XML in it. A lot of java and C tools around maven parse the pom as a text file with indexOf or regexes to match opening/closing tags (if a single tag is multiline you can ignore it, it is rare enough to not be an issue), it is not hard to do the same in go and would solve that to extract target/release compiler value if present IMHO. |
There's no way to parse the Maven model unless it's done from scratch. Any "reads" done to Yes, regexes could be used but there are not 100% fool proof. |
Agree, my point was just it is a trivial task at the end since it is not a strict parsing (even if the file is invalid for the build tool, gum does not care since it just wants to extract some info to run the tool which will validate it). |
Goal is to be able to reuse the common package managers and inherit from them the needed setup (like
sdk use java xxx
andsdk use maven xxx
for sdkman, xxx being guess from a quick pom/build.gradle review - compiler plugin/task for ex).Goal is literally to have
gum build
working without anything else while everything is installed and explicitly fail if something is missing/not found.Note: a gum.properties can enable to add path locations to find the executable (higher priority than defaults which are appended in terms of test order), should just support $HOME or equivalent to not be hardcoded per user.
The text was updated successfully, but these errors were encountered: