Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider deprecating and removing GenerateLibrariesXml task #62

Open
sergej-koscejev opened this issue Apr 21, 2020 · 9 comments
Open

Comments

@sergej-koscejev
Copy link
Member

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.

@vlsi
Copy link

vlsi commented Jul 16, 2020

@sergej-koscejev , how about the following:

  1. User adds a Gradle configuration for the libraries
  2. User adds dependencies to the configuration
val mpsPlugins by configurations.creating { ... }

dependencies {
    mpsPlugins("de.itemis.mps:extensions:$mpsExtensionsVersion")
    mpsPlugins("com.mbeddr:platform:$mbeddrBuildNumber")
}
  1. Then GenerateLibrariesXml resolves the configuration, copies the libraries to build/.. and generates (or even updates) libraries.xml with the proper location of the libraries.

I guess it would help to keep the library declarations in a single place.

On top of that, mps-gradle-plugin could declare a default configuration for MPS libraries. For instance mpsLibraries.
Then user could just add the dependencies, and generateXmlLibraries would update .mps/libraries.xml

WDYT?

@sergej-koscejev
Copy link
Member Author

@vlsi I think that generating this file doesn't save that much work, in my experience the set of used libraries doesn't change as much. If it does change often for you then you can add a parent directory such as build/dependencies as a project library and have multiple libraries inside that directory, MPS will find them. Adding each library separately is not really necessary.

@vlsi
Copy link

vlsi commented Oct 19, 2020

I think that generating this file doesn't save that much work

Well, the dependencies still have to be received and unpacked to a folder, don't they?
So it looks natural that the plugin should both download the dependencies, and generate the relevant libraries.xml

@sergej-koscejev
Copy link
Member Author

I think that generating this file doesn't save that much work

Well, the dependencies still have to be received and unpacked to a folder, don't they?
So it looks natural that the plugin should both download the dependencies, and generate the relevant libraries.xml

Sure but that's not what this task does. This task was for being able to locally override some entries in libraries.xml to point to a different directory.

@vlsi
Copy link

vlsi commented Oct 19, 2020

Well, as long as libraries.xml generation is there, it looks fine to me :)
However, the issue descriptions look to me like you want to move XML generation to the developers.

@sergej-koscejev
Copy link
Member Author

sergej-koscejev commented Oct 19, 2020

However, the issue descriptions look to me like you want to move XML generation to the developers.

Yes, that's what I want. Generating this file doesn't save that much work. The task doesn't unpack dependencies, it only writes a few lines of XML.

@vlsi
Copy link

vlsi commented Oct 19, 2020

Generating this file doesn't save that much work

That is not, however, it is duplication: once I declare dependencies in Gradle, then I need to generate libraries.

@vlsi
Copy link

vlsi commented Oct 19, 2020

Just in case: previously I knew nothing of Gradle, and I was more-or-less managing the dependencies manually, however, later I realized a Gradle plugin can manage it.

Now you say you are going to remove that from mps-gradle-plugin which is sad.

@sergej-koscejev
Copy link
Member Author

sergej-koscejev commented Oct 20, 2020

Just in case: previously I knew nothing of Gradle, and I was more-or-less managing the dependencies manually, however, later I realized a Gradle plugin can manage it.

Now you say you are going to remove that from mps-gradle-plugin which is sad.

No, I'm proposing to remove just the task to generate the libraries.xml file. Does the approach of adding a single directory as a "project library" and putting all your dependencies underneath it not work for you? This way you don't have to regenerate or change thelibraries.xml file when adding/removing dependencies.

@coolya coolya mentioned this issue May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants