Book a Demo

Author Topic: Getting latest version of package with C# api  (Read 6925 times)

Tomvw

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Getting latest version of package with C# api
« on: July 30, 2014, 04:24:48 pm »
Hi everyone,

I'm trying to use the C# api to open a project in EA to generate the HTML report on a daily basis. For this I have to get the latest version from the VCS (TFS in our case), open the project, get the latest version of the packages and then start RunHTMLReport.

The problem I am facing is that after opening the .EAP file, accessing the repository and looping through the packages, the VersionControlGetLatest method gives the exception "Could not find connection to version control provider.". It also says that the VersionControlStatus of each package is 'Uncontrolled'.

How can I get the API to connect to the version control provider?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Getting latest version of package with C# api
« Reply #1 on: July 30, 2014, 06:53:51 pm »
It must be connected manually before you can use the VC API methods. You "can" do that also programmatically but it is cumbersome (and I would not see the point to do that config via automation).

q.
« Last Edit: July 30, 2014, 06:54:09 pm by qwerty »

Tomvw

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Getting latest version of package with C# api
« Reply #2 on: July 30, 2014, 08:06:49 pm »
Thanks for your response. So if I understand correctly is it impossible to do a GetLatest with the API on a version controlled project/package?

I could not find any documentation about a connection to the version control in the API manual. If I use the Add-In modules, I am probably connection to the version control by EA itself.

Tough luck...

Tom.


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Getting latest version of package with C# api
« Reply #3 on: July 31, 2014, 08:18:27 am »
You can do Package.VersionControlGetLatest(). But the VC configuration itself must have been setup before. This should be done manually though you "could" do it programmatically.

q.

Tomvw

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Getting latest version of package with C# api
« Reply #4 on: July 31, 2014, 04:09:07 pm »
Can you help me with how I can setup the VC configuration or connection programmatically?

Thanks in advance!

Tom.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Getting latest version of package with C# api
« Reply #5 on: July 31, 2014, 04:54:57 pm »
Hello,

I think there is a thread about this subject in this forum. Try search.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Getting latest version of package with C# api
« Reply #6 on: July 31, 2014, 06:54:37 pm »
Helmut is right. It has to do with the config path being stored in a file and some VCCFG parameter somewhere in the package properties (in t_package).

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Getting latest version of package with C# api
« Reply #7 on: August 03, 2014, 06:09:28 pm »
Quote
Can you help me with how I can setup the VC configuration or connection programmatically?

Thanks in advance!

Tom.

I started the post Helmut and q. have mentioned.  Here is the link to it: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1401110788/0
I followed the instructions in order to create the EA-SVN configuration(remeber to change from SVN to TFS where needed).

Be aware that something is missing and the configuration is created not in every case.

Before starting to do it programmatically, try to set a manual configuration by selecting Project -> Version Control -> Version control settings, and then running your addin.
« Last Edit: August 04, 2014, 05:33:37 pm by avoda234 »

Tomvw

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Getting latest version of package with C# api
« Reply #8 on: August 04, 2014, 05:25:55 pm »
Hi everyone,

I've managed to get it working. Apparently it was not an issue with the VC, but with the packages. After selecting the right packages the GetLatest method worked.

Thank you for help.

Tom.