Book a Demo

Author Topic: Relative path in package control options  (Read 11194 times)

Mekugi

  • EA Novice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Relative path in package control options
« on: January 16, 2015, 04:17:13 am »
Hi,

In an attempt to workaround an issue with version-controlled shared packages in EA 11.1 (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1421225830), I would like to use package control without version control (packages represented with the red box on the left side).

I noticed that it was possible to use "Local Paths" IDs when specifying the XMI file name in the Package Control Options window (Ctrl+Alt+P), using %ID%.
I was wondering if there were other EA macros that could be used in that context, such as the .eap project path, or the path of the containing package's XMI file?

Thank you by advance

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relative path in package control options
« Reply #1 on: January 16, 2015, 06:37:24 am »
ICR anything else. For what purpose would you use "other" macros?

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Relative path in package control options
« Reply #2 on: January 16, 2015, 11:04:47 am »
Open the local paths dialog and add a new path with any id and a type of XMI.
Use that path in the controlled packages dialog (ie. %MYPATH%\file.xmi)

Mekugi

  • EA Novice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Re: Relative path in package control options
« Reply #3 on: January 16, 2015, 06:17:18 pm »
Thank you for the answers.

@Simon: yes, as stated in the original post, it is possible to define a local path and associate it to an id. But these are all absolute paths and are apparently shared by all EA projects.

@qwerty: Purpose is to be able to properly use a same controlled package present in different locations on the hard drive, from different EA projects. Hence I wanted to be able to use a path relative, for example, to the location of the EA project file; alternative could be to use a local path that would be project-specific, but does this exist?

Mekugi

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relative path in package control options
« Reply #4 on: January 16, 2015, 08:33:48 pm »
IIRC the relative path question has been asked a couple of times (though not my main interest in EA) and the answer was "not possible". What you can do is to set up some outer configuration control for the %appdata%/sparx.../EA/paths.txt where you mangle the single path such that they end in the right directory for all people.

q.

Mekugi

  • EA Novice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Re: Relative path in package control options
« Reply #5 on: January 16, 2015, 08:54:25 pm »
@qwerty: interesting, I thought the local paths were stored somewhere in the registry, like the version control settings.

I might be able to hook a script to the open project event and that would patch the path.txt file...

Thx

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relative path in package control options
« Reply #6 on: January 16, 2015, 11:59:55 pm »
Keep in mind that EA only reads that file when launched (at least that's what I had in mind, but you could verify that easily). So the use case would be limited to that constraint.

q.

Mekugi

  • EA Novice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Re: Relative path in package control options
« Reply #7 on: January 17, 2015, 12:13:25 am »
Very pertinent remark.

Thanks!

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Relative path in package control options
« Reply #8 on: January 22, 2015, 01:25:35 am »
How do I consume the "controlled package path" in Scripting ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relative path in package control options
« Reply #9 on: January 22, 2015, 01:41:27 am »
Read the paths.txt file and interpret it.

q.

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Relative path in package control options
« Reply #10 on: January 22, 2015, 02:14:39 am »
is it the one in "C:\Program Files (x86)\Sparx Systems\EA\paths.txt", that was empty...  :-/
« Last Edit: January 22, 2015, 02:15:09 am by Aswin »

Mekugi

  • EA Novice
  • *
  • Posts: 13
  • Karma: +1/-0
    • View Profile
Re: Relative path in package control options
« Reply #11 on: January 22, 2015, 02:19:08 am »
No, it is in the application data of your local user profile.

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Relative path in package control options
« Reply #12 on: January 22, 2015, 02:30:31 am »
Quote
No, it is in the application data of your local user profile.

Thanks ! I got the file

it reads "%PATH%;type=Version Control;id=svc_arch;path=C:\SVC\EA-Local-One;"

But how do i get the value of %svc_arch% in JScript.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relative path in package control options
« Reply #13 on: January 22, 2015, 05:14:32 am »
Write a parser for CSV or use some lib version.

q.

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Relative path in package control options
« Reply #14 on: January 22, 2015, 03:21:17 pm »
Quote
Write a parser for CSV or use some lib version.

q.

Thanks !  but how to access the path of the file ? (I have the paths.txt in C:\Users\harikria\AppData\Roaming\Sparx Systems\EA)
I dont want to hard code the location as it will keep on changing for different users.

How do i get to read the paths.txt from EA, without hard coding the location  :-/

I find that using " echo %appdata%  " you can get the App Data Folder, so if I append " Sparx Systems\EA " to the location, I hope the paths.txt will be created in the same folder all the time.
« Last Edit: January 22, 2015, 03:27:37 pm by Aswin »