Would be nice to have a drush make integration, for distro builders and drush users alike.

To get things started here, this is what I'm using:

;navbar.make
core = "7.x"
api = "2"

; Backbone
libraries[backbone][directory_name] = "backbone"
libraries[backbone][type] = "library"
libraries[backbone][destination] = "libraries"
libraries[backbone][download][type] = "get"
libraries[backbone][download][url] = "https://github.com/documentcloud/backbone/archive/1.0.0.zip"

; Modernizr
libraries[modernizr][directory_name] = "modernizr"
libraries[modernizr][type] = "library"
libraries[modernizr][destination] = "libraries"
libraries[modernizr][download][type] = "get"
libraries[modernizr][download][url] = "https://github.com/Modernizr/Modernizr/archive/v2.7.1.zip"

; Underscore
libraries[underscore][directory_name] = "underscore"
libraries[underscore][type] = "library"
libraries[underscore][destination] = "libraries"
libraries[underscore][download][type] = "get"
libraries[underscore][download][url] = "https://github.com/documentcloud/underscore/archive/1.6.0.zip"

I know modernizr has its own set of issues around being shared by multiple modules.

The two options I can see would be to either host a preconfigured version of modernizr-for-navbar on github, or to download the entire library and register the tests that this module needs with the modernizr drupal library -- which would require #2316323: Integrate navbar with modernizr drupal module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jwilson3’s picture

Issue summary: View changes
hass’s picture

But we use a custom Modernizr build and this cannot downloaded that simple.

akalam’s picture

Status: Active » Patch (to be ported)
FileSize
1.19 KB

This is what we use! Patch attached

With a custom modernizr build download from github (thanks to BrianGilbert)

hass’s picture

Status: Patch (to be ported) » Needs review
eshta’s picture

I feel like this should also include the libraries module as it is a requirement for the module (version >= 2.0). I'm including it here along with some additional comments to break things up.

eshta’s picture

hass’s picture

Status: Needs review » Needs work
+++ b/navbar.make
@@ -0,0 +1,28 @@
+projects[libraries][subdir] = contrib

I think this is very custom. We should not add modules to sub-directories as this is not the well known default. And my experience is that the next auto-update moves the files back to sites/all/modules, too. I'm also not a fan of this github URL. We should better decide why it is wrong to deliver this difficult to create modernizr JS file not as js/modernizr.navbar.js to navbar module as suggested in #2167993: Set module weight for Modernizr module.

akalam’s picture

"contrib" sub-directory is a kind of standard, if you have this folder, drush (5.x) will automatically download the modules in this one, without any aditional param.

Anyway, since the libraries recomended version is in the 2.x branch, may be is better to omit the version? If we dont omit the version, we are closing the door for updates...

I have seen many modules with make files like "module.make.example". This is like a start point, but the user can review and change anything before executing the drush make command. Could this be an intermediate point?

eshta’s picture

+1 for removing the libraries sub-directory
+1 for removing the libraries module version
+1 for renaming to navbar.makefile.example with a comment on top regarding that the user is expected to review it, rename it and then run drush.

hass’s picture

"contrib" sub-directory is a kind of standard, if you have this folder, drush (5.x) will automatically download the modules in this one, without any aditional param.

That is not correct. The default folder is sites/all/modules and not sites/all/modules/contrib. Just because someone suggested to use a subfolder doesn't make it right. Have you ever upgraded a modules via web in Drupal? I moved all my modules to sites/all/modules/contrib and after the upgrade the new version was located in drupals default sites/all/modules.

We need to define that we need a library version equals or higher than 2.0 like we are doing in .info files.

akalam’s picture

May be I express myself wrong. I just wanted to say that drush respect this subfolder. Also if you have the "contrib" subdir and you run "drush dl navbar" the module will be downloaded in this subdir, without extra configuration, and this does not happend with other subdir names. And no, I never upgraded modules via web.

Anyway you are right, the default folder structure is sites/all/modules and not sites/all/modules/contrib, so the make must not conain any subfolder. I will try tomorrow to upload a new patch with this suggestions.

thanks

eshta’s picture

Status: Needs work » Needs review
FileSize
1.28 KB

So I did a bit more digging in and set the libraries module version to be anything in the 2.x line (as well as including navbar module which we neglected to include before). I also followed the suggestion of making this an .example file and included some instructions in the top comments. I have tested this out by running it locally and generating a new site with the correct versions of all libraries/projects.

akalam’s picture

Great!

I think we should not include navbar module, since the make file is provided inside navbar module. What do you think?

akalam’s picture

Also the drupal core project shuld not be included, I think..
see for example plupload project
https://www.drupal.org/project/plupload

eshta’s picture

Yeah I went off creating a whole site didn't I. I can add an update in a moment that will get the scope back down again ;-)

eshta’s picture

So I think we're getting close on something that could be helpful.

akalam’s picture

Status: Needs review » Reviewed & tested by the community

Great!
In my opinion now it is perfect

hass’s picture

I'm fine with the patch as example except it motivates people to download the modernizr navbar version from a site we do not maintain and we cannot keep up to date ourself. Not sure if BrianGilbert keeps it updated for all times.

I have send the modernizr guys an email several weeks ago, but never received an answer if they may provide a download method for us.

eshta’s picture

So the repo was made specifically for navbar's usage: https://www.drupal.org/node/2119945#comment-8567323

Should we run into any problems, I could host it myself as a maintainer or probably get Acquia to host it.

eshta’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks everyone!

  • eshta committed e34f590 on 7.x-1.x
    Issue #2316319 by eshta, desarrollo2.0, jwilson3: Provide drush make...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.