Skip to content

Commit

Permalink
Improvements around JNA and build isolation
Browse files Browse the repository at this point in the history
* Specify idea.config.path and idea.system.path for generation.

  If left unspecified, `<generate>` task will write under MPS home and
  this can be problematic in case of multiple builds running from the
  same MPS home in parallel.

* Add an Ant property for the JNA path so that it can be easily
  overridden.

  When running tests from the generic distribution the path has to be
  overridden to point to the platform-specific subdirectory. However, it
  was previously hardcoded to `${artifacts.mps}/lib/jna` and impossible
  to override.
  • Loading branch information
sergej-koscejev committed Jan 26, 2024
1 parent 36d715b commit 33292bb
Show file tree
Hide file tree
Showing 172 changed files with 4,065 additions and 2,978 deletions.
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsEditorTestsPlugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsEditorTestsPlugin" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsEditorTestsPlugin" />
<property name="build.layout" location="${build.dir}/artifacts/mpsEditorTestsPlugin" />
<property name="mps_home" location="${basedir}" />
Expand Down Expand Up @@ -65,6 +68,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsIdeaMigration.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsIdeaMigration" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsIdeaMigration" />
<property name="build.layout" location="${build.dir}/artifacts/mpsIdeaMigration" />
<property name="plugin.version" value="1.1.SNAPSHOT" />
Expand Down Expand Up @@ -89,6 +92,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsIdeaVcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsIdeaVcs" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsIdeaVcs" />
<property name="build.layout" location="${build.dir}/artifacts/mpsIdeaVcs" />
<property name="plugin.version" value="1.1.SNAPSHOT" />
Expand Down Expand Up @@ -101,6 +104,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsJavaIdeaPlugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsJavaIdeaPlugin" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsJavaIdeaPlugin" />
<property name="build.layout" location="${build.dir}/artifacts/mpsJavaIdeaPlugin" />
<property name="mps_home" location="${basedir}" />
Expand Down Expand Up @@ -87,6 +90,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsJpsIdea.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsJpsIdea" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsJpsIdea" />
<property name="build.layout" location="${build.dir}/artifacts/mpsJpsIdea" />
<property name="mps_home" location="${basedir}" />
Expand Down Expand Up @@ -70,6 +73,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsJpsIdeaJ8Compatibility.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsJpsIdeaJ8Compatibility" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsJpsIdeaJ8Compatibility" />
<property name="build.layout" location="${build.dir}/artifacts/mpsJpsIdeaJ8Compatibility" />
<property name="mps_home" location="${basedir}" />
Expand Down Expand Up @@ -74,6 +77,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsPlugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsPlugin" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsPlugin" />
<property name="build.layout" location="${build.dir}/artifacts/mpsPlugin" />
<property name="plugin.version" value="1.1.SNAPSHOT" />
Expand Down Expand Up @@ -96,6 +99,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
5 changes: 5 additions & 0 deletions IdeaPlugin/mpsPluginTests.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsPluginTests" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsPluginTests" />
<property name="build.layout" location="${build.dir}/artifacts/mpsPluginTests" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -127,6 +130,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down
8 changes: 8 additions & 0 deletions build/jetpad.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="jetpad" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/jetpad" />
<property name="build.layout" location="${build.dir}/artifacts/jetpad" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -91,6 +94,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -120,6 +125,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsAntToolsPlugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsAntToolsPlugin" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsAntToolsPlugin" />
<property name="build.layout" location="${build.dir}/artifacts/mpsAntToolsPlugin" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -103,6 +106,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -231,6 +236,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsBootstrapCore.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsBootstrapCore" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsBootstrapCore" />
<property name="build.layout" location="${build.dir}/artifacts/mpsBootstrapCore" />
<property name="version.major" value="2023" />
Expand Down Expand Up @@ -16486,6 +16489,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -16689,6 +16694,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsBuild.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsBuild" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsBuild" />
<property name="build.layout" location="${build.dir}/artifacts/mpsBuild" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -1592,6 +1595,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -1766,6 +1771,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsBuildUI.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsBuildUI" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsBuildUI" />
<property name="build.layout" location="${build.dir}/artifacts/mpsBuildUI" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -334,6 +337,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -484,6 +489,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsConsolePlugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsConsolePlugin" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsConsolePlugin" />
<property name="build.layout" location="${build.dir}/artifacts/mpsConsolePlugin" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -1101,6 +1104,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -1273,6 +1278,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsContextActionsTool.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsContextActionsTool" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsContextActionsTool" />
<property name="build.layout" location="${build.dir}/artifacts/mpsContextActionsTool" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -339,6 +342,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -493,6 +498,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
8 changes: 8 additions & 0 deletions build/mpsCore.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<project name="mpsCore" default="build" basedir="..">
<!-- Generated by MPS -->
<property name="build.dir" location="build" />
<property name="build.mps.config.path" location="${build.dir}/config" />
<property name="build.mps.system.path" location="${build.dir}/system" />
<property name="build.jna.library.path" location="${mps_home}/lib/jna" />
<property name="build.tmp" location="${build.dir}/tmp/mpsCore" />
<property name="build.layout" location="${build.dir}/artifacts/mpsCore" />
<property name="idea_home" location="" />
Expand Down Expand Up @@ -755,6 +758,8 @@
<target name="build" depends="assemble" />

<target name="clean">
<delete dir="${build.mps.config.path}" />
<delete dir="${build.mps.system.path}" />
<delete dir="${build.tmp}" />
<delete dir="${build.layout}" />
</target>
Expand Down Expand Up @@ -911,6 +916,9 @@
<jvmargs>
<arg value="-ea" />
<arg value="-Xmx512m" />
<arg value="-Didea.config.path=${build.mps.config.path}" />
<arg value="-Didea.system.path=${build.mps.system.path}" />
<arg value="-Djna.boot.library.path=${build.jna.library.path}" />
<arg value="--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED" />
</jvmargs>
<macro name="idea_home" path="${idea_home}" />
Expand Down
Loading

0 comments on commit 33292bb

Please sign in to comment.