I'd like to create a script that retrieves the SVN path of the project and put it into a string.
Is it possible?
This shall be used only for projects that are shared (using the "teams" menu with a right click on a project).
Regards
Samuele
Ok, attached you will find the mentioned library. Please use it AS-IS. Sample code would look like this:
// $EXPERIMENTAL$ $STRICT_MODE$ $WARNING_AS_ERROR$ $ENHANCED_JAVA_ACCESS$var Teams = load(".lib/teams.js");var project = finder.scope;if (Teams.isShared(project)) { var info = Teams.getInfo(project); console.log("Project ''{0}'' is shared at {1}", project.name, info.url);}
Happy Scripting
Jan
Hi Samuele,
that in theory possible and we have created an internal in official library for that. I can post it if you like but as some of the other libraries, it heavily depends on internal medini and eclipse classes.
Hi Jan,
yes it would help.
Please give me some hints on how to use it in a Script.
My use case is that i'd like to lunch a script on a project and retrieve the SVN path.
i imagine that i have to import the library and then use some kind of method or function applied to the project, referenced with this command:
var project = finder.findByType(Metamodel.projectmodel);
Thanks
thanks it worked.
Best Regard
Please mark as answered.
it seems that I need "extended API"?:
de.ikv.medini.util.eclipse.coreErrorThu Mar 02 17:47:01 CET 2023Failed to execute Java Script: ReferenceError: "bind" is not defined. (...\config\scripts\.lib\teams.js#11)
Sven
Hi Sven,
then // $EXPERIMENTAL$ is missing in your first script line, right?
I used your example with // $EXPERIMENTAL$
now understood. However, it works for me if I use the above example code. I can just assume that for some reasons the above pragma is not in the first line of the code?
Second: I recognized that the lib doe snot yet work nicely with 2023 R1. Which version are you using?
I am using the 2023R1.
:-)
Hi Sven,,
the problem stating "bind" is not defined is definitely not an 23 R1 problem, maybe during copy something happened and the pragma is not in the first line of the script? Maybe it is visually but not really (hidden line break etc.) Please double check.
When it comes to the problem I faced with 23 R1, find attached an updated team.js.
after using the new lib it works.
Glad to hear that!