Skip to content

Commit bb2a575

Browse files
committed
ST6RI-453 Added "-d" flag to repository save utilities.
1 parent 12d25a3 commit bb2a575

7 files changed

Lines changed: 29 additions & 19 deletions

File tree

org.omg.kerml.xtext/.launch/Save KerML with Library.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.kerml.xtext.util.KerMLRepositorySaveUtil"/>
1515
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.kerml.xtext"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${selected_resource_loc}&quot;&#10;&quot;Kernel Library&quot;&#10;&quot;Systems Library&quot; &#10;&quot;Domain Libraries&quot;"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 -d&#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${selected_resource_loc}&quot;&#10;&quot;Kernel Library&quot;&#10;&quot;Systems Library&quot; &#10;&quot;Domain Libraries&quot;"/>
1717
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.kerml.xtext"/>
1818
</launchConfiguration>
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
3-
<stringAttribute key="bad_container_name" value="/SySML-v2-Pilot-Implementation/org.omg.kerml.xte/.launch"/>
4-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5-
<listEntry value="/org.omg.kerml.xtext/src/org/omg/kerml/xtext/util/KerMLRepositorySaveUtil.java"/>
6-
</listAttribute>
7-
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
8-
<listEntry value="1"/>
9-
</listAttribute>
10-
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
11-
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
12-
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.kerml.xtext.util.KerMLRepositorySaveUtil"/>
13-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot;"/>
14-
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.kerml.xtext"/>
3+
<stringAttribute key="bad_container_name" value="/SySML-v2-Pilot-Implementation/org.omg.kerml.xte/.launch"/>
4+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
5+
<listEntry value="/org.omg.kerml.xtext/src/org/omg/kerml/xtext/util/KerMLRepositorySaveUtil.java"/>
6+
</listAttribute>
7+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
8+
<listEntry value="1"/>
9+
</listAttribute>
10+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
11+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/>
12+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/>
13+
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
14+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.kerml.xtext.util.KerMLRepositorySaveUtil"/>
15+
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.kerml.xtext"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 -d &quot;${selected_resource_loc}&quot;"/>
17+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.kerml.xtext"/>
1518
</launchConfiguration>

org.omg.kerml.xtext/src/org/omg/kerml/xtext/util/KerMLRepositorySaveUtil.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class KerMLRepositorySaveUtil extends KerMLTraversalUtil {
4343

4444
private String basePath = ApiElementProcessingFacade.DEFAULT_BASE_PATH;
4545
private String libraryPath = null;
46+
private boolean isAddDerivedElements = false;
4647
private boolean isAddImplicitElements = false;
4748
private String projectName;
4849

@@ -109,7 +110,8 @@ protected String[] processArgs(String[] args) {
109110
int n = args.length;
110111
if (n > 0) {
111112
int i = 0;
112-
while(("-b".equals(args[i]) || "-l".equals(args[i]) || "-g".equals(args[i]) || "-v".equals(args[i])) &&
113+
while(("-b".equals(args[i]) || "-l".equals(args[i]) || "-d".equals(args[i]) ||
114+
"-g".equals(args[i]) || "-v".equals(args[i])) &&
113115
i + 1 < n) {
114116
if ("-b".equals(args[i])) {
115117
this.basePath = args[++i];
@@ -118,6 +120,8 @@ protected String[] processArgs(String[] args) {
118120
if (!libraryPath.endsWith("/")) {
119121
libraryPath += "/";
120122
}
123+
} else if ("-d".equals(args[i])) {
124+
this.isAddDerivedElements = true;
121125
} else if ("-g".equals(args[i])) {
122126
this.isAddImplicitElements = true;
123127
} else if ("-v".equals(args[i])) {
@@ -163,6 +167,7 @@ protected void initialize(String[] args) {
163167
ApiElementProcessingFacade processingFacade = new ApiElementProcessingFacade(this.projectName, this.getBasePath());
164168
processingFacade.setTraversal(this.initialize(processingFacade));
165169
processingFacade.setIsVerbose(this.isVerbose);
170+
processingFacade.setIsIncludeDerived(this.isAddDerivedElements);
166171
}
167172

168173
/**
@@ -209,13 +214,14 @@ public void run(String[] args) {
209214
*
210215
* <p>Usage:
211216
*
212-
* <p>KerMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-g] [-v] input-path [library-path library-path...]
217+
* <p>KerMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-d] [-g] [-v] input-path [library-path library-path...]
213218
*
214219
* <p>where:
215220
*
216221
* <ul>
217222
* <li>-b base-path-url gives the URL for the base path to be used for the API endpoint (if none is given, the default is used)</li>
218223
* <li>-l library-base-path gives the base path to used for reading model library resources</li>
224+
* <li>-d specifies that derived attributes should be included (the default is not to)</li>
219225
* <li>-g specifies that implicit elements should be generated (the default is not to)</li>
220226
* <li>-v specifies verbose mode (the default is non-verbose)</li>
221227
* <li>input-path is a path for reading input resources</li>

org.omg.sysml.xtext/.launch/Save SysML Test.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.xtext.util.SysMLRepositorySaveTest"/>
1515
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.sysml.xtext"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2.intercax.com:9000 &#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml/src/validation}&quot;&#10;&quot;Kernel Library&quot; &#10;&quot;Systems Library&quot; &#10;&quot;Domain Libraries&quot;"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 -d&#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml/src/validation}&quot;&#10;&quot;Kernel Library&quot; &#10;&quot;Systems Library&quot; &#10;&quot;Domain Libraries&quot;"/>
1717
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
1818
</launchConfiguration>

org.omg.sysml.xtext/.launch/Save SysML with Library.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.xtext.util.SysMLRepositorySaveUtil"/>
1515
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.sysml.xtext"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000&#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${selected_resource_loc}&quot;&#10;&quot;Kernel Library&quot;&#10;&quot;Systems Library&quot;&#10;&quot;Domain Library&quot;"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 -d&#10;-l &quot;${workspace_loc:/SysML-v2-Pilot-Implementation/sysml.library}&quot; &#10;&quot;${selected_resource_loc}&quot;&#10;&quot;Kernel Library&quot;&#10;&quot;Systems Library&quot;&#10;&quot;Domain Library&quot;"/>
1717
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
1818
</launchConfiguration>

org.omg.sysml.xtext/.launch/Save SysML.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
1414
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.omg.sysml.xtext.util.SysMLRepositorySaveUtil"/>
1515
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="org.omg.sysml.xtext"/>
16-
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 &quot;${selected_resource_loc}&quot;"/>
16+
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-b http://sysml2-dev.intercax.com:9000 -d &quot;${selected_resource_loc}&quot;"/>
1717
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.omg.sysml.xtext"/>
1818
</launchConfiguration>

org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/SysMLRepositorySaveUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ public SysMLRepositorySaveUtil() {
4141
*
4242
* <p>Usage:
4343
*
44-
* <p>SysMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-g] input-path [library-path library-path...]
44+
* <p>SysMLRepositorySaveUtil [-b base-path-url] [-l library-base-path] [-d] [-g] [-v] input-path [library-path library-path...]
4545
*
4646
* <p>where:
4747
*
4848
* <ul>
4949
* <li>-b base-path-url gives the URL for the base path to be used for the API endpoint (if none is given, the default is used)</li>
5050
* <li>-l library-base-path gives the base path to used for reading model library resources</li>
51+
* <li>-d specifies that derived attributes should be included (the default is not to)</li>
5152
* <li>-g specifies that implicit generalizations should be generated (the default is not to)</li>
5253
* <li>input-path is a path for reading input resources</li>
5354
* <li>library-paths are paths for reading library resources, relative to the library-base-path (if one is given)</li>

0 commit comments

Comments
 (0)