diff --git a/.github/workflows/publish-manuel-stream-symbols.yml b/.github/workflows/publish-manuel-stream-symbols.yml new file mode 100644 index 000000000..07d998495 --- /dev/null +++ b/.github/workflows/publish-manuel-stream-symbols.yml @@ -0,0 +1,41 @@ +name: Manual publish stream-symbols workaround + +on: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: publish-stream-symbols + cancel-in-progress: false + +jobs: + publish: + name: Publish local stream-symbols + runs-on: ubuntu-latest + + steps: + - name: Checkout project sources + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + with: + gradle-version: '7.4' + + - name: Publish stream symbols to Nexus + env: + ORG_GRADLE_PROJECT_nexusUser: ${{ secrets.SE_NEXUS_USER }} + ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.SE_NEXUS_PASSWORD }} + run: | + gradle publishStreamSymbolsToNexus \ + -Pci \ + --build-cache \ + --stacktrace diff --git a/build.gradle b/build.gradle index cfee37492..c82d55497 100644 --- a/build.gradle +++ b/build.gradle @@ -43,3 +43,48 @@ subprojects { evaluationDependsOnChildren() project(":language-server").tasks.generateSysMLv2LanguageServer.dependsOn project(":language").tasks.grammarsJar + +apply plugin: 'maven-publish' + +def streamSymbolsVersion = '7.8.1' +def streamSymbolsJar = file("$rootDir/build/stream-symbols/stream-symbols-${streamSymbolsVersion}.jar") + +tasks.register('validateStreamSymbolsJar') { + inputs.file(streamSymbolsJar) + doLast { + if (!streamSymbolsJar.isFile()) { + throw new GradleException("Missing stream-symbols artifact: ${streamSymbolsJar}") + } + } +} + +publishing { + publications { + streamSymbols(MavenPublication) { + groupId = 'de.monticore' + artifactId = 'stream-symbols' + version = streamSymbolsVersion + artifact(streamSymbolsJar) { + builtBy tasks.named('validateStreamSymbolsJar') + } + pom { + name = 'stream-symbols' + description = 'Stream symbols workaround artifact for the SysML v2 7.8.x release.' + } + } + } + repositories.maven { + name = "Nexus" + credentials.username nexusUser + credentials.password nexusPassword + def releasesRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/monticore-releases/" + def snapshotsRepoUrl = "https://nexus.se.rwth-aachen.de/content/repositories/monticore-snapshots/" + url = streamSymbolsVersion.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + } +} + +tasks.register('publishStreamSymbolsToNexus') { + group = 'publishing' + description = 'Publishes the local stream-symbols 7.8.1 workaround artifact to SE Nexus.' + dependsOn tasks.named('publishStreamSymbolsPublicationToNexusRepository') +} diff --git a/build/stream-symbols/stream-symbols-7.8.1.jar b/build/stream-symbols/stream-symbols-7.8.1.jar new file mode 100644 index 000000000..6a6bc17a1 Binary files /dev/null and b/build/stream-symbols/stream-symbols-7.8.1.jar differ diff --git a/gradle.properties b/gradle.properties index 5847eead5..595e1afe5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ assertj_version = 3.21.0 junit_version = 5.8.2 # Version of published artifacts -version = 7.8.96 +version = 7.8.97 diff --git a/language/build.gradle b/language/build.gradle index 7e7f580de..9572a5128 100644 --- a/language/build.gradle +++ b/language/build.gradle @@ -70,7 +70,7 @@ dependencies { implementation "org.antlr:antlr4-runtime:$antlr_version" implementation "de.monticore:monticore-runtime:$mc_version" implementation "de.monticore:monticore-grammar:$mc_version" - implementation "de.monticore:stream-symbols:$mc_version" + implementation files("$rootDir/build/stream-symbols/stream-symbols-7.8.1.jar") implementation "de.monticore.lang:ocl:$mc_version" implementation "commons-cli:commons-cli:$commons_cli_version" } diff --git a/language/src/main/java/de/monticore/lang/sysmlv2/SysMLv2Tool.java b/language/src/main/java/de/monticore/lang/sysmlv2/SysMLv2Tool.java index 0a0b3057f..046a1cf7f 100644 --- a/language/src/main/java/de/monticore/lang/sysmlv2/SysMLv2Tool.java +++ b/language/src/main/java/de/monticore/lang/sysmlv2/SysMLv2Tool.java @@ -464,6 +464,12 @@ public void run(String[] args) { } } + // Die StreamSymbole werden manuell geladen aus + // 'build/stream-symbols/stream-symbols-7.8.1.jar' und in der + // 'language/build.gradle' Zeile 73 von 'implementation "de + // .monticore:stream-symbols:$mc_version"' auf 'implementation files + // ("$rootDir/build/stream-symbols/stream-symbols-7.8.1.jar")' gesetzt. Das + // muss nach dem fix in monticore rückgängig gemacht werden public static void loadStreamSymbolsFromJar() { URL streamDefUrl = SysMLv2Tool.class.getClassLoader().getResource( "Stream.symtabdefinitionsym");