Dependency on a module not visible from current build project using com.dslfoundry.plaintextgen
'm trying to create a standalone editor for a language I developed.
I used the Wizard, but I received some errors. I could avoid some of them, selecting ALT+ENTER and following Load Required Information from file intention.
The last one, which I cannot remove, is this dependency from the above mentioned plugin. I already tried to optimize imports and bviously I can select it from the build solution as in the image below
I read other similar issues, but I don't seem they are really similar.
How can I add the dependency to the build ? Below the current build.xml:
build MrJEditor generates build.xml
base directory: ../../ [JComponent javax.swing.JButton[,455,46,20x20,alignmentX=0.0,alignmentY=0.5,border=com.intellij.ide.ui.laf.darcula.ui.DarculaButtonPainter@4a87fdc9,flags=296,maximumSize=,minimumSize=,preferredSize=java.awt.Dimension[width=20,height=20],defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=com.intellij.util.ui.JBInsets$JBInsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=...,defaultCapable=true] ]
use plugins:
java
mps
macros:
var date = date yyyyMMdd
var build.number = MrJEditor-171.SNAPSHOT
folder mps_home = ./../../../../Program Files (x86)/JetBrains/MPS 2017.1
dependencies:
mpsStandalone (artifacts location $mps_home)
mpsMakePlugin (artifacts location $mps_home/plugins)
project structure:
idea branding
version
codename MrJEditor
1.0.<no bugfixNr>, eap false
company <no company>
build number ${build.number}, date ${date}
logo splash screen ./icons/splash.png
textcolor 002387
progressColor <no progressColor>
progressX <no progressX>
progressY <no progressY>
progressHeight <no progressHeight>
about screen ./icons/about.png
icons
16x16 ./icons/MPS16.png
32x32 ./icons/MPS32.png
32x32 opaque ./icons/MPS32.png
128x128 <no icon128>
icon <no icon>
icon toolWindow <no iconToolWindow>
names
name MrJEditor
full name MrJEditor
welcome screen ./icons/logo.png
editor background-url default background
plugins <no plugins>
<no updateWebsite>
<no help>
documentation <no documentation>
support <no support>
feedback url <no feedbackUrl>
whats new <no whatsnew>
<no keymap>
third-party <no thirdparty>
custom elements
<< ... >>
<no stats>
idea plugin MrJEditor
name MrJEditor
short (folder) name MrJEditor
description <no description>
version 1.0
<< no vendor >>
content:
MrJEditor
dependencies:
jetbrains.mps.core
<< ... >>
mps group MrJEditor
language MrJEditor
load from ./languages/MrJEditor/MrJEditor.mpl
default layout:
import mpsStandalone::languages
import mpsStandalone::license
folder bin
import files from mpsStandalone::bin
include log.xml
include log4j.dtd
file $mps_home/bin/idea.properties
replace regex ".MPS(\w+)" /g -> .${build.number}
folder lib
import files from mpsStandalone::lib
exclude MPS-src.zip
exclude branding.jar
jar branding.jar
files of idea branding MrJEditor
folder plugins
import mpsStandalone::plugins/cvsIntegration
import //plugins/svn4idea
import //plugins/git4idea
import mpsStandalone::plugins/mps-core
plugin MrJEditor
<empty>
properties file build.number
build.number = ${build.number}
date = ${date}
version = 1.0
<<additional aspects>>
I hope you can help me.
Thank you in advance
Kind Regards
Alessandro
How can I add the dependency to the build ? Below the current build.xml:
build MrJEditor generates build.xml
base directory: ../../ [JComponent javax.
use plugins:
java
mps
macros:
var date = date yyyyMMdd
var build.number = MrJEditor-171.SNAPSHOT
folder mps_home = ./../../../../Program Files (x86)/JetBrains/MPS 2017.1
dependencies:
mpsStandalone (artifacts location $mps_home)
mpsMakePlugin (artifacts location $mps_home/plugins)
project structure:
idea branding
version
codename MrJEditor
1.0.<no bugfixNr>, eap false
company <no company>
build number ${build.number}, date ${date}
logo splash screen ./icons/splash.png
textcolor 002387
progressColor <no progressColor>
progressX <no progressX>
progressY <no progressY>
progressHeight <no progressHeight>
about screen ./icons/about.png
icons
16x16 ./icons/MPS16.png
32x32 ./icons/MPS32.png
32x32 opaque ./icons/MPS32.png
128x128 <no icon128>
icon <no icon>
icon toolWindow <no iconToolWindow>
names
name MrJEditor
full name MrJEditor
welcome screen ./icons/logo.png
editor background-url default background
plugins <no plugins>
<no updateWebsite>
<no help>
documentation <no documentation>
support <no support>
feedback url <no feedbackUrl>
whats new <no whatsnew>
<no keymap>
third-party <no thirdparty>
custom elements
<< ... >>
<no stats>
idea plugin MrJEditor
name MrJEditor
short (folder) name MrJEditor
description <no description>
version 1.0
<< no vendor >>
content:
MrJEditor
dependencies:
jetbrains.mps.core
<< ... >>
mps group MrJEditor
language MrJEditor
load from .
default layout:
import mpsStandalone::languages
import mpsStandalone::license
folder bin
import files from mpsStandalone::bin
include log.xml
include log4j.dtd
file $mps_home/bin/idea.properties
replace regex ".MPS(\w+)" /g -> .${build.number}
folder lib
import files from mpsStandalone::lib
exclude MPS-src.zip
exclude branding.jar
jar branding.jar
files of idea branding MrJEditor
folder plugins
import mpsStandalone:
import //plugins/svn4idea
import //plugins/git4idea
import mpsStandalone:
plugin MrJEditor
<empty>
properties file build.number
build.number = ${build.number}
date = ${date}
version = 1.0
<<additional aspects>>
I hope you can help me.
Thank you in advance
Kind Regards
Alessandro
Please sign in to leave a comment.
Hi Alessandro,
Did you use an MPS build solution to create your build.xml? You can make a build solution by right-clicking your project and then create a Build Solution:
In the build solution model, you have to make a dependency to the com.dslfoundry.plaintextgen.build model, like the one selected below:
Then, if you build the build solution (assuming you have specified all dependencies in your standalone plugin correctly), you should get a
More information on build solutions can be found here: https://confluence.jetbrains.com/display/MPSD30/Build+Language
Hope that helps.
If you solve your problem with this, can you please come back here and tell/post about it?
If you really cannot figure it out, you could make a minimal example on github and post the URL here, then I can have a quick look and tell you what's wrong.
Best regards,
Eugen
Thank you, Eugen, I cannot understand how to get that very dependency.
As you can see from the first image I posted, I can find the language, and now I tried to find the solution (found one similar, not the same one, as in the following screenshot)
In this screenshot there is also the error I get.
I noticed I never posted it before, maybe it can help. I also noticed it seems that event the other solution, the one I made to include OpenNLP, cannot be found: they are on the same row (plaintextgen named at the end of the row, after the other id number).
About OpenNLP I also tried to add it (as in the MrjSolution working in the development environment), as a Model root, but same result.
I also tried just now again from the start (the MrJEditor2.build you can see in the screenshot), but no way. In both cases I started from the wizard of the build solution you suggested, in the first case trying to correct it manually, following the URL, similar to that you inserted in your answer):
https://confluence.jetbrains.com/display/MPSD20171/Build+Language
(I'm using the 2017.1 version, not the old 3.0, but it seems more or less the same, in this section)
I think I'll follow your hint and I'll post a minimal example on Github (but in August, because I have other priorities, now).
Thank you again
Kind Regards
Alessandro
Thanks for the additional info.
I see you added the dependency to plaintextgen on model-level. Did you also add the dependency on solution-level?
You may also want to try the intention "Reload from file" on the part of the model that complains about the dependency not being visible.
Indeed, I think a minimal example will help if we cannot figure it out via screenshots.
Best regards,
Eugen
Well, I admit this is not so clear to me.
Let's try with another pair of screenshots. This shows the tree of languages and solutions and the properties (I merged Common and Dependencies tabs together in the image) at Model level for (language, I think) MrjEditor. However, this is where I develop.
Then I have the sandbox, where I test everything. This are its properties, but I think they should not impact anything (also because sandbox is not part of the build solution, also according to the documentation, is this correct?)
Until this point, no problem.
Then I go and build the solution. I show the properties of the build (after having manually added several items, many just to try and see if something happened).
Ok, I see some dependencies are not yet seen as used, but they are just trials.
I use also many dependencies with stubs on the editor and behavior and I, obviously, use plaintextgen on the generator module.
The build xml is on the first post, so I think that there should be almost all (before github, obviously ;) ).
Thank you for your help and patience and if this is not enough I'll post on github something in the second week of August, as said before
Kind Regards
Alessandro
Hi Eugene and all,
please find a simplified (yet with the same issues) version of my editor I just pushed on github at https://github.com/adepase/MrJEditor .
I hope you may kindly help me better.
Thank you again
Kind Regards
Alessandro
Hi Eugene,
did you have some time to check my editor configuration?
Is there any other information I can give you?
Any idea on how to help me, please?
Thank you in advance
Alessandro
Hi Alessandro,
Whoops, that one somehow slipped my attention, sorry for that.
What version of MPS are you using on the github example you posted?
Best regards,
Eugen
I'm using version 2017.1
Thank you
Kind Regards
Alessandro
Hi Alessandro,
I tried opening it, but it seems you are missing the .mps folder. Could you please add this folder in order for me to be able to open the MPS project?
Thanks!
Best regards,
Eugen
Sorry, not seeing it from MPS, I missed it (never known it was there, indeed ;) ).
I'm not a git user, normally, I performed the add/commit/push from the command line, it seems ok, I hope it is.
Please, let me know if you need other information
Thank you to you
Best regards
Alessandro
Hi Alessandro,
Unfortunately your solution doesn't build.
I see, however already one thing that is not right with respect to the plaintextgen dependency: you added a dependency on solution level (right-click MrJEditor.build and select Module Properties):
and then the dependency is here:
Now you have to do the same on model-level (right-click the build model and press Model properties):
and add it as a dependency:
select plaintextgen:
That should do the trick to add the dependency to the build solution.
Thank you for the hint, but it is not enough. Obviously I opened this issue because it won't build for the reason in the title, but also adding that dependency, doesn't change the final result. Or did it build on your version? On mine, always the same error, always as in the image, even adding that dependency and a number of others for OpenNLP:
Any other ideas?
Thank you anyway...
Best regards
Alessandro
Yes, you are right. Let's fix this thing.
So, I've gone through your project and would do the following to get the fastest results (some things seem unnecessary, but you'll need them in the next step, when you actually start building with ant):
* First, remove plaintextgen from Languages engaged on generation:
* Next, download the plaintextgen artifact, copy it to your project directory (wherever your MrJEditor repo resides on your hard disk) and rename the zip file to com.dslfoundry.plaintextgen.zip.
* Assuming you have already added plaintextgen as a dependency on model level (as shown in an earlier post), add plaintextgen in your dependencies section:
Now go to your language MrJEditor where the error occurs, and execute the "load required information" intention and the "reload modules form disk" intention.
For me, the error is now gone.
Thank you Eugen,
I think we are on the go for the solution, but I yet got an issue and I cannot understand how to bypass it:
I added the zip to the directory (is this, the root folder, the correct place?) and performed the two intentions (I cannot understand if it performs anything, because I got no feedback, but I have to suppose it run them).
As you can see from the above image, something changed: I don't have any more 2 missing dependencies, but only one (and, as far as I understand, it thinks that the missing OpenNLP should be in the zip, which now it can see).
OpenNLP is a solution I use in the project, as you can see, but I don't understand where and how to add it in the build file. I also tried to add the corresponding jar in the root dir of the project as you suggested me for the plaintextgen dependency, but no way (I removed it, it was a last try, but I wasn't convinced, since I explicitly use that solution in my Language, I don't really think the corresponding jar it's a good idea).
Any suggestions about this?
Thank you, as usual
Kind Regards
Alessandro
Hi Alessandro,
I'm glad it helped you further.
In your current setup, the root folder is indeed the right place for the plaintextgen plugin artifact. In principle, if you want to move beyond prototyping and make a setup that will give reproducible builds, you'll obviously need to find a way to manage your artifacts (see this post for some hints: https://mps-support.jetbrains.com/hc/en-us/community/posts/115000555070-Release-and-CI-process-with-MPS).
I guess OpenNLP is a plugin solution containing some external library? It's not properly committed in your repository, so I don't know.
If that is indeed the case, you need to build it as well. Just go to the mps group in your build solution, stand of the end of the group's name (MrJEditor) and press enter. Then enter the OpenNLP solution in the "load from":
After that, execute the intention to reload required information:
I've not done it exactly like this, but I am guessing that this will work and be the shortest path to a building project right now.
Best regards,
Eugen
Yes, Eugen, you're right, the solution is a sort of wrapper for an external library (stubs starting from a .jar).
And I think you almost resolved all my compilation issues (I really could not found a corresponding example, I hope this can help others too).
Almost, because I got a further error:
So I went to the corresponding flag (I hope it means it is correct), but it is set (I think it means true):
I also tried changing the Solution Kind, (tried them all, then rolled back to None, as in the image), repeating the intent actions each time, but nothing.
Checking the OpenNLP solution it says no problems. Trying to rebuild it results in a "Rebuild aborted: nothing to do".
I just found a similar issue googling, but it was due to a missing jar, which is not my case.
Do you know if I have to move the library under some directory in the project and generate again the solution? Or what else?
I really hope this is the last time I need to write to you (even if you are so patient and helpful :) )
Thank you
Best regards
Alessandro