From 9d8108fe9bc45287c508d4a7ca7351eabfa1f8ff Mon Sep 17 00:00:00 2001 From: Flo Drux Date: Tue, 12 Sep 2023 12:01:42 +0200 Subject: [PATCH] genEMF --- .gitlab-ci.yml | 14 +++---- build.gradle | 96 +++++++++++++++++++++++------------------------ gradle.properties | 1 + settings.gradle | 11 ++++-- 4 files changed, 63 insertions(+), 59 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 67a8df71f9..f81b9d0929 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ build: stage: build script: - "cd monticore-generator && gradle build $GRADLE_OPTS -Pci -i" - - "cd .. && gradle buildMC $GRADLE_OPTS -Pci -PgenTR=true -i" + - "cd .. && gradle buildMC $GRADLE_OPTS -Pci -PgenTR=true -PgenEMF=true -i" artifacts: paths: - ".gradle" @@ -69,7 +69,7 @@ test_01experiments: dependencies: - build script: - - "gradle -p monticore-test/01.experiments build $GRADLE_OPTS -Pci" + - "gradle -p monticore-test/01.experiments build $GRADLE_OPTS -PgenEMF=true -Pci" only: - merge_requests - branches @@ -81,7 +81,7 @@ test_02experiments: dependencies: - build script: - - "gradle -p monticore-test/02.experiments build $GRADLE_OPTS -Pci" + - "gradle -p monticore-test/02.experiments build $GRADLE_OPTS -PgenEMF=true -Pci" only: - merge_requests - branches @@ -109,7 +109,7 @@ test_it_emf: dependencies: - build script: - - "gradle -p monticore-test/it build -PbuildProfile=emf $GRADLE_OPTS -Pci" + - "gradle -p monticore-test/it build -PbuildProfile=emf -PgenEMF=true $GRADLE_OPTS -Pci" only: - merge_requests - branches @@ -121,7 +121,7 @@ test_grammar_it: dependencies: - build script: - - "gradle -p monticore-test/monticore-grammar-it build $GRADLE_OPTS -Pci" + - "gradle -p monticore-test/monticore-grammar-it build -PgenEMF=true $GRADLE_OPTS -Pci" only: - merge_requests - branches @@ -133,7 +133,7 @@ test_montitrans: dependencies: - build script: - - "gradle -p monticore-test/montitrans build $GRADLE_OPTS -PgenTR=true -Pci" + - "gradle -p monticore-test/montitrans build $GRADLE_OPTS -PgenTR=true -PgenEMF=true -Pci" only: - merge_requests - branches @@ -145,7 +145,7 @@ deploy: dependencies: - build script: - - "gradle deployMC -PmavenPassword=$password -PmavenUser=$username $GRADLE_OPTS -PgenTR=true -Pci" + - "gradle deployMC -PmavenPassword=$password -PmavenUser=$username $GRADLE_OPTS -PgenTR=true -PgenEMF=true -Pci" only: - dev except: diff --git a/build.gradle b/build.gradle index 58c63423c3..ecce98736d 100644 --- a/build.gradle +++ b/build.gradle @@ -112,13 +112,12 @@ subprojects { task buildMC { group("build") description('Builds the core projects, i.e. the generator, runtime and grammar library.') - dependsOn( - ":monticore-grammar:build", - ":monticore-runtime:build", - ":monticore-runtime-emf:build", - ":monticore-grammar-emf:build" - - ) + dependsOn ":monticore-grammar:build" + dependsOn ":monticore-runtime:build" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:build" + dependsOn ":monticore-grammar-emf:build" + } } if(!hasProperty('bootstrap')) { @@ -132,14 +131,12 @@ if(!hasProperty('bootstrap')) { task assembleMC { group("build") description('Assembles the core projects, i.e. the generator, runtime and grammar library.') - - dependsOn( - ":monticore-grammar:assemble", - ":monticore-runtime:assemble", - ":monticore-runtime-emf:assemble", - ":monticore-grammar-emf:assemble" - - ) + dependsOn ":monticore-grammar:assemble" + dependsOn ":monticore-runtime:assemble" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:assemble" + dependsOn ":monticore-grammar-emf:assemble" + } } if(!hasProperty('bootstrap')) { assembleMC.dependsOn(gradle.includedBuilds*.task(':assemble')) @@ -151,14 +148,13 @@ if(!hasProperty('bootstrap')) { task testMC { group("build") description('Tests the core projects, i.e. the generator, runtime and grammar library.') - - dependsOn( - ":monticore-grammar:test", - ":monticore-runtime:test", - ":monticore-runtime-emf:test", - ":monticore-grammar-emf:test" - - ) + + dependsOn ":monticore-grammar:test" + dependsOn ":monticore-runtime:test" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:test" + dependsOn ":monticore-grammar-emf:test" + } } if(!hasProperty('bootstrap')) { @@ -173,14 +169,14 @@ if(!hasProperty('bootstrap')) { task deployMC { group("build") description('Publishes the core projects, i.e. the generator, runtime and grammar library.') - - dependsOn( - ":monticore-grammar:publish", - ":monticore-runtime:publish", - ":monticore-runtime-emf:publish", - ":monticore-grammar-emf:publish" - - ) + + dependsOn ":monticore-grammar:publish" + dependsOn ":monticore-runtime:publish" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:publish" + dependsOn ":monticore-grammar-emf:publish" + } + } if(!hasProperty('bootstrap')) { @@ -196,12 +192,12 @@ task publishMCToMavenLocal { group("build") description('Publishes the core projects, i.e. the generator, runtime and grammar library' + 'to the local maven repository.') - dependsOn( - ":monticore-grammar:publishToMavenLocal", - ":monticore-runtime:publishToMavenLocal", - ":monticore-runtime-emf:publishToMavenLocal", - ":monticore-grammar-emf:publishToMavenLocal" - ) + dependsOn ":monticore-grammar:publishToMavenLocal" + dependsOn ":monticore-runtime:publishToMavenLocal" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:publishToMavenLocal" + dependsOn ":monticore-grammar-emf:publishToMavenLocal" + } } if(!hasProperty('bootstrap')) { @@ -231,13 +227,12 @@ task buildAll(type: GradleBuild) { } task cleanMC { - dependsOn( - ":monticore-grammar:clean", - ":monticore-runtime:clean", - ":monticore-runtime-emf:clean", - ":monticore-grammar-emf:clean" - - ) + dependsOn ":monticore-grammar:clean" + dependsOn ":monticore-runtime:clean" + if(("true").equals(getProperty('genEMF'))) { + dependsOn ":monticore-runtime-emf:clean" + dependsOn ":monticore-grammar-emf:clean" + } } if (!hasProperty('bootstrap')) { @@ -256,11 +251,14 @@ task sonarMC (type: GradleBuild) { tasks = [ 'jacocoMergeSubprojects', 'sonarqube' ] } - -configure([project(':monticore-grammar'), - project(':monticore-grammar-emf'), - project(':monticore-runtime'), - project(':monticore-runtime-emf')]){ +def projectsToConfigure = [ + project(':monticore-grammar'), + project(':monticore-runtime')] +if(("true").equals(getProperty('genEMF'))) { + projectsToConfigure << project(':monticore-grammar-emf') + projectsToConfigure << project(':monticore-runtime-emf') +} +configure(projectsToConfigure){ apply plugin: 'maven-publish' // configure deployment diff --git a/gradle.properties b/gradle.properties index 19845b5b5a..fb6659f75c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,7 @@ useLocalRepo=false # set true or use –PshowTestOutput=true to print test output showTestOutput=false genTR=false +genEMF=false org.gradle.jvmargs=-Xms3072m -Dfile.encoding=UTF-8 diff --git a/settings.gradle b/settings.gradle index 072b1fa9ef..505dd961c8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -52,8 +52,10 @@ if(!hasProperty('bootstrap')) { include(':monticore-runtime') include(':monticore-grammar') -include(':monticore-runtime-emf') -include(':monticore-grammar-emf') +if(("true").equals(getProperty('genEMF'))) { + include(':monticore-runtime-emf') + include(':monticore-grammar-emf') +} if(!hasProperty('bootstrap')) { include(':monticore-test:monticore-grammar-it') @@ -71,7 +73,6 @@ if(!hasProperty('bootstrap')) { include(':monticore-test:01experiments:extensionvariants') include(':monticore-test:01experiments:forAst') include(':monticore-test:01experiments:forConcSt') - include(':monticore-test:01experiments:forEmfAst') include(':monticore-test:01experiments:forMill') include(':monticore-test:01experiments:forParser') include(':monticore-test:01experiments:forVisitors') @@ -125,6 +126,10 @@ if(!hasProperty('bootstrap')) { include(':monticore-test:montitrans:test-generated-dstls') } + if ("true".equals(getProperty('genEMF'))) { // Only test EMF if the flag is set + include(':monticore-test:01experiments:forEmfAst') + } + // include 'example' // project(':example').projectDir = file("monticore-test/example") } \ No newline at end of file