From f2591f8449dd4c5cdd6335454a7765ad7f7c76fa Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Sun, 24 May 2026 18:22:29 +0300 Subject: [PATCH 1/2] ST6RI-927: Add support for setting build and metamodel tags when building stdlib KPARs Signed-off-by: Vytautas Astrauskas --- .github/workflows/build.yml | 2 +- org.omg.sysml.xtext/pom.xml | 21 ++ .../sysml/xtext/util/StdLibVersionUtil.java | 214 ++++++++++++++++++ pom.xml | 8 +- .../Domain Libraries/Analysis/.project.json | 24 +- .../Cause and Effect/.project.json | 20 +- .../Domain Libraries/Geometry/.project.json | 24 +- .../Domain Libraries/Metadata/.project.json | 16 +- .../Quantities and Units/.project.json | 20 +- .../Requirement Derivation/.project.json | 16 +- .../Kernel Data Type Library/.project.json | 8 +- .../Kernel Function Library/.project.json | 14 +- .../Kernel Semantic Library/.project.json | 12 +- sysml.library/Systems Library/.project.json | 16 +- 14 files changed, 326 insertions(+), 89 deletions(-) create mode 100644 org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25b057b69..d25fb217b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build with Maven - run: ./mvnw -B clean verify --file pom.xml + run: ./mvnw -B clean verify --file pom.xml -Dsysml.build-tag=nightly-$(date +'%Y%m%d') -Dsysml.metadata-tag=$(date +'%Y%m%d') - name: Upload SysML Library .kpar files uses: actions/upload-artifact@v5 with: diff --git a/org.omg.sysml.xtext/pom.xml b/org.omg.sysml.xtext/pom.xml index f11b05876..9e698f7c9 100644 --- a/org.omg.sysml.xtext/pom.xml +++ b/org.omg.sysml.xtext/pom.xml @@ -60,6 +60,27 @@ org.codehaus.mojo exec-maven-plugin + + + update-project-versions + prepare-package + + java + + + org.omg.sysml.xtext.util.StdLibVersionUtil + + --workspace + ${maven.multiModuleProjectDirectory}/sysml.library + --build-tag + ${sysml.build-tag} + --metamodel-tag + ${sysml.metadata-tag} + + compile + + + org.eclipse.xtend diff --git a/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java b/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java new file mode 100644 index 000000000..7b31a883c --- /dev/null +++ b/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java @@ -0,0 +1,214 @@ +/******************************************************************************* + * SysML 2 Pilot Implementation + * Copyright (c) 2026 Sensmetry, UAB. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the Eclipse Public License as published by + * the Eclipse Foundation, version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * Eclipse Public License for more details. + * + * You should have received a copy of the Eclipse Public License + * along with this program. If not, see . + * + * @license EPL-2.0 + * + *******************************************************************************/ + +package org.omg.sysml.xtext.util; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import com.sensmetry.sysand.Sysand; +import com.sensmetry.sysand.exceptions.SysandException; +import com.sensmetry.sysand.model.InterchangeProject; +import com.sensmetry.sysand.model.InterchangeProjectInfo; +import com.sensmetry.sysand.model.InterchangeProjectMetadata; +import com.sensmetry.sysand.model.InterchangeProjectUsage; + +public class StdLibVersionUtil { + + private static final String DEV_SEPARATOR = "-dev."; + + /** Strips any existing -dev.* suffix, then appends -dev.. */ + static String withBuildTag(String version, String buildTag) { + int idx = version.indexOf(DEV_SEPARATOR); + String base = idx >= 0 ? version.substring(0, idx) : version; + return base + DEV_SEPARATOR + buildTag; + } + + /** Strips any existing -dev.* suffix. */ + static String stripBuildTag(String version) { + int idx = version.indexOf(DEV_SEPARATOR); + return idx >= 0 ? version.substring(0, idx) : version; + } + + /** Applies build tag to a versionConstraint like "=1.0.0" → "=1.0.0-dev.". */ + static String withBuildTagConstraint(String constraint, String buildTag) { + int start = 0; + while (start < constraint.length() && !Character.isDigit(constraint.charAt(start))) { + start++; + } + return constraint.substring(0, start) + withBuildTag(constraint.substring(start), buildTag); + } + + /** Strips any existing -dev.* suffix from a versionConstraint like "=1.0.0-dev." → "=1.0.0". */ + static String stripBuildTagConstraint(String constraint) { + int start = 0; + while (start < constraint.length() && !Character.isDigit(constraint.charAt(start))) { + start++; + } + return constraint.substring(0, start) + stripBuildTag(constraint.substring(start)); + } + + /** + * Replaces the date segment in a spec resource URL with buildTag. + * URL structure: https://www.omg.org/spec/{lang}/{date}/{name}.kpar + * Splitting by "/" yields the date at index 5. + */ + static String withBuildTagResource(String resource, String buildTag) { + String[] parts = resource.split("/"); + if (parts.length >= 7) { + parts[5] = buildTag; + } + return String.join("/", parts); + } + + /** + * Replaces the date segment in a spec metamodel URL with buildTag. + * URL structure: https://www.omg.org/spec/{lang}/{date} + * Splitting by "/" yields the date at index 5. + */ + static String withBuildTagMetamodelUrl(String url, String buildTag) { + String[] parts = url.split("/"); + if (parts.length >= 6) { + parts[5] = buildTag; + } + return String.join("/", parts); + } + + static void updateProject(Path projectPath, String buildTag, String metamodelTag) throws SysandException { + InterchangeProject project = Sysand.infoPath(projectPath); + InterchangeProjectInfo info = project.info; + + if (info.getVersion() != null) { + info.setVersion(buildTag != null + ? withBuildTag(info.getVersion(), buildTag) + : stripBuildTag(info.getVersion())); + } + + InterchangeProjectUsage[] usages = info.getUsage(); + for (InterchangeProjectUsage usage : usages) { + if (buildTag != null && usage.getResource() != null) { + usage.setResource(withBuildTagResource(usage.getResource(), buildTag)); + } + if (usage.getVersionConstraint() != null) { + usage.setVersionConstraint(buildTag != null + ? withBuildTagConstraint(usage.getVersionConstraint(), buildTag) + : stripBuildTagConstraint(usage.getVersionConstraint())); + } + } + info.setUsage(usages); + + Sysand.setProjectInfo(projectPath, info); + + InterchangeProjectMetadata metadata = project.metadata; + if (metadata != null && metadata.getMetamodel() != null && metamodelTag != null) { + metadata.setMetamodel(withBuildTagMetamodelUrl(metadata.getMetamodel(), metamodelTag)); + Sysand.setProjectMetadata(projectPath, metadata); + } + } + + public static void updateWorkspace(String workspacePath, String buildTag, String metamodelTag) throws SysandException { + String[] projectPaths = Sysand.workspaceProjectPaths(Paths.get(workspacePath)); + for (String projectPath : projectPaths) { + System.out.println(" Updating: " + projectPath); + updateProject(Paths.get(projectPath), buildTag, metamodelTag); + } + } + + private static boolean isMavenPlaceholder(String value) { + return value != null && value.startsWith("${"); + } + + private static String parseTag(String value) { + return (value != null && !value.isEmpty() && !isMavenPlaceholder(value)) ? value : null; + } + + private static void printUsage() { + System.err.println("Usage: StdLibVersionUtil --workspace WORKSPACE_PATH"); + System.err.println(" [--build-tag BUILD_TAG] [--metamodel-tag METAMODEL_TAG]"); + System.err.println(); + System.err.println(" --workspace Path to the workspace directory containing .workspace.json (required)"); + System.err.println(" --build-tag Stamp -dev. onto version, versionConstraint, and resource"); + System.err.println(" URLs in each project's .project.json"); + System.err.println(" --metamodel-tag Replace the date segment of the metamodel URL in each project's"); + System.err.println(" .meta.json"); + System.err.println(" --help Show this message"); + System.err.println(); + System.err.println("At least one of --build-tag or --metamodel-tag must be provided."); + } + + public static void main(String[] args) throws SysandException { + String workspacePath = null; + String buildTag = null; + String metamodelTag = null; + String rawBuildTag = null; + String rawMetamodelTag = null; + + for (int i = 0; i < args.length; i++) { + switch (args[i]) { + case "--help": + printUsage(); + return; + case "--workspace": + if (++i >= args.length) { printUsage(); return; } + workspacePath = args[i]; + break; + case "--build-tag": + if (++i >= args.length) { printUsage(); return; } + rawBuildTag = args[i]; + buildTag = parseTag(args[i]); + break; + case "--metamodel-tag": + if (++i >= args.length) { printUsage(); return; } + rawMetamodelTag = args[i]; + metamodelTag = parseTag(args[i]); + break; + default: + System.err.println("Unknown argument: " + args[i]); + printUsage(); + return; + } + } + + if (workspacePath == null) { + System.err.println("Error: --workspace is required."); + printUsage(); + return; + } + + if (buildTag == null && metamodelTag == null) { + if (isMavenPlaceholder(rawBuildTag) || isMavenPlaceholder(rawMetamodelTag)) { + System.out.println("Skipping: both --build-tag and --metamodel-tag are Maven placeholders."); + return; + } + System.err.println("Error: at least one of --build-tag or --metamodel-tag must be provided."); + printUsage(); + return; + } + + if (buildTag != null) { + System.out.println("Applying build tag '" + buildTag + "' to .project.json files in: " + workspacePath); + } + if (metamodelTag != null) { + System.out.println("Applying metamodel tag '" + metamodelTag + "' to .meta.json files in: " + workspacePath); + } + updateWorkspace(workspacePath, buildTag, metamodelTag); + System.out.println("Done."); + } +} diff --git a/pom.xml b/pom.xml index 5bd99f2d6..cad071917 100644 --- a/pom.xml +++ b/pom.xml @@ -5,6 +5,8 @@ 0.60.0-SNAPSHOT + 20260501 + 20250201 4.0.13 UTF-8 3.1.0 @@ -28,7 +30,7 @@ 3.5.3 3.2.0 2.3.19 - 0.0.11 + 0.1.0-rc.1 4.0.0 @@ -358,14 +360,14 @@ build-helper-maven-plugin ${build-helper-maven-plugin.version} - diff --git a/sysml.library/Domain Libraries/Analysis/.project.json b/sysml.library/Domain Libraries/Analysis/.project.json index 28f385278..56f26acfa 100644 --- a/sysml.library/Domain Libraries/Analysis/.project.json +++ b/sysml.library/Domain Libraries/Analysis/.project.json @@ -1,27 +1,27 @@ { "name": "SysML Analysis Library", - "version": "2.0.0", "description": "Standard analysis domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Quantities-and-Units-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Quantities-and-Units-Domain-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Domain Libraries/Cause and Effect/.project.json b/sysml.library/Domain Libraries/Cause and Effect/.project.json index 3e3096927..efbe61d95 100644 --- a/sysml.library/Domain Libraries/Cause and Effect/.project.json +++ b/sysml.library/Domain Libraries/Cause and Effect/.project.json @@ -1,23 +1,23 @@ { "name": "SysML Cause and Effect Library", - "version": "2.0.0", "description": "Standard cause-and-effect domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Domain Libraries/Geometry/.project.json b/sysml.library/Domain Libraries/Geometry/.project.json index 58a93dd24..fd7c2b66d 100644 --- a/sysml.library/Domain Libraries/Geometry/.project.json +++ b/sysml.library/Domain Libraries/Geometry/.project.json @@ -1,27 +1,27 @@ { "name": "SysML Geometry Library", - "version": "2.0.0", "description": "Standard geometry domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Quantities-and-Units-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Quantities-and-Units-Domain-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Domain Libraries/Metadata/.project.json b/sysml.library/Domain Libraries/Metadata/.project.json index 2b7fa5cb3..0d7b44e7b 100644 --- a/sysml.library/Domain Libraries/Metadata/.project.json +++ b/sysml.library/Domain Libraries/Metadata/.project.json @@ -1,19 +1,19 @@ { "name": "SysML Metadata Library", - "version": "2.0.0", "description": "Standard metadata domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Domain Libraries/Quantities and Units/.project.json b/sysml.library/Domain Libraries/Quantities and Units/.project.json index b11aa71a7..1fa631731 100644 --- a/sysml.library/Domain Libraries/Quantities and Units/.project.json +++ b/sysml.library/Domain Libraries/Quantities and Units/.project.json @@ -1,23 +1,23 @@ { "name": "SysML Quantities and Units Library", - "version": "2.0.0", "description": "Standard quantities and units domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Domain Libraries/Requirement Derivation/.project.json b/sysml.library/Domain Libraries/Requirement Derivation/.project.json index 23e2eea73..f50b109ce 100644 --- a/sysml.library/Domain Libraries/Requirement Derivation/.project.json +++ b/sysml.library/Domain Libraries/Requirement Derivation/.project.json @@ -1,19 +1,19 @@ { "name": "SysML Requirement Derivation Library", - "version": "2.0.0", "description": "Standard requirements derivation domain library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", - "versionConstraint": "2.0.0" + "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "versionConstraint": "2.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json b/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json index 2845d6064..656dcedf1 100644 --- a/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json @@ -1,11 +1,11 @@ { "name": "Kernel Data Type Library", - "version": "1.0.0", "description": "Standard data type library for the Kernel Modeling Language (KerML)", + "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Kernel Libraries/Kernel Function Library/.project.json b/sysml.library/Kernel Libraries/Kernel Function Library/.project.json index b12be4605..2db00f9e8 100644 --- a/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Function Library/.project.json @@ -1,15 +1,15 @@ { "name": "Kernel Function Library", - "version": "1.0.0", "description": "Standard function library for the Kernel Modeling Language (KerML)", + "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" - } + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" + } ] -} \ No newline at end of file +} diff --git a/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json b/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json index 69b2b642a..0e541614c 100644 --- a/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json @@ -1,15 +1,15 @@ { "name": "Kernel Semantic Library", - "version": "1.0.0", "description": "Standard semantic library for the Kernel Modeling Language (KerML)", + "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" } ] -} \ No newline at end of file +} diff --git a/sysml.library/Systems Library/.project.json b/sysml.library/Systems Library/.project.json index d0c711437..e267542dc 100644 --- a/sysml.library/Systems Library/.project.json +++ b/sysml.library/Systems Library/.project.json @@ -1,19 +1,19 @@ { "name": "SysML Systems Library", - "version": "2.0.0", "description": "Standard semantic library for the Systems Modeling Language (SysML)", + "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", - "versionConstraint": "1.0.0" + "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "versionConstraint": "1.1.0-dev.20260501" } ] -} \ No newline at end of file +} From 813c89114d5c898b97c3f3f75a716659d4cc61e2 Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Tue, 9 Jun 2026 10:51:59 +0300 Subject: [PATCH 2/2] ST6RI-927: Use metamodel tag in resource IRIs --- org.omg.sysml.xtext/pom.xml | 2 +- .../org/omg/sysml/xtext/util/StdLibVersionUtil.java | 12 ++++++------ pom.xml | 2 +- .../Domain Libraries/Analysis/.project.json | 10 +++++----- .../Domain Libraries/Cause and Effect/.project.json | 8 ++++---- .../Domain Libraries/Geometry/.project.json | 10 +++++----- .../Domain Libraries/Metadata/.project.json | 6 +++--- .../Quantities and Units/.project.json | 8 ++++---- .../Requirement Derivation/.project.json | 6 +++--- .../Kernel Data Type Library/.project.json | 2 +- .../Kernel Function Library/.project.json | 4 ++-- .../Kernel Semantic Library/.project.json | 4 ++-- sysml.library/Systems Library/.project.json | 6 +++--- 13 files changed, 40 insertions(+), 40 deletions(-) diff --git a/org.omg.sysml.xtext/pom.xml b/org.omg.sysml.xtext/pom.xml index 9e698f7c9..c27ae6d48 100644 --- a/org.omg.sysml.xtext/pom.xml +++ b/org.omg.sysml.xtext/pom.xml @@ -75,7 +75,7 @@ --build-tag ${sysml.build-tag} --metamodel-tag - ${sysml.metadata-tag} + ${sysml.metamodel-tag} compile diff --git a/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java b/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java index 7b31a883c..2dd2763dd 100644 --- a/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java +++ b/org.omg.sysml.xtext/src/org/omg/sysml/xtext/util/StdLibVersionUtil.java @@ -103,8 +103,8 @@ static void updateProject(Path projectPath, String buildTag, String metamodelTag InterchangeProjectUsage[] usages = info.getUsage(); for (InterchangeProjectUsage usage : usages) { - if (buildTag != null && usage.getResource() != null) { - usage.setResource(withBuildTagResource(usage.getResource(), buildTag)); + if (metamodelTag != null && usage.getResource() != null) { + usage.setResource(withBuildTagResource(usage.getResource(), metamodelTag)); } if (usage.getVersionConstraint() != null) { usage.setVersionConstraint(buildTag != null @@ -144,10 +144,10 @@ private static void printUsage() { System.err.println(" [--build-tag BUILD_TAG] [--metamodel-tag METAMODEL_TAG]"); System.err.println(); System.err.println(" --workspace Path to the workspace directory containing .workspace.json (required)"); - System.err.println(" --build-tag Stamp -dev. onto version, versionConstraint, and resource"); - System.err.println(" URLs in each project's .project.json"); - System.err.println(" --metamodel-tag Replace the date segment of the metamodel URL in each project's"); - System.err.println(" .meta.json"); + System.err.println(" --build-tag Stamp -dev. onto version and versionConstraint in each"); + System.err.println(" project's .project.json"); + System.err.println(" --metamodel-tag Replace the date segment of resource URLs in each project's"); + System.err.println(" .project.json and the metamodel URL in each project's .meta.json"); System.err.println(" --help Show this message"); System.err.println(); System.err.println("At least one of --build-tag or --metamodel-tag must be provided."); diff --git a/pom.xml b/pom.xml index cad071917..117e9386b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 0.60.0-SNAPSHOT 20260501 - 20250201 + 20250201 4.0.13 UTF-8 3.1.0 diff --git a/sysml.library/Domain Libraries/Analysis/.project.json b/sysml.library/Domain Libraries/Analysis/.project.json index 56f26acfa..9c6ab3153 100644 --- a/sysml.library/Domain Libraries/Analysis/.project.json +++ b/sysml.library/Domain Libraries/Analysis/.project.json @@ -4,23 +4,23 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Quantities-and-Units-Domain-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Quantities-and-Units-Domain-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Domain Libraries/Cause and Effect/.project.json b/sysml.library/Domain Libraries/Cause and Effect/.project.json index efbe61d95..c5bc20fd8 100644 --- a/sysml.library/Domain Libraries/Cause and Effect/.project.json +++ b/sysml.library/Domain Libraries/Cause and Effect/.project.json @@ -4,19 +4,19 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Domain Libraries/Geometry/.project.json b/sysml.library/Domain Libraries/Geometry/.project.json index fd7c2b66d..2ed335dd3 100644 --- a/sysml.library/Domain Libraries/Geometry/.project.json +++ b/sysml.library/Domain Libraries/Geometry/.project.json @@ -4,23 +4,23 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Quantities-and-Units-Domain-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Quantities-and-Units-Domain-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Domain Libraries/Metadata/.project.json b/sysml.library/Domain Libraries/Metadata/.project.json index 0d7b44e7b..5f713dba2 100644 --- a/sysml.library/Domain Libraries/Metadata/.project.json +++ b/sysml.library/Domain Libraries/Metadata/.project.json @@ -4,15 +4,15 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Domain Libraries/Quantities and Units/.project.json b/sysml.library/Domain Libraries/Quantities and Units/.project.json index 1fa631731..74114f18c 100644 --- a/sysml.library/Domain Libraries/Quantities and Units/.project.json +++ b/sysml.library/Domain Libraries/Quantities and Units/.project.json @@ -4,19 +4,19 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Domain Libraries/Requirement Derivation/.project.json b/sysml.library/Domain Libraries/Requirement Derivation/.project.json index f50b109ce..a9c3c1075 100644 --- a/sysml.library/Domain Libraries/Requirement Derivation/.project.json +++ b/sysml.library/Domain Libraries/Requirement Derivation/.project.json @@ -4,15 +4,15 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/SysML/20260501/Systems-Library.kpar", + "resource": "https://www.omg.org/spec/SysML/20250201/Systems-Library.kpar", "versionConstraint": "2.1.0-dev.20260501" } ] diff --git a/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json b/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json index 656dcedf1..4ac0b9d04 100644 --- a/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Data Type Library/.project.json @@ -4,7 +4,7 @@ "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" } ] diff --git a/sysml.library/Kernel Libraries/Kernel Function Library/.project.json b/sysml.library/Kernel Libraries/Kernel Function Library/.project.json index 2db00f9e8..69e6a0899 100644 --- a/sysml.library/Kernel Libraries/Kernel Function Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Function Library/.project.json @@ -4,11 +4,11 @@ "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" } ] diff --git a/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json b/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json index 0e541614c..c2a8befe7 100644 --- a/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json +++ b/sysml.library/Kernel Libraries/Kernel Semantic Library/.project.json @@ -4,11 +4,11 @@ "version": "1.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" } ] diff --git a/sysml.library/Systems Library/.project.json b/sysml.library/Systems Library/.project.json index e267542dc..fa3cd9a0a 100644 --- a/sysml.library/Systems Library/.project.json +++ b/sysml.library/Systems Library/.project.json @@ -4,15 +4,15 @@ "version": "2.1.0-dev.20260501", "usage": [ { - "resource": "https://www.omg.org/spec/KerML/20260501/Semantic-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Semantic-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Data-Type-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Data-Type-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" }, { - "resource": "https://www.omg.org/spec/KerML/20260501/Function-Library.kpar", + "resource": "https://www.omg.org/spec/KerML/20250201/Function-Library.kpar", "versionConstraint": "1.1.0-dev.20260501" } ]