too many unnecessary directories created - sbteclipse

I'm using sbteclipse from the command line and getting a lot of directories I don't want -- it creates a very spammy-looking directory structure, and I want a clean structure.
14:59 $ find .
.
./main
./main/java
./main/scala
./main/scala/Main.scala
./main/scala-2.11
./test
./test/java
./test/scala
./test/scala-2.11
Why are there so many? I really only care about main/scala and that's it. And all my code is 2.11.

Related

how to make bitbake print options of do_configure

I'm having trouble cross compiling Qt5 for beaglebone using openembedded with bitbake. I think in step do_configure not everything is passed from my *.bbappend and no platform plugins are installed (I need 'linuxfb').
My question will be: how to make bitbake print list of arguments it passes to ./configure?
There's a few ways to get that info, I would suggest looking in the recipe work directory:
temp/log.do_configure contains the configure task log which should list exact ./configure-command
build/ contains the projects own build system artefacts
bitbake -e <recipe> | grep <VARIABLE> is very useful if you want to know what variable values end up as (check e.g. PACKAGECONFIG and PACKAGECONFIG_CONFARGS values if you're modifying packageconfig).

Can I have multiple configure.ac files and what to do with AC_OUTPUT then?

I have this directory structure:
foo
foo/libfoo - libfoo project
foo/libfoo/src - sources
foo/foo - foo project
foo/foo/src - sources
There are two separate things that have to be build here, a libtool library (libfoo) and an executable (foo) using that library.
I could just place a configure.ac file into each foo/libfoo and foo/foo and everything would be fine.
However I would like to be able to build both projects at once, so I thought about placing an additional configure.ac into the top level foo directory.
Is this a good idea?
If yes, how would the AC_OUTPUT makro be used in such a case?
Does the top level configure.ac file generate all the Makefiles in the whole tree or are there separate AC_OUTPUT makros in the sub directories that each output there Makefiles?
Since both projects have different dependencies I would think the subdir ac files do the output of their makefiles?
Can the two projects in the sub dirs still be build separately in this case?
There is a AC_CONFIG_SUBDIRS macro that does what I want, it recurses into subdirs and executes the configure.ac files there.
The sub dir projects can still be build independently.
My Makefile.am only contains SUBDIRS = libfoo foo now.
The configure.ac file contains AC_CONFIG_SUBDIRS=([libfoo foo]).

Coq: manage LoadPath in project with subdirectories

I have a Coq project with its libraries organised into subdirectories, something like:
…/MyProj/Auxiliary/Aux.v
…/MyProj/Main/Main.v (imports Auxiliary/Aux.v)
When I compile the files, I expect to do so from working directory MyProj (via a makefile). But I also want to work on the files using Proof General/Coqtop, in which case the working directory is by default the directory in which the file lives.
But this means that the LoadPath is different between the two contexts, and so the logical path needed for the library import is different. How do I set up the coqc invocation, the LoadPath, and the import declarations so that they work in both contexts?
Each approach I have tried, something goes wrong. For instance, if I compile Aux.v by invoking
coqc -R "." "MyProj" Auxiliary/Aux.v
and import it in Main.v as
Require Import MyProj.Auxiliary.Aux.
then this works when I compile Main.v with
coqc -R "." "MyProj" Main/Main.v
but fails in Coqtop, with Error: Cannot find library MyProj.Auxiliary.Aux in loadpath. On the other hand, if before the Require Import I add
Add LoadPath ".." as MyProj.
then this works in Coqtop, but fails under coqc -R "." "MyProj" Main/Main.v, with
Error: The file […]/MyProj/Auxiliary/Aux.vo contains library
MyProj.Auxiliary.Aux and not library MyProj.MyProj.Auxiliary.Aux
I’m looking for a solution that’s robust for a library that’s shared with collaborators (and hopefully eventually with users), so in particular it can’t use absolute file paths. The best I have found for now is to add emacs local variables to set the LoadPath up when Proof General invokes Coqtop:
((coq-mode . ((coq-prog-args . ("-R" ".." "MyProj" "-emacs")))))
but this (a) seems a little hacky, and (b) only works for Proof General, not in Coqide or plain Coqtop. Is there a better solution?
Allow me to side-step your question by suggesting an alternative process, hinted at by Tiago.
Assuming that your project's tree looks like this:
MyProj/Auxiliary/Aux.v
MyProj/Main/Main.v
In MyProj, write a _CoqProject file listing all your Coq files
-R . ProjectName
Auxiliary/Aux.v
Main/Main.v
When you open one of these Coq files, emacs will look for the _CoqProject and do-the-right-thing (tm).
As shown by Tiago, coq_makefile will also give you a Makefile for free.
I know you explicitly asked for something that works across different platforms, but there's already a Proof-General-specific solution that is less hacky than the one you have. Proof General has a special variable called coq-load-path that you can set with local variables, much like you did for coq-prog-args. The advantage is that you don't have to worry about any other arguments that need to be passed to coqtop (such as -emacs in your example). Thus, your .dir-locals.el file could have a line like this:
((coq-mode . ((coq-load-path . ((".." "MyProj"))))))
Unfortunately, I am not aware of anything that works across platforms, although I'm pretty sure that something specific for CoqIDE must exist. If this is the case, maybe you could set up a script to keep these configuration files updated across different platforms?
If you use coq_makefile you can install the library in your system.
Without OPAM
To initialize your project:
coq_makefile -f _CoqProject -o Makefile
Share your library with other projects:
make install
With OPAM
Assuming you have OPAM installed, you can use coq-shell to help you take care of dependencies.
To setup your project:
coq_shell_url="https://raw.githubusercontent.com/gares/opam-coq-shell/master/src/opam-coq"
curl -s "${coq_shell_url}" | bash /dev/stdin init 8.4 # Install Coq and its dependencies
eval `opam config env --switch=coq-shell-8.4` # Setup the environment
coq_makefile -f _CoqProject -o Makefile # Generates the makefile
opam pin add coq:YOURLIBRARY . # Add your library to OPAM
When you update your library you should do:
opam upgrade coq:YOURLIBRARY
Here is an example of a project that uses the OPAM method:
https://bitbucket.org/cogumbreiro/aniceto-coq/src

How to watch and recompile coffee scripts as they change?

Some time ago I used to do
coffee --bare --output . --watch --compile .
This watches the .coffee files in the current dir and recompiles them as they change.
Now, using 1.2.0 of coffeescript this does not seem to work any more. I'm presented with an error:
File not found: --watch.coffee
and the usage documentation for coffee seems rather light.
I'd skip the --output ., as it seems to be unnecessary if you're already in the same directory, and go straight with
coffee -bcw *.coffee
Otherwise, this is a duplicate of Compile CoffeeScript on Save?
BTW, you can also go:
coffee -bcw .
which will not only save a few keystrokes, but also scan subdirectories to compile .coffee files.

DPAN to create local CPAN

I want to make a CPAN repository from all curently installed modules. So I used autobundle to get a list of installed modules.
I then used BackPAN::Index to download all the distributions into a directory and then ran dpan in it.
It chew them for quite some time and then failed
MyCPAN::App::DPAN::Indexer 1.28
Processing 2 distributions
One * = 1 distribution
# Extracting with ->_untar_at
# Extraction succeeded
+# Extracting with ->_untar_at
# Extraction succeeded
++
/home/ec2-user/dpan_test/modules/02packages.details.txt.gz-8496-trial has a problem and I have to abort:
Deleting file (unless you're debugging)
Some distributions in the repository do not show up in the file
/home/ec2-user/dpan_test/Moose-1.24.tar.gz
/home/ec2-user/dpan_test/Moose-Autobox-0.11.tar.gz at /usr/local/share/perl5/MyCPAN/App/DPAN/Reporter/Minimal.pm line 439
Some distributions in the repository do not show up in the file
and list of every distribution follows.
OTOH I have a success logged for every file in the indexer_reports.
Output from perl -V on this Pastie link
I suffered the same error it was resolved when I added:
organize_dists 1
Though when trying attempting to install from the mirror CPAN fails as no 01mailrc.txt.gz file can be found. This can be overcome by copying the file from say http://www.perl.org/CPAN/authors/01mailrc.txt.gz into the new mirror's authors directory
I got the same error message, but could fix it:
In my case, I put the tgz file directly in the root of my dpan directory. Moving "./dpan/DateTime-0.70.tar.gz" to "./dpan/authors/id/D/DR/DROLSKY/DateTime-0.70.tar.gz" did fix the problem. Now "02packages.details.txt.gz" and "03modlist.data.gz" get created.