有没有办法通过Gradle使用mps-extensions?

时间:2018-11-05 12:05:11

标签: mps

我看到https://github.com/JetBrains/MPS-extensions通过GitHub发布版本,但是将工件集成到基于MPS的项目中看起来并不方便。

如果我的项目是通过MPS构建的,并且取决于MPS扩展,该怎么办?如果有一种方法可以通过命令行(例如./gradlew downloadExtensions)自动下载适当的扩展程序工件,那将是很好的选择

1 个答案:

答案 0 :(得分:1)

以下对我有用:

<Style x:Key="TextBoxHeight1" TargetType="{x:Type TextBox}" > <Setter Property="Height" Value="20"/> <Style.Resources> <Style TargetType="{x:Type Border}"> <Setter Property="CornerRadius" Value="10"/> </Style> </Style.Resources> </Style> (请参阅https://github.com/Hardella/ide61131/blob/8088fbd9bcc2780f5772856a962fbfe6954b3e50/build.gradle):

include (GetPrerequisites)
get_prerequisites(${lib} dependencies 1 1 "" "")

然后build.gradle下载repositories { maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' } mavenCentral() } configurations { mpsExtensions } dependencies { mpsExtensions "de.itemis.mps:extensions:2018.2.+" } task resolve_extensions(type: Copy) { dependsOn configurations.mpsExtensions from { configurations.mpsExtensions.resolve().collect { zipTree(it) } } into "lib" } 并将其解压缩到./gradlew resolve_extensions文件夹中。

然后可以通过mps-extensions-> lib/de.itemis.mps.extensions/...-> MPS / Preferences将其插入Build, Execution, Deployment实例。

以下Project Libraries将库配置为Global Libraries

.mps/libraries.xml