Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2316319.navbar.make_.16.patch | 1.08 KB | eshta |
Comments
Comment #1
jwilson3Comment #2
hass CreditAttribution: hass commentedBut we use a custom Modernizr build and this cannot downloaded that simple.
Comment #3
akalam CreditAttribution: akalam commentedThis is what we use! Patch attached
With a custom modernizr build download from github (thanks to BrianGilbert)
Comment #4
hass CreditAttribution: hass commentedComment #5
eshta CreditAttribution: eshta commentedI 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.
Comment #6
eshta CreditAttribution: eshta commentedComment #7
hass CreditAttribution: hass commentedI 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.Comment #8
akalam CreditAttribution: akalam commented"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?
Comment #9
eshta CreditAttribution: eshta commented+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.
Comment #10
hass CreditAttribution: hass commentedThat is not correct. The default folder is
sites/all/modules
and notsites/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 tosites/all/modules/contrib
and after the upgrade the new version was located in drupals defaultsites/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.
Comment #11
akalam CreditAttribution: akalam commentedMay 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
Comment #12
eshta CreditAttribution: eshta commentedSo 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.
Comment #13
akalam CreditAttribution: akalam commentedGreat!
I think we should not include navbar module, since the make file is provided inside navbar module. What do you think?
Comment #14
akalam CreditAttribution: akalam commentedAlso the drupal core project shuld not be included, I think..
see for example plupload project
https://www.drupal.org/project/plupload
Comment #15
eshta CreditAttribution: eshta commentedYeah 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 ;-)
Comment #16
eshta CreditAttribution: eshta commentedSo I think we're getting close on something that could be helpful.
Comment #17
akalam CreditAttribution: akalam commentedGreat!
In my opinion now it is perfect
Comment #18
hass CreditAttribution: hass commentedI'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.
Comment #19
eshta CreditAttribution: eshta commentedSo 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.
Comment #20
eshta CreditAttribution: eshta commentedCommitted. Thanks everyone!