Skip to content

Commit 6994d25

Browse files
authored
Merge pull request #633 from Systems-Modeling/ST6RI-178
ST6RI-178 Implement versioned publishing
2 parents 1fa3199 + dd437c3 commit 6994d25

475 files changed

Lines changed: 122845 additions & 66579 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Java CI with Maven
10+
11+
on:
12+
push:
13+
branches: [ "master" ]
14+
pull_request:
15+
branches: '**'
16+
17+
jobs:
18+
build:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: '17'
28+
distribution: 'temurin'
29+
cache: maven
30+
- name: Build with Maven
31+
run: ./mvnw -B clean verify --file pom.xml
32+
- name: Publish Test Report
33+
uses: mikepenz/action-junit-report@v5
34+
if: success() || failure() # always run even if the previous step fails
35+
with:
36+
report_paths: '**/target/surefire-reports/TEST-*.xml'
37+
include_passed: true
38+
- name: Verify index generation
39+
run: echo $(git diff -- sysml.library/.index.json) | grep -e '^$' || (echo "Library index in the git repository is not up to date. Please re-generate it and push changes to the repository."; exit 1)
40+
- name: Publish to Github Packages
41+
if: github.event_name != 'pull_request'
42+
run: ./mvnw -B deploy -DskipTests=true
43+
env:
44+
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password

kerml/src/examples/KerML Spec Annex A Examples/A-3-8-ChangingFeatureValues.kerml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ package ChangingFeatureValuesModelToBeExecuted {
2323
}
2424

2525
struct Product {
26-
feature isPainted : Boolean [1] := false;
27-
feature isDry : Boolean [1] := true;
28-
feature isShipped : Boolean [1] := false;
26+
var feature isPainted : Boolean [1] := false;
27+
var feature isDry : Boolean [1] := true;
28+
var feature isShipped : Boolean [1] := false;
2929
}
3030

3131
behavior Paint {
@@ -80,9 +80,9 @@ package ChangingFeatureValuesExecution {
8080
private import FeatureReferencingPerformances::FeatureWritePerformance;
8181

8282
struct ProductTimeSlice specializes Product {
83-
readonly feature redefines isPainted;
84-
readonly feature redefines isDry;
85-
readonly feature redefines isShipped;
83+
feature redefines isPainted;
84+
feature redefines isDry;
85+
feature redefines isShipped;
8686
}
8787

8888
#atom

kerml/src/examples/Simple Tests/ArgumentResolution.kerml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package ArgumentResolutionBug {
55

66
behavior B {
77
in feature x;
8-
out feature : A = A(x);
8+
out feature : A = new A(x);
99
}
1010

1111
class C {

kerml/src/examples/Simple Tests/Behaviors.kerml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ package Behaviors {
88
}
99
behavior B specializes A {
1010
in x1;
11-
out y1;
11+
out var y1;
12+
}
13+
class C {
14+
var z = A().y;
15+
step a : A;
16+
binding z = a.y;
1217
}
1318
}

kerml/src/examples/Simple Tests/Expressions.kerml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ package Expressions {
5656
bb : Boolean = f.s(1);
5757

5858
class C {
59-
count : ScalarValues::Integer := 0;
59+
var count : ScalarValues::Integer := 0;
6060
}
6161

6262
feature obj1 : C;
@@ -70,6 +70,6 @@ package Expressions {
7070
feature count : ScalarValues::Integer = c#(1).count;
7171
}
7272

73-
feature l = L();
73+
feature l = new L();
7474
feature w1 = w(xx);
7575
}

kerml/src/examples/Simple Tests/Features.kerml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,24 @@ package Features {
4949
feature guardian[1];
5050
}
5151

52-
classifier RegisteredAsset {
53-
composite readonly feature identifier[0..1];
54-
}
55-
56-
classifier Vehicle :> RegisteredAsset {
57-
derived feature vin[1] = identifier;
58-
}
59-
52+
class RegisteredAsset {
53+
composite var feature identifier[0..1];
54+
}
55+
56+
classifier Vehicle :> RegisteredAsset {
57+
derived var feature vin[1] = identifier;
58+
59+
var feature v : Vehicle;
60+
binding vin = v.vin;
61+
var feature w = v.vin;
62+
63+
feature x = vin;
64+
binding x = vin;
65+
}
6066
feature legalIdentification;
6167

6268
specialization Redef redefinition LegalRecord::guardian redefines parent;
63-
specialization redefinition Vehicle::vin redefines RegisteredAsset::identifier;
69+
specialization redefinition Vehicle::vin redefines RegisteredAsset::identifier;
6470

6571
redefinition Vehicle::vin redefines legalIdentification;
6672
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package Scoping {
2+
package P1 {
3+
class A {
4+
feature f;
5+
}
6+
package P2 {
7+
class A {
8+
feature g;
9+
}
10+
package P3 {
11+
class B :> A {
12+
feature :>> g;
13+
}
14+
}
15+
}
16+
package Objects {
17+
class Object {
18+
feature test1;
19+
}
20+
}
21+
package '$' {
22+
class Objects {
23+
class Object {
24+
feature test2;
25+
}
26+
}
27+
}
28+
package P4 {
29+
class C :> Objects::Object {
30+
feature :>> test1;
31+
}
32+
class D :> '$'::Objects::Object {
33+
feature :>> test2;
34+
}
35+
class E :> $::Objects::Object {
36+
feature :>> subobjects;
37+
}
38+
}
39+
}
40+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package ExtendedOccurrences {
2+
class Interval;
3+
class Moment :> Interval;
4+
class Timeslice {
5+
feature interval : Interval;
6+
:>> self : Timeslice;
7+
}
8+
class Snapshot :> Timeslice {
9+
feature moment :>> interval : Moment;
10+
:>> self : Snapshot;
11+
}
12+
class Life :> Timeslice;
13+
class ExtendedOccurrence :> Life {
14+
:>> timeSlices : Timeslice [1..*];
15+
:>> snapshots :> timeSlices : Snapshot [1..*];
16+
expr at {
17+
:>> that : Timeslice;
18+
in interval : Interval;
19+
return result : Timeslice;
20+
21+
binding result.portionOf = that;
22+
binding result.interval = interval;
23+
}
24+
25+
expr while {
26+
in timeslice : Timeslice;
27+
return result : Timeslice = at(timeslice.interval);
28+
}
29+
30+
var feature activeOccurrences :> Occurrences::occurrences {
31+
connector : Occurrences::HappensDuring from [1] that to [1] self;
32+
}
33+
34+
var feature activeSuboccurrences :> Occurrences::occurrences {
35+
connector : Occurrences::HappensDuring from [1] that to [1] self;
36+
}
37+
38+
// occurrences and performances are abstract package-level features.
39+
// It would be nice to put the variable next to them, but they cannot
40+
// be package-level, or featured by Anything. Nevertheless, since
41+
// Occurrence is a specialization of Anything, it will have these
42+
// features (might be worth redefining them explicitly), so the
43+
// variables can subset them. In the case below, performances will
44+
// contain every step in the occurrence, which is the correct domain
45+
// for the variable.
46+
var feature activePerformances :> Performances::performances {
47+
connector : Occurrences::HappensDuring from [1] that to [1] self;
48+
}
49+
}
50+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package Moments {
2+
private import Occurrences::Life;
3+
private import Occurrences::Occurrence;
4+
5+
class Eternity specializes Life {
6+
// Nothing before/after or outside.
7+
// Could be many of these, see universal below.
8+
redefines predecessors [0];
9+
redefines successors [0];
10+
redefines outsideOfOccurrences [0];
11+
}
12+
13+
class UniversalEternity [1] specializes Eternity {
14+
redefines timeSlices: Period; //Includes life.
15+
redefines snapshots : Moment;
16+
}
17+
18+
feature universalEternity : UniversalEternity [1];
19+
20+
class Period { //Includes life and snapshots.
21+
//↓↓ With UE redef, exactly UE timeslices.
22+
redefines timeSliceOf : UniversalEternity [1];
23+
}
24+
25+
class all InstantOccurrence specializes Occurrence {
26+
// Probly useful elsewhere, eg, to type snapshots.
27+
redefines snapshots [1]; // Or startShot subsets endShot;
28+
} // Or middleTimeslice [0];
29+
30+
class Moment specializes Period, InstantOccurrence {
31+
//↓↓ With UE redef, exactly UE snapshots.
32+
redefines snapshotOf : UniversalEternity [1]; }
33+
34+
private import Occurrence::spaceTimeCoincidentOccurrences;
35+
//UE portion "corresponding" to an occurrence.
36+
feature coincidentUEPortion : Occurrence [1] subsets spaceTimeCoincidentOccurrences,
37+
universalEternity.portions
38+
featured by Occurrence;
39+
}

0 commit comments

Comments
 (0)