I want to specify the latest revision of a particular branch as a dependency. Specifically, I'd like to use Bootstrap v3.0 before it is released.
What is the best way to specify that as a dependency in bower?
You need to use the #, appended to the component name:
bower install bootstrap#version3-branch-name
And as you might expect, if you add --save-dev to that, then it will add to your bower.json file:
"bootstrap": "version3-branch-name"
You can specify the commit SHA instead of a version:
bower install bootstrap#37d0a30589
Note that specifying a branch in production or reusable modules is bad practice as it's a moving target and will eventually break something. Discussion about it here.
Until bower gets the ability to target a specific commit as #Sindre noted, I am taking advantage of bower's ability to target arbitrary zip files. I specified github's zip of bootstrap's 3.0 branch in my component.json:
"bootstrap": "https://github.com/twbs/bootstrap/archive/3.0.0-wip.zip"
I understand this is bad practice to target a branch (rather than a specific commit), but this works for me for now as a stopgap.
Related
I implemented a ros package that depends on some other packages.
These packages depend on even more packages and so on...
How can I find out which packages are actually used when building and running nodes in my package?
(Except for looking at ALL the package.xml files manually, because there are multiple cases in which some packages are listed there but already deprecated and not actually used anymore)
So I'm looking for something like a tool/command/script that can list all actual package dependencies.
I think you can do this natively with rospack. To see everything a package depends on (including dependencies of dependencies) without duplicates, just do
rospack depends my_package
You can get it formatted with indents to see all dependency chains of each package (will include duplicates across chains if more than one package shares the same dependency):
rospack depends-indent my_package
And if you only wanted to know the immediate dependencies of your package, you can do:
rospack depends1 my_package
I'm not sure that addresses the problem you identify that it shouldn't identify deprecated dependencies, but if a package is still specifying a dependency explicitly in a package.xml, how is the system to know that isn't really a dependency? It'd be better to get those package.xml files up to date.
What is the difference? I realise that they get put into different object properties in bower.json but I can't seem to figure out why you need two separate properties for this, why not just use one.
From the documentation:
-S, --save: Save installed packages into the project’s bower.json dependencies
-D, --save-dev: Save installed packages into the project’s bower.json devDependencies
But there is no explanation of the difference between the two. When should I be saving in dependencies vs devDependencies?
Same case than in npm. Packages that you use in production should go inside dependencies and those that do not inside devDependencies.
The idea is that you are able to install only --production or --development variables, depending on the environment you are deploying your code.
From another answer in this community: What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?
Is it possible to use ThymeLeaf with Grails 2.4?
There is a plugin that was started (https://grails.org/plugins/pending/250), but it doesn't appear to be active anymore and it noted some significant issues.
I've done quite a bit of searching and haven't been able to find anything on this subject other than the abandoned plugin... maybe I should take that as a sign.
Try it out and see. Clone the repo, then edit ThymeleafGrailsPlugin.groovy and change the version to a -SNAPSHOT version:
def version = "0.1-SNAPSHOT"
Then run grails compile and grails maven-install. That second script will build the plugin and copy it to your local Maven cache in the same format as if it were retrieved as a published plugin.
To use it in a project, add it like any released plugin, e.g.
compile ':thymeleaf:0.1-SNAPSHOT'
and it will resolve from your Maven cache.
To make changes, leave the version but run clean and maven-install again, but delete the plugin directory in the cache. That'll be something like $HOME/.m2/repository/org/grails/plugins/thymeleaf/0.1-SNAPSHOT - delete the whole directory, and after rebuilding the new version will be used.
David's email is in ThymeleafGrailsPlugin.groovy if you get stuck. It's easy to miss comments in the plugin proposal pages, so don't take a lack of a reply there as an indication that the plugin is totally abandoned.
... $make menuconfig
select some package
... $make
...
there are many bin files in the bin folder.:
My question is , I want to change some software source code of openwrt and rebuild again.
I have try to edit some source code of build_dir. But want I rebuild openwrt My code with be refresh with the newest code of svn.
Does any one how to do that?
Writing your code and synchronizing it:
1) Clone the official linino repository from Arduino on your machine using git (install it using sudo apt-get install git):
git clone https://github.com/linino/linino_distro.git
2) Do your own changes in the relevant code files, Makefiles or whatever that you need to change.
3) Whenever you want to synchronize your work with the latest changes from the remote master branch in the linino repository, you need to first fetch the changes, meaning retrieving them without yet merging them, then in a 2nd time merge them and then resolve conflicts if any:
Preliminary: if you created a local branch with your own changes make sur you get back to the master branch, you need to check out the master:
git checkout master
a) fetching the latest changes:
git fetch master
b) Merging them with your changes on your local repository (normally called origin):
git merge origin/master
Note: alternatively you can do it in one command:
git pull
It essentially does a fetch and a merge at the same time but it's important to understand the process using fetch first. From experience it can be confusing for beginners, plus it can cause automerge if not explicitely specified otherwise, causing more work to undo them.
4) Now you're ready to resolve conflicts if any, for that you can use:
git mergetool
This will allow you to resolve conflicts using a graphical tool such as tkdiff (2 way merge tool), or meld (3 way merge tool, diff your changes, the changes from the remote master, and the original file).
Compiling your code:
5) Open a terminal in your linino buildroot directory, make sure you get to update the config if you added any new packages, then recompile the image i.e.
cd ~/myLininoBuildRoot/trunk
make menuconfig
#now select your new package, that you added in trunk/package
# Make sure you save the configuration before exiting
make
Note: Alternatively you can recompile packages one by one. Instead of doing a simple make do:
Preliminary step:
Make sure to have compiled the linino toolchain that allows you to compile packages separately:
cd trunk/
make tools/install
make toolchain/install
make target/compile
Then compile your package:
make package/myPackage
Or Alternatively, you can be more specific by selecting the any target from your package Makefile say for instance install or compile or build targets:
make package/myPackage/install
make package/myPackage/compile
make package/myPackage/build
Finally, recompile the index target common to all packages that will allow you to have an bin directory trunk/bin/yourArchitecture/packages that contains an up to date index of packages including your freshly compiled one:
make package/index
More info at: http://wiki.openwrt.org/doc/howto/build.a.package
Checking that everything is alright:
Now go have a look at trunk/bin/yourArchitecture/packages/Packages, do a grep to make sure it is listed in Packages (the actual packages index file) and is up to date:
grep Packages | myPackage
You probably want to:
Get the latest version of the source code.
Make whatever changes you want.
Use diff to make a patch recording your changes.
Update the source code (in the future)
Use patch to apply the patch
Manually perform any changes that could not be patched.
This is example build motion to newer version.
edit:
../package/feeds/packages/motion
Original Makefile
PKG_NAME:=motion
PKG_VERSION:=20110826-051001
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lavrsen.dk/sources/motion-daily \
#SF/motion
PKG_MD5SUM:=e703fce57ae2215cb05f25e3027f5818
Edited Makefile
PKG_NAME:=motion
PKG_VERSION:=20120605-224837
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.lavrsen.dk/sources/motion-daily \
#SF/motion
PKG_MD5SUM:=145fffcb99aed311a9c1d93b838db66f
You can also change Package Source URL (PKG_SOURCE_URL) if necessary
Rebuild newer motion application with:
make package/feeds/packages/motion/compile
Some libraries don't have an already build JavaScript file in their Github repository because the authors of these libraries are against keeping build artifacts around (Sinon.JS for example). Is there a preferred way to deal with this using Bower?
I know that I could fork the repository and register my fork with the prebuilt file with Bower. I'm just not sure if this is the best/correct way to handle this.
If there's not a proper Bower package registeres, you can install from any git repo (you can specify versions if there are proper git tags), and even from a .zip or .tar.gz files if you provide an url.
This is from http://bower.io/
bower install <package>
Where <package> can be any one of the following:
A name that maps to a package registered with Bower, e.g, jquery.
A remote Git endpoint, e.g., git://github.com/someone/some-package.git. Can be public or private.
A local Git endpoint, i.e., a folder that's a Git repository.
A shorthand endpoint, e.g., someone/some-package (defaults to GitHub).
A URL to a file, including zip and tar.gz files. It's contents will be extracted.
Of course you won't get any dependency resolution this way, but you can take care of that manually adding any dependency explicitly to your bower.json file
Currently that is the best way. You can also keep it locally and reference it in 'dependencies' with full path. We're working on adding ability for author to publish components, like npm.