Skip to content

Commit 4ac18b5

Browse files
authored
Merge pull request #1 from DSLFoundry/hit-your-head-on-the-keyboard
migrate testsupport language
2 parents 2529605 + 8ee8b9e commit 4ac18b5

28 files changed

+4529
-7
lines changed

.github/workflows/gradle.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
workflow_dispatch:
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK 11
21+
uses: actions/setup-java@v1
22+
with:
23+
java-version: 11
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
- name: Build with Gradle
27+
run: ./gradlew buildLanguages
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Publish to GitHub Maven Packages with Gradle
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 11
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
- name: Publish with Gradle
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
./gradlew publish

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release to Github
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/[email protected]
16+
- name: Set up JDK 11
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
- name: Grant execute permission for gradlew
21+
run: chmod +x gradlew
22+
- name: release to github with gradle
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
CI_COMMIT_SHA: ${{ env.GITHUB_SHA }}
26+
run: ./gradlew githubRelease
27+

.gitignore

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,68 @@
1+
# -----------------------------------------------------------
2+
# General
3+
# -----------------------------------------------------------
4+
.ant_targets
5+
.DS_Store
6+
.metadata
7+
.svn
8+
build/
9+
/artifacts/
10+
/tmp/
11+
cell-screenshots/
12+
# -----------------------------------------------------------
13+
# Model Checking Results
14+
# -----------------------------------------------------------
15+
*.csv
16+
17+
# -----------------------------------------------------------
18+
# Latex
19+
# -----------------------------------------------------------
20+
*.synctex.gz
21+
*.aux
22+
*.log
23+
*.*.synctex.gz
24+
*.*.aux
25+
*.*.log
26+
27+
# -----------------------------------------------------------
28+
# IDEA
29+
# -----------------------------------------------------------
30+
.idea
131
workspace.xml
32+
33+
# -----------------------------------------------------------
34+
# JUNIT
35+
# -----------------------------------------------------------
236
junitvmwatcher*.properties
337
build.properties
38+
TEST-*.xml
39+
junit*.properties
440

5-
# generated java classes and java source files
6-
# manually add any custom artifacts that can't be generated from the models
7-
# http://confluence.jetbrains.com/display/MPSD25/HowTo+--+MPS+and+Git
41+
# -----------------------------------------------------------
42+
# MPS
43+
# -----------------------------------------------------------
844
classes_gen
945
source_gen
1046
source_gen.caches
11-
12-
# generated test code and test results
1347
test_gen
1448
test_gen.caches
15-
TEST-*.xml
16-
junit*.properties
49+
code/languages/*/*.iws
50+
code/languages/*/build.properties
51+
code/languages/*/TEST*.xml
52+
code/languages/org.iets3.core/build/tmp
53+
code/languages/org.iets3.opensource/.mps/libraries.xml
54+
55+
# -----------------------------------------------------------
56+
# GRADLE
57+
# -----------------------------------------------------------
58+
.gradle/
59+
60+
# -----------------------------------------------------------
61+
# Auto-generated icons
62+
# -----------------------------------------------------------
63+
*CharIcon.png
64+
projectlibraries.overrides.properties
65+
66+
# Test results
67+
TESTS-*.xml
68+
/system/

.mps/migration.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project version="4">
3+
<component name="MigrationProperties">
4+
<entry key="jetbrains.mps.ide.mpsmigration.v_2019_3.DefaultFacetExplicitPersistence" value="executed" />
5+
</component>
6+
</project>

.mps/modules.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project version="4">
3+
<component name="MPSProject">
4+
<projectModules>
5+
<modulePath path="$PROJECT_DIR$/languages/com.dslfoundry.testsupport/com.dslfoundry.testsupport.mpl" folder="" />
6+
<modulePath path="$PROJECT_DIR$/solutions/com.dslfoundry.testsupport.build/com.dslfoundry.testsupport.build.msd" folder="" />
7+
<modulePath path="$PROJECT_DIR$/solutions/com.dslfoundry.testsupport.buildAllScripts/com.dslfoundry.testsupport.buildAllScripts.msd" folder="" />
8+
</projectModules>
9+
</component>
10+
</project>

.mps/vcs.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project version="4">
3+
<component name="VcsDirectoryMappings">
4+
<mapping directory="$PROJECT_DIR$" vcs="Git" />
5+
</component>
6+
</project>

build.gradle

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
import de.itemis.mps.gradle.*
2+
3+
import java.time.LocalDate
4+
import java.time.format.DateTimeFormatter
5+
import java.time.format.FormatStyle
6+
7+
//will pull the groovy classes/types from nexus to the classpath
8+
buildscript {
9+
repositories {
10+
mavenCentral()
11+
maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }
12+
}
13+
dependencies {
14+
classpath 'de.itemis.mps:mps-gradle-plugin:1.2.175.cc60dc8'
15+
}
16+
}
17+
18+
plugins {
19+
id 'base'
20+
id 'maven-publish'
21+
id "co.riiid.gradle" version "0.4.2"
22+
}
23+
24+
def incrementalBuild = !project.hasProperty("disableIncrementalBuild")
25+
def artifactsDir = new File(buildDir, 'artifacts')
26+
27+
28+
configurations {
29+
mps
30+
languageLibs
31+
junitAnt
32+
}
33+
34+
dependencies {
35+
mps "com.jetbrains:mps:2020.1.+"
36+
languageLibs "com.mbeddr:mbeddr:2020.1.+"
37+
junitAnt 'org.apache.ant:ant-junit:1.10.6'
38+
}
39+
40+
repositories {
41+
maven {
42+
url "https://projects.itemis.de/nexus/content/repositories/mbeddr"
43+
}
44+
45+
mavenCentral()
46+
}
47+
48+
task resolveMps(type: Copy) {
49+
dependsOn configurations.mps
50+
from {
51+
configurations.mps.resolve().collect { zipTree(it) }
52+
}
53+
into "$buildDir/mps"
54+
}
55+
56+
task resolveAllLanguageLibs(type: Copy) {
57+
from {
58+
configurations.languageLibs.resolve().collect { zipTree(it) }
59+
}
60+
into "$buildDir/dependencies"
61+
}
62+
63+
def testsupportVersion = project.findProperty("testsupportVersion") ?: '0.1'
64+
65+
// Default arguments for ant scripts
66+
def defaultScriptArgs = [
67+
'mps.home' : resolveMps.destinationDir,
68+
'testsupport.home' : projectDir,
69+
'build.dir' : buildDir,
70+
'mps.generator.skipUnmodifiedModels': incrementalBuild,
71+
'version' : testsupportVersion,
72+
'testsupport.version' : testsupportVersion,
73+
]
74+
def defaultScriptClasspath = project.configurations.junitAnt.fileCollection { true }
75+
76+
// enables https://github.com/mbeddr/mps-gradle-plugin#providing-global-defaults
77+
ext["itemis.mps.gradle.ant.defaultScriptArgs"] = defaultScriptArgs.collect { "-D$it.key=$it.value".toString() }
78+
ext["itemis.mps.gradle.ant.defaultScriptClasspath"] = defaultScriptClasspath
79+
80+
81+
task buildAllScripts(type: BuildLanguages, dependsOn: [resolveMps, resolveAllLanguageLibs]) {
82+
script "scripts/allScripts.xml"
83+
}
84+
85+
task buildLanguages(type: BuildLanguages, dependsOn: buildAllScripts) {
86+
script "$buildDir/languageBuild.xml"
87+
}
88+
89+
task packageLanguages(type: Zip, dependsOn: buildLanguages) {
90+
archiveBaseName = 'com.dslfoundry.testsupport'
91+
from artifactsDir
92+
include 'com.dslfoundry.testsupport/**'
93+
}
94+
95+
task setup {
96+
dependsOn resolveAllLanguageLibs
97+
description 'Set up MPS project libraries. Libraries are read in from projectlibraries.properties file.'
98+
}
99+
100+
101+
def releaseArtifacts = ["${artifactsDir}/com.dslfoundry.testsupport/com.dslfoundry.testsupport-${testsupportVersion}.zip"]
102+
103+
github {
104+
owner = 'DSLFoundry'
105+
repo = 'mps-testsupport'
106+
token = System.getenv().GITHUB_TOKEN != null ? System.getenv().GITHUB_TOKEN : "empty"
107+
tagName = "v-$testsupportVersion"
108+
targetCommitish = System.getenv().CI_COMMIT_SHA != null ? System.getenv().CI_COMMIT_SHA : "master"
109+
name = "Fixes for MPS XML Language v$testsupportVersion"
110+
assets = releaseArtifacts
111+
// body = ReleaseNotes.getReleaseNotes(file("RELEASE_NOTES.md"))
112+
}
113+
114+
publishing {
115+
repositories {
116+
maven {
117+
name = "GitHubPackages"
118+
url = uri("https://maven.pkg.github.com/DSLFoundry/mps-testsupport")
119+
credentials {
120+
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
121+
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
122+
}
123+
}
124+
}
125+
126+
publications {
127+
gpr(MavenPublication) {
128+
groupId = 'com.dslfoundry.testsupport'
129+
artifactId = 'testsupport'
130+
version = "$testsupportVersion"
131+
132+
artifacts = releaseArtifacts
133+
pom {
134+
name = "Fixes for MPS XML Language"
135+
url = "https://github.com/DSLFoundry/mps-testsupport"
136+
}
137+
}
138+
}
139+
}
140+
141+
build.dependsOn buildLanguages
142+
githubRelease.dependsOn build
143+
144+
defaultTasks 'buildLanguages'
145+
146+
publish.dependsOn build

0 commit comments

Comments
 (0)