Coder Social home page Coder Social logo

mbeddr / mps-gradle-plugin Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 15.0 1.11 MB

Miscellaneous tasks that were found useful when building MPS-based projects with Gradle.

License: Other

Groovy 7.22% Perl 18.41% Shell 3.91% Kotlin 49.27% JetBrains MPS 21.19%
build build-tool dmg gradle gradle-plugin jetbrains-mps rcp

mps-gradle-plugin's People

Contributors

abstraktor avatar alexanderpann avatar arimer avatar coolya avatar dbinkele avatar domenikp avatar jensbuehl avatar joao-silveira avatar nkoester avatar ratiud avatar sergej-koscejev avatar slisson avatar wsafonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mps-gradle-plugin's Issues

Allow to configure stage directory for CreateDmg

CreateDmg task uses temporary directory to build the .dmg, and it erases the contents after task finishes.

IntelliJ updater requires two extracted directories to produce a patch, so it would be nice if CreateDmg could keep archive contents (and/or produce it after creating dmg)

allow to detect if GitBasedVersioning is available

Allow to detect if GitBasedVersioning is available so that the build script can decide what to do if it's not available. Like hardcoding the version or not include version parameters that are based on git.

cannot run plugin in headless environment

I want to use this gradle plugin to define code generation for my models as part of a CI job, but I noticed it doesn't work because somehow the MPS which is executed is not completely in headless mode. To showcase the problem, I have created this small project snippet, and as you can see, github's workflow actions are failing with the same error:

> Task :generate
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
initialising environment
Creating IDEA environment
Creating IdeaCmdApplication
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil (file:/home/runner/work/mammad-zargar/mammad-zargar/build/mps/lib/util.jar) to field java.io.DeleteOnExitHook.files
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
generation failed
error generating
java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
	at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
	at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
	at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
	at java.desktop/sun.awt.X11.XToolkit.<clinit>(XToolkit.java:231)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:588)
	at java.desktop/java.awt.Toolkit$2.run(Toolkit.java:583)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/java.awt.Toolkit.getDefaultToolkit(Toolkit.java:582)
	at java.desktop/java.awt.Toolkit.getEventQueue(Toolkit.java:1494)
	at java.desktop/java.awt.EventQueue.isDispatchThread(EventQueue.java:1086)
	at com.intellij.testFramework.TestApplicationManager$Companion$createInstance$2.invoke(TestApplicationManager.kt:120)
	at com.intellij.testFramework.TestApplicationManager$Companion$createInstance$2.invoke(TestApplicationManager.kt:72)
	at com.intellij.SimpleApplicationBootstrapperKt.doLoadApp(simpleApplicationBootstrapper.kt:44)
	at com.intellij.testFramework.TestApplicationManager$Companion.createInstance(TestApplicationManager.kt:119)
	at com.intellij.testFramework.TestApplicationManager$Companion.getInstance(TestApplicationManager.kt:87)
	at com.intellij.testFramework.TestApplicationManager.getInstance(TestApplicationManager.kt)
	at jetbrains.mps.tool.environment.IdeaEnvironment.createIdeaApplication(IdeaEnvironment.java:200)
	at jetbrains.mps.tool.environment.IdeaEnvironment.init(IdeaEnvironment.java:86)
	at de.itemis.mps.gradle.project.loader.LoaderKt.executeWithProject(Loader.kt:109)
	at de.itemis.mps.gradle.project.loader.LoaderKt.executeWithProject(Loader.kt:156)
	at de.itemis.mps.gradle.generate.MainKt$main$1.invoke(Main.kt:24)
	at de.itemis.mps.gradle.generate.MainKt$main$1.invoke(Main.kt)
	at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74)
	at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72)
	at de.itemis.mps.gradle.generate.MainKt.main(Main.kt:18)

Am I missing a configuration here? Any guidance would be appreciated! I'm fine with hotfixes also ๐Ÿ˜„

Null pointer exception on generate

when running the generate task it fails showing a NPE:

Caused by: java.lang.RuntimeException: java.lang.NullPointerException
Problem disposing mps.NodeUsage
        at com.intellij.util.io.PersistentEnumeratorBase.valueOf(PersistentEnumeratorBase.java:489)
        at com.intellij.util.io.PersistentBTreeEnumerator.valueOf(PersistentBTreeEnumerator.java:505)
com.intellij.testFramework.LoggedErrorProcessor$TestLoggerAssertionError: java.io.IOException: java.lang.RuntimeException: java.lang.NullPointerException
        at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
        at com.intellij.util.io.PersistentEnumeratorBase.isKeyAtIndex(PersistentEnumeratorBase.java:410)
        at com.intellij.util.io.PersistentBTreeEnumerator.enumerateImpl(PersistentBTreeEnumerator.java:413)
        at com.intellij.testFramework.TestLogger.error(TestLogger.java:40)
        at com.intellij.util.io.PersistentEnumeratorBase.doEnumerate(PersistentEnumeratorBase.java:294)
        ... 66 more
Caused by: java.lang.NullPointerException
        at com.intellij.openapi.diagnostic.Logger.error(Logger.java:170)
        at jetbrains.mps.util.io.ModelInputStream.readModelID(ModelInputStream.java:187)
        at jetbrains.mps.workbench.findusages.UsageEntry.load(UsageEntry.java:59)
        at com.intellij.util.indexing.impl.MapReduceIndex.dispose(MapReduceIndex.java:186)
        at jetbrains.mps.workbench.findusages.UsageEntryKeyDescriptor.read(UsageEntryKeyDescriptor.java:52)
        at com.intellij.util.indexing.FileBasedIndexImpl.performShutdown(FileBasedIndexImpl.java:531)
        at com.intellij.util.indexing.FileBasedIndexImpl.access$5100(FileBasedIndexImpl.java:107)
        at com.intellij.util.indexing.FileBasedIndexImpl$FileIndexDataInitialization.lambda$prepare$1(FileBasedIndexImpl.java:2469)
        at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:104)
        at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
        at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
        at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:92)
        at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
        at jetbrains.mps.workbench.findusages.UsageEntryKeyDescriptor.read(UsageEntryKeyDescriptor.java:33)
        at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
        at com.intellij.util.io.AppendableStorageBackedByResizableMappedFile.read(AppendableStorageBackedByResizableMappedFile.java:85)
        at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:92)
        at com.intellij.util.io.PersistentEnumeratorBase.valueOf(PersistentEnumeratorBase.java:476)
        at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
        ... 70 more
        at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
        at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:133)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:123)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:119)
        at com.intellij.idea.IdeaTestApplication.disposeInstance(IdeaTestApplication.java:141)
        at com.intellij.idea.IdeaTestApplication.dispose(IdeaTestApplication.java:133)
        at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
        at com.intellij.openapi.util.ObjectTree.executeUnregistered(ObjectTree.java:196)
        at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:127)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:123)
        at com.intellij.openapi.util.Disposer.dispose(Disposer.java:119)
        at jetbrains.mps.tool.environment.IdeaEnvironment$2$2.run(IdeaEnvironment.java:262)
        at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:885)
        at jetbrains.mps.tool.environment.IdeaEnvironment$2.run(IdeaEnvironment.java:259)
        at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
        at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:154)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: com.intellij.util.indexing.StorageException: java.io.IOException: java.lang.RuntimeException: java.lang.NullPointerException
        at com.intellij.util.indexing.impl.MapIndexStorage.unwrapCauseAndRethrow(MapIndexStorage.java:284)
        at com.intellij.util.indexing.impl.MapIndexStorage.close(MapIndexStorage.java:184)
        at com.intellij.util.indexing.VfsAwareMapIndexStorage.close(VfsAwareMapIndexStorage.java:119)
        at com.intellij.util.indexing.MemoryIndexStorage.close(MemoryIndexStorage.java:114)
        at com.intellij.util.indexing.impl.MapReduceIndex.doDispose(MapReduceIndex.java:196)
        at com.intellij.util.indexing.VfsAwareMapReduceIndex.doDispose(VfsAwareMapReduceIndex.java:346)
        at com.intellij.util.indexing.impl.MapReduceIndex.dispose(MapReduceIndex.java:183)
        ... 48 more
Caused by: java.io.IOException: java.lang.RuntimeException: java.lang.NullPointerException
        at com.intellij.util.io.PersistentEnumeratorBase.doEnumerate(PersistentEnumeratorBase.java:304)
        at com.intellij.util.io.PersistentEnumeratorBase.enumerate(PersistentEnumeratorBase.java:317)
        at com.intellij.util.io.PersistentEnumeratorDelegate.enumerate(PersistentEnumeratorDelegate.java:98)
        at com.intellij.util.io.PersistentHashMap.enumerate(PersistentHashMap.java:408)
        at com.intellij.util.io.PersistentHashMap.appendDataWithoutCache(PersistentHashMap.java:446)
        at com.intellij.util.io.PersistentHashMap$4.onDropFromCache(PersistentHashMap.java:255)
        at com.intellij.util.io.PersistentHashMap$4.onDropFromCache(PersistentHashMap.java:246)
        at com.intellij.util.containers.SLRUMap.clear(SLRUMap.java:166)
        at com.intellij.util.io.PersistentHashMap.clearAppenderCaches(PersistentHashMap.java:725)
        at com.intellij.util.io.PersistentHashMap.doForce(PersistentHashMap.java:713)
        at com.intellij.util.io.PersistentHashMap.force(PersistentHashMap.java:705)
        at com.intellij.util.indexing.impl.MapIndexStorage.flush(MapIndexStorage.java:166)
        at com.intellij.util.indexing.VfsAwareMapIndexStorage.flush(VfsAwareMapIndexStorage.java:107)
        at com.intellij.util.indexing.impl.MapIndexStorage.close(MapIndexStorage.java:177)
        ... 53 more
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
        at com.intellij.util.io.PersistentEnumeratorBase.valueOf(PersistentEnumeratorBase.java:489)
        at com.intellij.util.io.PersistentBTreeEnumerator.valueOf(PersistentBTreeEnumerator.java:505)
        at com.intellij.util.io.PersistentEnumeratorBase.isKeyAtIndex(PersistentEnumeratorBase.java:410)
        at com.intellij.util.io.PersistentBTreeEnumerator.enumerateImpl(PersistentBTreeEnumerator.java:413)
        at com.intellij.util.io.PersistentEnumeratorBase.doEnumerate(PersistentEnumeratorBase.java:294)
        ... 66 more
Caused by: java.lang.NullPointerException
        at jetbrains.mps.util.io.ModelInputStream.readModelID(ModelInputStream.java:187)
        at jetbrains.mps.workbench.findusages.UsageEntry.load(UsageEntry.java:59)
        at jetbrains.mps.workbench.findusages.UsageEntryKeyDescriptor.read(UsageEntryKeyDescriptor.java:52)
        at jetbrains.mps.workbench.findusages.UsageEntryKeyDescriptor.read(UsageEntryKeyDescriptor.java:33)
        at com.intellij.util.io.AppendableStorageBackedByResizableMappedFile.read(AppendableStorageBackedByResizableMappedFile.java:85)
        at com.intellij.util.io.PersistentEnumeratorBase.valueOf(PersistentEnumeratorBase.java:476)

I am using MPS 2019.3.1, so I think that the relevant line of ModelInputStream is this: https://github.com/JetBrains/MPS/blob/5ba63e438847f4ec758bf1bf3175eb94de281012/core/kernel/source/jetbrains/mps/util/io/ModelInputStream.java#L187

It seems that PersistenceFacade.getInstance() is null.

This could be perhaps related to a previous error:

PersistentEnumerator storage corrupted /Users/federico/repos/mpsserver/example/build/mps/system/index/mps.nodeusage/mps.NodeUsage.storage
com.intellij.util.io.PersistentEnumeratorBase$CorruptedException: PersistentEnumerator storage corrupted /Users/federico/repos/mpsserver/example/build/mps/system/index/mps.nodeusage/mps.NodeUsage.storage
        at com.intellij.util.io.PersistentEnumeratorBase.<init>(PersistentEnumeratorBase.java:221)
        at com.intellij.util.io.PersistentBTreeEnumerator.<init>(PersistentBTreeEnumerator.java:73)
        at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:47)
        at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:149)
        at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:138)
        at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:129)
        at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:121)
        at com.intellij.util.io.PersistentHashMap.<init>(PersistentHashMap.java:114)
        at com.intellij.util.indexing.impl.ValueContainerMap.<init>(ValueContainerMap.java:38)
        at com.intellij.util.indexing.impl.MapIndexStorage$2.<init>(MapIndexStorage.java:95)
        at com.intellij.util.indexing.impl.MapIndexStorage.initMapAndCache(MapIndexStorage.java:95)
        at com.intellij.util.indexing.VfsAwareMapIndexStorage.initMapAndCache(VfsAwareMapIndexStorage.java:79)
        at com.intellij.util.indexing.VfsAwareMapIndexStorage.<init>(VfsAwareMapIndexStorage.java:74)
        at com.intellij.util.indexing.FileBasedIndexImpl.initIndexStorage(FileBasedIndexImpl.java:393)
        at com.intellij.util.indexing.FileBasedIndexImpl.registerIndexer(FileBasedIndexImpl.java:369)
        at com.intellij.util.indexing.FileBasedIndexImpl.access$5300(FileBasedIndexImpl.java:107)
        at com.intellij.util.indexing.FileBasedIndexImpl$FileIndexDataInitialization.lambda$initAssociatedDataForExtensions$0(FileBasedIndexImpl.java:2448)
        at com.intellij.util.indexing.IndexInfrastructure$DataInitialization.executeNestedInitializationTask(IndexInfrastructure.java:173)
        at com.intellij.util.indexing.IndexInfrastructure$DataInitialization.runParallelNestedInitializationTasks(IndexInfrastructure.java:161)
        at com.intellij.util.indexing.IndexInfrastructure$DataInitialization.call(IndexInfrastructure.java:122)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:222)
        at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
        at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:201)
        at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
        at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:190)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

Consider that I have cleaned everything, including that supposedly corrupted file and I still get this error running the generate task on a fresh checkout

support adding language plugins as dependencies to build script

Hi, I have been trying to automate generating a model using a language I created myself, but it's more complicated than I thought! After some digging I found your useful plugin and now I think I'm very close. I have a couple of questions and a possibly suggested solution!

  • What is the best practice for using generate-models plugin? Is the downloaded MPS supposed to have all the required languages present already (maybe using an internal maven repo hosting the MPS generated from the languages)?

  • If we should use a "clean MPS", then should we use the pluginLocation and plugins to define list of plugins that contain the required languages?

  • If the latter is the way to go, why not define these language plugins through dependencies? (something like this maybe, example usage) if this is approved, I will clean up and create a proper pull request

DownloadJbr does not recognize M1 mac

It seems that the download jbr only looks at the OS "family" and always returns an X64. See in DownloadJbrProjectPlugin:

     Os.isFamily(Os.FAMILY_MAC) -> {
             "com.jetbrains.jdk:jbr:$version:osx-x64@tgz"
     }

It should look at the processor (Intel or M1) and return the M1 jbr in case of an M1 processor.

generic way to publish idea plugins to maven

I would like to have generic way to create maven publication for each idea plugin that I define in a MPS build project.

Each idea plugin that I define in my MPS build solution should automatically become a maven publication and should also include the dependencies defined in MPS as dependencies of the publication. That way publishing large projects with many individual plugins becomes much easier. First example use case could be the mbeddr platform which has a lot of small plugins that make sense to consume individually.

See mbeddr/mbeddr.core#2042

Support IPv6 access

We use a runner that uses only IPv6 and the gradle script can't access the needed repositories.

README is outdated

New groovy classes and gradle tasks were added to the gradle-plugin, but the readme is still explaining only the old usage. Maybe somebody can oupdate the readme, so that it is clear how to use the new gradle-plugins.

Use Matrix Build for supported MPS versions

Right now it's quite cumbersome to maintain multiple MPS versions at the same time, especially since we match strictly against the complete MPS version with the plugins.

At least from a maintenance point of view it should be possible to build the "modelcheck" and "generate-models" plugins against all supported MPS versions in the same build step. Since they are already subprojects we could use gradle composite builds and dependency substitution to do this.

Macro (and potentially other classes) not available in groovy

I was attempting to use the generate task in a groovy build file, and I am unable to set macros, as the Macro class is not available from groovy.

After downloading the repo and building groovy, I decompiled the generated classes and noted it is not in these there either. I'm not sure what the fix is, however I'll just move to Kotlin to avoid this issue myself. (If I get time, I will determine how to fix this)

modelcheck: plugins property processed incorrect

The modelcheck plugin assumes that all custom plugins configured for the plugins property
are placed under a MPS/plugins location which is not required to just load the plugins.
Instead it should be possible to use the absolute path to determine the location of the plugins.

modelcheck {
    plugins = [new Plugin("my.plugin", "my.plugin")]
    ...
}

If the custom plugins are not placed under the relative MPS location,

These changes seem to be wrong: 16bef1e#r42228923

Loading of custom plugins was supported in the following version of this plugin: 1.2.177.46341c0

Add model checking task

A requirement that often pops up from users is the ability to run the model checker from the commandline.

For instance to fail the build and further generation of a project if it contains any model checking errors.

Consider deprecating and removing GenerateLibrariesXml task

The task is used to generate a libraries.xml file with libraries pointing to custom locations, with the possibility to override some of those locations locally.

I think that instead people should simply check libraries.xml into version control. Library paths can contain project-relative paths so library mylib can be added with path $PROJECT_DIR$/build/dependencies/mylib for example, and Gradle can be configured to put the library there.

For the override functionality, one can instead open a different version of mylib in MPS before opening the main project. The override functionality allows one to change the project library path locally to point to ../mylib-development but the added value over just opening it in MPS first seems to be very small.

Reference specific languages plugin in readme

I think we should include a section in to the readme that links to the specificlanguages/mps-gradle-plugin.

I think for many use cases, especially those that don't require running the model check and other customisation it provides a much better user experience. It reliance on convention over configuration makes it much more beginner friendly.
I think 80% of the uses that are currently done with the mbeddr plugin could easily be achieve with the specificlanguages plugin. We should at least point potential users to it before they commit to using this plugin.

In my recent MPS side projects I defaulted to the specificlanguages and in most cases it was easier to use, less build script code to write and allowed me to get my project working in less time.

@sergej-koscejev what do you think does it make sense to refer to your plugin from this plugins readme?

Report model checking results as tests

Currently error reporting for the model checker is pretty limited. Getting the exact model where the check failed is only possible by parsing the log files. It would be much better if we could integrate the model checker with normal test infrastructure like junit to report the failures through junit xml files.

This would allow CI to show the exact models where a check has failed.

One possible implementation could be done with parameterised tests. For instance kotlintest FunSpec or Describe Spec could be used to executed a test for each model that is model checked.

An open questions is how we could get the required information from the gradle plugin into the actual test task. As far as I can see most test frameworks depend on a runner application that hosts the tests and is responsible for test discovery etc. Most probably the current approach by passing the required information via the command line will then no longer work.

Alternatively we could write our own junit xml file that contains the test result and is then used by CI and/or gradle.

Consider publishing the plugin on the gradle portal

Hi, I think this should be relatively easy and make a little bit easier to use the plugin. It is also straightforward, I have already done for two gradle plugins. You just need to register a profile and submit the plugin for approval (normally very quick)

Broken symlink created during bundling

When creating a .dmg file containing the application a broken symlink is still created under

Application/MyAppapp/Contents/bin/*.dylib

To verify this for your application you could just use the following command to find the
broken link:

find . -type l ! -exec test -e {} \; -print

It looks like the following code is always executed. I will add a condition there.

for f in "$CONTENTS/bin"/*.jnilib; do

๐Ÿ’ฃ New changes break the build

Removing:
FileCollection scriptClasspath = project.files()
List<String> scriptArgs

Break all existing project which were using the privious gradle plugin.

Can you please add the removed lines?

Thx

Status of master branch (2.x)

Since the introduction of Use mps-build-backends, I don't see a reason why we should keep 2.x at all. The main reason was to upgrade to Gradle 7 and use lazy properties. 1.x is now also on Gradle 7. This version is rarely used and has completely derailed from 1.x. It is a breaking change if we remove it, and build scripts have to be updated to remove the lazy properties if they want to go back to the 1.x branch to get the newest features. Still, the branch has no value and is barely maintained.

Avoid eager resolving artifact in CreateDmg#jdkDependency

Dependency dep = project.dependencies.create(jdkDependency)
def files = project.configurations.detachedConfiguration(dep).resolve()
if (files.size() != 1) {
throw new GradleException(
"Expected a single file for jdkDependency '$jdkDependency', got ${files.size()} files")
}

Gradle tasks should not perform artifact resolution at the configuration time as the task might even be non-required at all.

Allow project wide script classpath configufation

Right now all tasks that extend the RunAntScript task need to specify the classpath with scriptClasspath which typically includes the ant_lib as well as the path to the tools.jar file.

This is duplicated all over the place when these tasks are declared with the same value. We should have a way to define the default classpath and arguments for all RunAntScript tasks. These defaults are used if now specific values are specified for a task.

ToC for Readme

The readme has grown over the past years, while it's good to have everything in one page it can be hard to find something at times. We should add a ToC at the topic after the "usage" section to allow finding things easier.

GenerateLibrariesXml broken in 1.4

The GenerateLibrariesXml throws an exception in 1.4 if the overrides files does not exist.
It used to work in 1.2

org.gradle.api.tasks.TaskValidationException: A problem was found with the configuration of task ':generateLibrariesXml'.
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.report(ValidatingTaskExecuter.java:72)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
Caused by: org.gradle.api.InvalidUserDataException: File '/Users/xxxxx/projectlibraries.overrides.properties' specified for property 'overrides' does not exist.
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.report(ValidatingTaskExecuter.java:69)
        ... 34 more

Version 3.0

Over the years this plugin has gathered lots of legacy. Parts of the code base still originate from the gradle 5.x era. We have kept lots of the behaviour in-place to ensure backward compatibility. For version 2.0 I think it's time to cut that legacy and not care about breaking changes but try to improve the usage of the plugin.

This issue is used to collect ideas and outline new features we want to add. Feel free to comment your ideas into this issue so that we can discuss them.

Changes planned:

  • Usage of gradle properties in all DSL parts the end users write in their build script
  • Proper configuration phase handling. No more afterEvaluate and dependency resolving during configuration. e.g. gradle help and gradle tasks shall not download anything
  • namespace for the plugins #98
  • removal of "generate project libraries" task #62
  • support for MPS 2021.+ only

Festure ideas:

  • download JBR: switch from maven dependencies to https://cache-redirector.jetbrains.com/intellij-jbr/ also see JBRResolver
  • Rework GitBasedVersioning to handle missing git gracefully. Configuration of the version pattern would be nice as well.
  • User JetBrains Maven repository to download MPS. (would require handling the annoying path problem given that the folder in the zip file always contains the MPS version number)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.