在项目的“版本控制设置”中获取“本地项目路径”目录 [英] Obtain the `Local Project Path` directory in the project's `Version Control Settings`

查看:101
本文介绍了在项目的“版本控制设置”中获取“本地项目路径”目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

序言



这直接与Enterprise Architect的API及其脚本功能有关,与实际的JScript / Javascript无关。






问题



如何获取使用EA的脚本API在项目版本控制设置中的本地项目路径目录中?



注意: [Package] .XMLPath 仅提供相对于该位置的路径,在我的情况下这是不可用的。






背景



尝试创建将EA项目中所有软件包添加到我们版本的脚本控制软件(MKS / PTC Integrity),使用EA的通用SCC版本控制设置和脚本功能。



我已经设置了版本控制并将其链接到我们的VC软件的本地项目,并且能够很好地使用内置功能。<​​/ p>




为什么简单解决方案不起作用



首先,我知道EA具有向版本控制添加分支选项。但是,在将文件检入VC时,如果文件路径中的文件夹不在本地项目目录(沙盒)中,则我们的VC将创建目录而不是子项目(不同类型的容器,长话短说:我们需要子项目)



我无法使用EAP文件的位置作为参考路径,因为它不会在本地项目目录中(我们使用的是单个集中式






我当前正在尝试的操作


  1. mkdir文件夹进入每个包的本地项目目录(工作)

  2. 在我们的VC中创建所有子目录(工作)

  3. 使用EA的 package.VersionControlAdd 方法将XML文件添加到本地项目目录中的该目录中(不起作用!)

!步骤3是问题。 !! 这是问题所在。我无法提供所需的XML文件的路径,因为我需要本地项目路径



我可以

解决方案

只需查看文本文件

,在EA的内置帮助中找不到与该信息有关的任何内容。

 %appdata%\Sparx Systems\EA\paths.txt 

要查找的值存储在此文件中。没有API。是EA ...


Preface

This relates directly to Enterprise Architect's API and its scripting capabilities and not so much with actual JScript/Javascript.


Question

How do you obtain the Local Project Path directory in the project's Version Control Settings using EA's scripting API?

Note: [Package].XMLPath only provides the path relative to that location, which is unusable in my situation.


Background

Attempting to create script that adds all packages in an EA project to our version control software (MKS/PTC Integrity) using EA's generic SCC version control setup and scripting capabilities.

I have set up the version control and linked it to a local project for our VC software and am able to use the built-in functionality just fine.


Why the easy solution won't work

First off, I know that EA has an Add Branch to Version Control option. However, when checking in files to our VC, if the folders in filepath don’t exist in the local project directory (sandbox), our VC will create directories instead of subprojects (different types of containers, long story short: we need subprojects).

I can't use the location of the EAP file as a reference path because that won't be in the local project directory (we're using a singled centralized file on a server).


What I'm Currently Trying

  1. mkdir folders into local project directory for each package (working)
  2. Create all subdirectories in our VC (working)
  3. Use EA's package.VersionControlAdd method to add the XML files to that directory in the local project directory (not working!)

!! Step 3 is the problem. !! Here's where the question comes into play. I can't provide the path I want the XML file because I need the local project path.

I can't find anything referenced in EA's built in help regarding retrieving this information.

解决方案

Simply look into the text file

%appdata%\Sparx Systems\EA\paths.txt

The values you are looking for are stored in this file. There is no API. It's EA...

这篇关于在项目的“版本控制设置”中获取“本地项目路径”目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆