Skip to content

Commit

Permalink
Added plugin zip build
Browse files Browse the repository at this point in the history
  • Loading branch information
Daron Brison committed Apr 20, 2020
1 parent 9b1048d commit 019982e
Show file tree
Hide file tree
Showing 10 changed files with 309 additions and 155 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,34 @@ This is an experimental project exploring the viability of a visual FLINT editor
3. Run `gradlew initProject`
4. Start the ide for your specific platform. The executables are locatied in `build/mps/bin`

## BUILD
To build the FlintIDE run `gradlew buildFlintIde`. This will generate compressed artifacts in `code/build/artifacts/`.
## Flint IDE
Complete IDE with all required plugins and custom branding.
### Build
To build the FlintIDE run `gradlew buildFlintIde`. This will generate compressed artifacts in `code/build/artifacts/FlintIdeDistribution`.

### Install
To install the IDE unpack the archive for your platform to an empty directory.
Then run executable from the bin directory. If you're using linux you can simply run `gradlew startFlintLinuxIde`.
Then run executable from the bin directory.

## Flint Plugin
MPS IDE, FlintPlugin and dependant plugins must be manually installed.
### Build
To build the FlintIDE run `gradlew buildFlintPlugin`. This will generate a zip in `code/build/artifacts/FlintPluginDistribution/`.

## Using the IDE
### Install
1. Download and install mps from [here](https://www.jetbrains.com/mps/download)
2. Download the [mbeddr platform distribution plugins zip](https://projects.itemis.de/nexus/content/repositories/mbeddr/com/mbeddr/platform/2019.3.22227.6f9f955/platform-2019.3.22227.6f9f955.zip)
3. Extract the files and folders from the com.mbeddr.platform directory in mbeddr platform-distribution.zip file to the plugins folder (`{mps-installation-dir}/plugins`) in your mps installation.
4. Extract the Flint plugin from Flint.zip to the plugins folder in your mps installation.

## Using Flint-mps
1. Click create a new project. Name the project and solution whatever you want.
2. Right click on the solution and create a new model. Name it whatever you like.
3. In the used languages tab select Flint and press OK.
4. Right click on the created model and select `New > FlintModel` or select `Import FlintModel from json`.
5. Create a Flint model. (Tip: Use control space to get suggestions)
6. To view the activity diagram of a fact. Right click on a Fact select Visualize Activity diagram.
7. To preview the generated json right click in the Flint model and select preview generated text. The file is located at `/solutions/{solution-name}/source_gen/{solution-name}/{model-name]/{flint-model-name}.flint.json`.
7. To preview the generated json right click in the Flint model and select preview generated text. The file is located at `{project-location}/solutions/{solution-name}/source_gen/{solution-name}/{model-name]/{flint-model-name}.flint.json`.
8. Right click on the created model and select `New > FlintModelRunner`
9. Configure the runner.
10. To open the Compliance By Design demo generate de model (ctrl + F9), right click on the FlintModelRunner and select Run FlintModel.

## Plugin Description
16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ de.itemis.mps.gradle.Plugin[] getPlugins(xmlFile, pluginslocation) {
generate {
mpsLocation = mpsDir
projectLocation = project("code").projectDir
plugins = getPlugins(new File(project(":code").projectDir, "buildIde.xml"), new File(mpsDir, "plugins"))
plugins = getPlugins(new File(project(":code").projectDir, "buildFlint.xml"), new File(mpsDir, "plugins"))
mpsConfig = configurations.mps
pluginLocation = new File(mpsDir, "plugins")
}
Expand Down Expand Up @@ -258,15 +258,21 @@ task resolveMpsPlugins(type: Copy) {
finalizedBy(copyJavaFxLibs)
}

task buildFlintPlugin(type: de.itemis.mps.gradle.RunAntScript) {
task buildFlint(type: de.itemis.mps.gradle.RunAntScript) {
group "build"
script = file("$rootDir/code/buildIde.xml")
script = file("$rootDir/code/buildFlint.xml")
}

task buildFlintIde(type: de.itemis.mps.gradle.RunAntScript) {
group "build"
dependsOn(buildFlintPlugin)
script = file("$rootDir/code/buildDistribution.xml")
dependsOn(buildFlint)
script = file("$rootDir/code/buildIdeDistribution.xml")
}

task buildFlintPlugin(type: de.itemis.mps.gradle.RunAntScript) {
group "build"
dependsOn(buildFlint)
script = file("$rootDir/code/buildPluginDistribution.xml")
}

task cleanProject(type: Delete) {
Expand Down
9 changes: 5 additions & 4 deletions code/buildIde.xml → code/buildFlint.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<project name="FlintForIde" default="build">
<project name="Flint" default="build">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.tmp" location="${build.dir}/tmp/FlintForIde" />
<property name="build.layout" location="${build.dir}/artifacts/FlintForIde" />
<property name="build.tmp" location="${build.dir}/tmp/Flint" />
<property name="build.layout" location="${build.dir}/artifacts/Flint" />
<tstamp>
<format property="date" pattern="yyyyMMdd" />
</tstamp>
Expand Down Expand Up @@ -230,6 +230,7 @@
<language id="l:d4615e3b-d671-4ba9-af01-2b78369b0ba7:jetbrains.mps.lang.pattern" />
<language id="l:3a13115c-633c-4c5c-bbcc-75c4219e9555:jetbrains.mps.lang.quotation" />
<language id="l:d8f591ec-4d86-4af2-9f92-a9e93c803ffa:jetbrains.mps.lang.scopes" />
<language id="l:13744753-c81f-424a-9c1b-cf8943bf4e86:jetbrains.mps.lang.sharedConcepts" />
<language id="l:7866978e-a0f0-4cc7-81bc-4d213d9375e1:jetbrains.mps.lang.smodel" />
<language id="l:1a8554c4-eb84-43ba-8c34-6f0d90c6e75a:jetbrains.mps.lang.smodel.query" />
<language id="l:c72da2b9-7cce-4447-8389-f407dc1158b7:jetbrains.mps.lang.structure" />
Expand Down Expand Up @@ -596,7 +597,7 @@
<fileset dir="${libs}" />
</copy>
<echo file="${build.layout}/build.number">build.number=${build.number}${line.separator}date=${date}${line.separator}version=1.0</echo>
<echo file="${build.layout}/build.properties">FlintForIde.date=${date}${line.separator}FlintForIde.build.number=${build.number}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}com.mbeddr.platform.major.version=${com.mbeddr.platform.major.version}${line.separator}com.mbeddr.platform.minor.version=${com.mbeddr.platform.minor.version}${line.separator}com.mbeddr.platform.build=${com.mbeddr.platform.build}${line.separator}com.mbeddr.platform.mbeddr.version=${com.mbeddr.platform.mbeddr.version}${line.separator}mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber}</echo>
<echo file="${build.layout}/build.properties">Flint.date=${date}${line.separator}Flint.build.number=${build.number}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}com.mbeddr.platform.major.version=${com.mbeddr.platform.major.version}${line.separator}com.mbeddr.platform.minor.version=${com.mbeddr.platform.minor.version}${line.separator}com.mbeddr.platform.build=${com.mbeddr.platform.build}${line.separator}com.mbeddr.platform.mbeddr.version=${com.mbeddr.platform.mbeddr.version}${line.separator}mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber}</echo>
</target>

<target name="buildDependents" />
Expand Down
56 changes: 28 additions & 28 deletions code/buildDistribution.xml → code/buildIdeDistribution.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<project name="FlintDistribution" default="build">
<project name="FlintIdeDistribution" default="build">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.tmp" location="${build.dir}/tmp/FlintDistribution" />
<property name="build.layout" location="${build.dir}/artifacts/FlintDistribution" />
<property name="build.tmp" location="${build.dir}/tmp/FlintIdeDistribution" />
<property name="build.layout" location="${build.dir}/artifacts/FlintIdeDistribution" />
<property name="mps_home" location="" />
<property name="version" value="1.0" />
<property name="artifacts.FlintForIde" location="${build.dir}/artifacts/FlintForIde" />
<property file="${artifacts.FlintForIde}/build.properties" prefix="import.FlintForIde" />
<property name="FlintForIde.date" value="${import.FlintForIde.FlintForIde.date}" />
<property name="FlintForIde.build.number" value="${import.FlintForIde.FlintForIde.build.number}" />
<property name="mpsBootstrapCore.version" value="${import.FlintForIde.mpsBootstrapCore.version}" />
<property name="com.mbeddr.platform.major.version" value="${import.FlintForIde.com.mbeddr.platform.major.version}" />
<property name="com.mbeddr.platform.minor.version" value="${import.FlintForIde.com.mbeddr.platform.minor.version}" />
<property name="com.mbeddr.platform.build" value="${import.FlintForIde.com.mbeddr.platform.build}" />
<property name="com.mbeddr.platform.mbeddr.version" value="${import.FlintForIde.com.mbeddr.platform.mbeddr.version}" />
<property name="mps.build.number" value="${import.FlintForIde.mps.build.number}" />
<property name="mps.date" value="${import.FlintForIde.mps.date}" />
<property name="mps.build.vcs.number" value="${import.FlintForIde.mps.build.vcs.number}" />
<property name="mps.teamcity.buildConfName" value="${import.FlintForIde.mps.teamcity.buildConfName}" />
<property name="mps.idea.platform.build.number" value="${import.FlintForIde.mps.idea.platform.build.number}" />
<property name="mps.mps.build.counter" value="${import.FlintForIde.mps.mps.build.counter}" />
<property name="de.itemis.mps.extensions.versionNumber" value="${import.FlintForIde.de.itemis.mps.extensions.versionNumber}" />
<property name="artifacts.Flint" location="${build.dir}/artifacts/Flint" />
<property file="${artifacts.Flint}/build.properties" prefix="import.Flint" />
<property name="Flint.date" value="${import.Flint.Flint.date}" />
<property name="Flint.build.number" value="${import.Flint.Flint.build.number}" />
<property name="mpsBootstrapCore.version" value="${import.Flint.mpsBootstrapCore.version}" />
<property name="com.mbeddr.platform.major.version" value="${import.Flint.com.mbeddr.platform.major.version}" />
<property name="com.mbeddr.platform.minor.version" value="${import.Flint.com.mbeddr.platform.minor.version}" />
<property name="com.mbeddr.platform.build" value="${import.Flint.com.mbeddr.platform.build}" />
<property name="com.mbeddr.platform.mbeddr.version" value="${import.Flint.com.mbeddr.platform.mbeddr.version}" />
<property name="mps.build.number" value="${import.Flint.mps.build.number}" />
<property name="mps.date" value="${import.Flint.mps.date}" />
<property name="mps.build.vcs.number" value="${import.Flint.mps.build.vcs.number}" />
<property name="mps.teamcity.buildConfName" value="${import.Flint.mps.teamcity.buildConfName}" />
<property name="mps.idea.platform.build.number" value="${import.Flint.mps.idea.platform.build.number}" />
<property name="mps.mps.build.counter" value="${import.Flint.mps.mps.build.counter}" />
<property name="de.itemis.mps.extensions.versionNumber" value="${import.Flint.de.itemis.mps.extensions.versionNumber}" />

<target name="assemble" depends="fetchDependencies">
<mkdir dir="${build.layout}" />
Expand All @@ -45,8 +45,8 @@
<fixcrlf eol="lf" eof="remove" />
</filterchain>
</copy>
<tar destfile="${build.layout}/Flint-${FlintForIde.build.number}.tar.gz" compression="gzip" longfile="gnu">
<fileset dir="${artifacts.FlintForIde}" />
<tar destfile="${build.layout}/Flint-${Flint.build.number}.tar.gz" compression="gzip" longfile="gnu">
<fileset dir="${artifacts.Flint}" />
<tarfileset dir="${basedir}/../platform-libs" prefix="lib">
<include name="*-linux.jar" />
</tarfileset>
Expand Down Expand Up @@ -77,8 +77,8 @@
<fixcrlf eol="crlf" />
</filterchain>
</copy>
<zip destfile="${build.layout}/Flint-${FlintForIde.build.number}.win.zip">
<fileset dir="${artifacts.FlintForIde}" />
<zip destfile="${build.layout}/Flint-${Flint.build.number}.win.zip">
<fileset dir="${artifacts.Flint}" />
<zipfileset dir="${mps_home}/bin/win" prefix="bin">
<exclude name="**/*.exe" />
<exclude name="**/*.bat" />
Expand All @@ -105,7 +105,7 @@
<replaceregex pattern="\$version\$" replace="${version}" flags="" />
</tokenfilter>
<tokenfilter>
<replaceregex pattern="\$build\$" replace="${FlintForIde.build.number}" flags="" />
<replaceregex pattern="\$build\$" replace="${Flint.build.number}" flags="" />
</tokenfilter>
<fixcrlf eol="lf" eof="remove" />
</filterchain>
Expand All @@ -128,8 +128,8 @@
</filterchain>
<regexpmapper from="flint64.vmoptions" to="flint.vmoptions" />
</copy>
<zip destfile="${build.layout}/Flint-${FlintForIde.build.number}.macos.zip">
<zipfileset dir="${artifacts.FlintForIde}" prefix="Flint ${version}.app/Contents" />
<zip destfile="${build.layout}/Flint-${Flint.build.number}.macos.zip">
<zipfileset dir="${artifacts.Flint}" prefix="Flint ${version}.app/Contents" />
<zipfileset file="${mps_home}/bin/mac/Contents/Resources/mps.icns" prefix="Flint ${version}.app/Contents/Resources" />
<zipfileset dir="${mps_home}/bin/mac" prefix="Flint ${version}.app/Contents/bin" filemode="755">
<exclude name="**/*.dylib" />
Expand All @@ -142,11 +142,11 @@
<zipfileset dir="${build.tmp}/default/Flint-_dl__lbrace_build.number_rbrace_.macos.zip_f7551" filemode="755" prefix="Flint ${version}.app/Contents/bin" />
<fileset dir="${build.tmp}/default/Flint-_dl__lbrace_build.number_rbrace_.macos.zip" />
</zip>
<echo file="${build.layout}/build.properties">FlintDistribution.version=${version}${line.separator}FlintForIde.date=${FlintForIde.date}${line.separator}FlintForIde.build.number=${FlintForIde.build.number}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}com.mbeddr.platform.major.version=${com.mbeddr.platform.major.version}${line.separator}com.mbeddr.platform.minor.version=${com.mbeddr.platform.minor.version}${line.separator}com.mbeddr.platform.build=${com.mbeddr.platform.build}${line.separator}com.mbeddr.platform.mbeddr.version=${com.mbeddr.platform.mbeddr.version}${line.separator}mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber}</echo>
<echo file="${build.layout}/build.properties">FlintIdeDistribution.version=${version}${line.separator}Flint.date=${Flint.date}${line.separator}Flint.build.number=${Flint.build.number}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}com.mbeddr.platform.major.version=${com.mbeddr.platform.major.version}${line.separator}com.mbeddr.platform.minor.version=${com.mbeddr.platform.minor.version}${line.separator}com.mbeddr.platform.build=${com.mbeddr.platform.build}${line.separator}com.mbeddr.platform.mbeddr.version=${com.mbeddr.platform.mbeddr.version}${line.separator}mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber}</echo>
</target>

<target name="buildDependents">
<ant antfile="buildIde.xml" inheritAll="false" useNativeBasedir="true" />
<ant antfile="buildFlint.xml" inheritAll="false" useNativeBasedir="true" />
</target>

<target name="fetchDependencies" />
Expand Down
45 changes: 45 additions & 0 deletions code/buildPluginDistribution.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<project name="FlintPluginDistribution" default="build">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.tmp" location="${build.dir}/tmp/FlintPluginDistribution" />
<property name="build.layout" location="${build.dir}/artifacts/FlintPluginDistribution" />
<property name="mps_home" location="" />
<property name="version" value="1.0" />
<property name="artifacts.Flint" location="${build.dir}/artifacts/Flint" />
<property file="${artifacts.Flint}/build.properties" prefix="import.Flint" />
<property name="Flint.date" value="${import.Flint.Flint.date}" />
<property name="Flint.build.number" value="${import.Flint.Flint.build.number}" />
<property name="mpsBootstrapCore.version" value="${import.Flint.mpsBootstrapCore.version}" />
<property name="com.mbeddr.platform.major.version" value="${import.Flint.com.mbeddr.platform.major.version}" />
<property name="com.mbeddr.platform.minor.version" value="${import.Flint.com.mbeddr.platform.minor.version}" />
<property name="com.mbeddr.platform.build" value="${import.Flint.com.mbeddr.platform.build}" />
<property name="com.mbeddr.platform.mbeddr.version" value="${import.Flint.com.mbeddr.platform.mbeddr.version}" />
<property name="mps.build.number" value="${import.Flint.mps.build.number}" />
<property name="mps.date" value="${import.Flint.mps.date}" />
<property name="mps.build.vcs.number" value="${import.Flint.mps.build.vcs.number}" />
<property name="mps.teamcity.buildConfName" value="${import.Flint.mps.teamcity.buildConfName}" />
<property name="mps.idea.platform.build.number" value="${import.Flint.mps.idea.platform.build.number}" />
<property name="mps.mps.build.counter" value="${import.Flint.mps.mps.build.counter}" />
<property name="de.itemis.mps.extensions.versionNumber" value="${import.Flint.de.itemis.mps.extensions.versionNumber}" />

<target name="assemble" depends="fetchDependencies">
<mkdir dir="${build.layout}" />
<zip destfile="${build.layout}/Flint.zip">
<zipfileset dir="${artifacts.Flint}/plugins/Flint" prefix="Flint" />
</zip>
<echo file="${build.layout}/build.properties">FlintPluginDistribution.version=${version}${line.separator}Flint.date=${Flint.date}${line.separator}Flint.build.number=${Flint.build.number}${line.separator}mpsBootstrapCore.version=${mpsBootstrapCore.version}${line.separator}com.mbeddr.platform.major.version=${com.mbeddr.platform.major.version}${line.separator}com.mbeddr.platform.minor.version=${com.mbeddr.platform.minor.version}${line.separator}com.mbeddr.platform.build=${com.mbeddr.platform.build}${line.separator}com.mbeddr.platform.mbeddr.version=${com.mbeddr.platform.mbeddr.version}${line.separator}mps.build.number=${mps.build.number}${line.separator}mps.date=${mps.date}${line.separator}mps.build.vcs.number=${mps.build.vcs.number}${line.separator}mps.teamcity.buildConfName=${mps.teamcity.buildConfName}${line.separator}mps.idea.platform.build.number=${mps.idea.platform.build.number}${line.separator}mps.mps.build.counter=${mps.mps.build.counter}${line.separator}de.itemis.mps.extensions.versionNumber=${de.itemis.mps.extensions.versionNumber}</echo>
</target>

<target name="buildDependents">
<ant antfile="buildFlint.xml" inheritAll="false" useNativeBasedir="true" />
</target>

<target name="fetchDependencies" />

<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
</project>
Loading

0 comments on commit 019982e

Please sign in to comment.