Skip to content

Commit

Permalink
Merge pull request #1 from coolya/release
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
coolya authored Mar 30, 2018
2 parents b7d6c7a + 2f4a64e commit 3f94699
Show file tree
Hide file tree
Showing 15 changed files with 1,099 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@ cache:

build:
stage: build
artifacts:
expire_in: 1 week
paths:
- artifacts/de.itemis.mps.generator.editors
script:
- ./gradlew build

release:
stage: deploy
script:
- ./gradlew githubRelease
only:
- master
1 change: 1 addition & 0 deletions .mps/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<projectModules>
<modulePath path="$PROJECT_DIR$/languages/de.itemis.mps.generator.editors/de.itemis.mps.generator.editors.mpl" folder="" />
<modulePath path="$PROJECT_DIR$/solutions/de.itemis.mps.generartor.editors.build/de.itemis.mps.generartor.editors.build.msd" folder="_build" />
<modulePath path="$PROJECT_DIR$/solutions/de.itemis.mps.generator.editors.plugin/de.itemis.mps.generator.editors.plugin.msd" folder="" />
<modulePath path="$PROJECT_DIR$/solutions/de.itemis.mps.generators.editors.build.meta/de.itemis.mps.generators.editors.build.meta.msd" folder="_build" />
</projectModules>
</component>
Expand Down
6 changes: 6 additions & 0 deletions .mps/vcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# MPS Generator Editors

[![build status](https://gitlab.com/coolya/mps-generator-editors/badges/master/pipeline.svg)](https://gitlab.com/coolya/mps-generator-editors/commits/master)

This projects aims to provide a set of editors for the MPS generator language that allow easier readability of the code
by showing certain aspects that are usually hidden in the inspects in the main editor.


![comparison](docs/generator_comparison.jpg)

## State
Currently this is more less a quick hack to see if it technically works. The editor experience is pretty bad at the
moment. Especially when writing new generators while using the normal intentions to create the required macros. I would
currently consider this more or less a read only view on the generator. You can change existing values but if you hit
`return` or `backspace` at the wrong location the editor will behave extremely strange.

## Installation
Head over to the release page and pick the latest release. If you are already using the the mps-extensions or a recent
version of the mbeddr platform then download the zip file without `with-dependencies` otherwise download the one with
the `with-dependencies` suffix.

To make the plugin available, extract the zip file to a location of your choice and the point a global library in MPS to
it. `File -> Settings -> Build, Execution, Deployment -> Global Libraries`.

![global lib](docs/global_lib.png)

## How To
Using this plugin is simple: click on the `View` menu and the select `Simplified Generator Editors`.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### New in 0.1
* Initial release

24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ buildscript {

plugins {
id "nebula.dependency-lock" version "4.9.5"
id "co.riiid.gradle" version "0.4.2"
}

apply plugin: 'base'
Expand All @@ -32,6 +33,8 @@ ext.dependencyRepositories = [
'https://projects.itemis.de/nexus/content/repositories/mbeddr_snapshots'
]

def version = "0.1"

repositories {
for (repoUrl in project.dependencyRepositories) {
maven {
Expand Down Expand Up @@ -70,7 +73,7 @@ dependencies {
}

ext.buildScriptClasspath = project.configurations.ant_lib.fileCollection({ true })
ext.defaultScriptArgs = ["-Dversion=$version"]
ext.defaultScriptArgs = ["-Dversion=$version", "-Dartifacts.root=${ext.artifactsDir.getAbsolutePath()}", "-Dbuild.dir=${rootProject.projectDir.absolutePath}"]


task resolveMps(type: Copy) {
Expand Down Expand Up @@ -118,4 +121,21 @@ task build_languages(type: BuildLanguages, dependsOn: allScripts) {
script scriptFile('build-all.xml')
}

build.dependsOn build_languages
def releaseArtifacts = new File(artifactsDir, "de.itemis.mps.generator.editors")
.listFiles()
.findAll {it.name.endsWith("zip")}
.each {it.absolutePath}

github {
owner = 'coolya'
repo = 'mps-generator-editors'
token = System.getenv().GITHUB_TOKEN != null ? System.getenv().GITHUB_TOKEN : "empty"
tagName = "v-$version"
targetCommitish = System.getenv().CI_COMMIT_SHA != null ? System.getenv().CI_COMMIT_SHA : "master"
name = "MPS Generator Editors $version"
body = ReleaseNotes.getReleaseNotes(file("RELEASE_NOTES.md"))
assets = releaseArtifacts
}

build.dependsOn build_languages
//githubRelease.dependsOn build
23 changes: 23 additions & 0 deletions buildSrc/src/main/groovy/ReleaseNotes.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class ReleaseNotes {
static String getReleaseNotes(File file) {

Closure isHeader = {it.startsWith("##")}

List<String> content = file
.readLines()
.each { it.trim().replaceFirst("\\*", "")}
.findAll {!it.empty}


for (int i = 0; i < content.size(); i++) {
String it = content.get(i)
if (isHeader(it)) {
def rest = content.subList(i + 1, content.size)
def notes = rest.takeWhile {!isHeader(it)}
notes.add(0, it)
return notes.join("\r\n")
}
}
return ""
}
}
Binary file added docs/generator_comparison.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/global_lib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<dependency reexport="false">f3061a53-9226-4cc5-a443-f952ceaf5816(jetbrains.mps.baseLanguage)</dependency>
</dependencies>
<languageVersions>
<language slang="l:a0ab8c10-c118-4755-ba27-3853435cf524:de.itemis.mps.tooltips" version="0" />
<language slang="l:b8bb702e-43ed-4090-a902-d180d3e5f292:de.slisson.mps.conditionalEditor" version="0" />
<language slang="l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage" version="5" />
<language slang="l:443f4c36-fcf5-4eb6-9500-8d06ed259e3e:jetbrains.mps.baseLanguage.classifiers" version="0" />
Expand Down
Loading

0 comments on commit 3f94699

Please sign in to comment.