Build

12 views
Skip to first unread message

Tony Morris

unread,
Jul 4, 2009, 7:55:38 AM7/4/09
to functio...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello everyone,
The Functional Java trunk is a bit of a mess with build scripts and,
unsatisfied with existing solutions out there, I decided to write my own.
http://hackage.haskell.org/package/Lastik

You will see in trunk a file called Build.hs which currently does
(almost) all of what the build.xml script does and much more e.g.
incremental compile, starts a Scala REPL with a useful classpath. In
order to use it you will need Glasgow Haskell Compiler and the Lastik
and PureMD5* packages (from hackage). If, like me, you consider GHC
and cabal-install to be pre-requisite for a useful development
environment, then all you'll need to do is:

> cabal install lastik puremd5

If not, install GHC and cabal-install then do the above :)

I haven't addressed the maven issue and I'm not sure how to do that
anyway. Maybe it will go away! But probably not :( What is required to
keep the maven people happy?

* http://hackage.haskell.org/package/pureMD5

- --
Tony Morris
http://tmorris.net/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKT0M5mnpgrYe6r60RAjZCAKCCS4GSvaslwXDnqAGdU77tx75OggCfQSBH
5N+E5HRDeANezpGWXgdwE78=
=Nuuw
-----END PGP SIGNATURE-----

Tony Morris

unread,
Jul 5, 2009, 5:06:26 AM7/5/09
to functio...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have written some instructions for getting started in using this
build system for the Functional Java. Thankfully it is much easier to
get started than with other build systems and is much (*much*) easier
to use. Here are the instructions:

1a) Install The Haskell Platform http://hackage.haskell.org/platform/
1b) If The Haskell Platform is not available to you:
1b.1) Install GHC http://haskell.org/ghc
1b.2) Install cabal-install
http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
1b.3) Install The Haskell Platform with the command 'cabal install
haskell-platform'
2) Install Lastik with the command 'cabal install Lastik'


I have also written some shell scripts in /trunk for invoking some
common functions with shorter commands. For example, executing ./repl
will incrementally compile any outstanding source files and start the
Scala REPL with the classpath set appropriately. Executing ./test will
compile anything outstanding and execute the test suite. If you use
Windows, you might like to write the .bat equivalent -- it is as
simple as a one line command (do these bash scripts work on MacOS?).
Here is an example -- the 'repl' script:

http://functionaljava.googlecode.com/svn/trunk/repl

Easy right? I don't think I can make it any easier. Any questions?

Tony Morris wrote:
> Hello everyone, The Functional Java trunk is a bit of a mess with
> build scripts and, unsatisfied with existing solutions out there, I
> decided to write my own. http://hackage.haskell.org/package/Lastik
>
> You will see in trunk a file called Build.hs which currently does
> (almost) all of what the build.xml script does and much more e.g.
> incremental compile, starts a Scala REPL with a useful classpath.
> In order to use it you will need Glasgow Haskell Compiler and the
> Lastik and PureMD5* packages (from hackage). If, like me, you
> consider GHC and cabal-install to be pre-requisite for a useful
> development environment, then all you'll need to do is:
>
>> cabal install lastik puremd5
>
> If not, install GHC and cabal-install then do the above :)
>
> I haven't addressed the maven issue and I'm not sure how to do that
> anyway. Maybe it will go away! But probably not :( What is
> required to keep the maven people happy?
>
> * http://hackage.haskell.org/package/pureMD5
>

-



- --
Tony Morris
http://tmorris.net/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKUG0SmnpgrYe6r60RAlAJAJ4j5L2XgGSdVr6MN3vohebamlnkZgCgp1xM
HSSSct/BFXgwGlIG7EdWwfg=
=IXpM
-----END PGP SIGNATURE-----

Brad Clow

unread,
Jul 5, 2009, 5:28:49 AM7/5/09
to functio...@googlegroups.com
I just tried it on a mac. Already had ghc & cabal installed.

$ sudo cabal update
$ sudo cabal install Lastik
$ ./test
no such file: fj.Tests
ExitFailure 1
$

So shell script works, but looks like tests are not compiled.

Regards
brad

2009/7/5 Tony Morris <tmo...@tmorris.net>:
--
Brad Clow | blog: http://bradclow.blogspot.com/ | skype: bradjclow

Tony Morris

unread,
Jul 5, 2009, 5:49:06 AM7/5/09
to functio...@googlegroups.com
Odd, I just did a full clean then executed it fine. Do you have the
latest trunk?

Brad Clow wrote:
> I just tried it on a mac. Already had ghc & cabal installed.
>
> $ sudo cabal update
> $ sudo cabal install Lastik
> $ ./test
> no such file: fj.Tests
> ExitFailure 1
> $
>
> So shell script works, but looks like tests are not compiled.
>
> Regards
> brad
>
> 2009/7/5 Tony Morris <tmo...@tmorris.net>:

--
Tony Morris
http://tmorris.net/


Brad Clow

unread,
Jul 5, 2009, 7:12:43 AM7/5/09
to functio...@googlegroups.com
Yes I had the latest.

After sending the last email, I decided it was time to upgrade GHC to
the current version. After that I did a full clean and then the test
script worked fine. Not sure what the actual issue was.

brad

2009/7/5 Tony Morris <tonym...@gmail.com>:

Tony Morris

unread,
Jul 5, 2009, 9:18:45 AM7/5/09
to functio...@googlegroups.com
Thanks Brad. Unfortunately I just tried to use it on Windows and found
that I've accidentally depended on a unix module. I will fix this ASAP.

In the meantime I have written a README that should help new users
http://functionaljava.googlecode.com/svn/trunk/README

--
Tony Morris
http://tmorris.net/


Ted Neward

unread,
Jul 5, 2009, 5:59:05 PM7/5/09
to functio...@googlegroups.com
Speaking as one of those newbie users, one thing I've noticed is that after
downloading cabal, I have to run "cabal update" first. (The "cabal install
Lastik" step states this explicitly, but you might want it in your README.)

One thing I will note, if there's ANY way to simplify this within the Ant
script (maybe do all these downloads as part of an "ant init" step or
something?), that would make it vastly more accessible to "average" Java
devs. (Having said that, I dunno if fj is targeted at those folks or
not--tell me to sit down & shut up if that's the case....)

Ted Neward | Principal Consultant, ThoughtWorks
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing
http://www.thoughtworks.com | http://www.tedneward.com

Tony Morris

unread,
Jul 5, 2009, 6:03:41 PM7/5/09
to functio...@googlegroups.com
Hello Ted.

Ted Neward wrote:
> Speaking as one of those newbie users, one thing I've noticed is that after
> downloading cabal, I have to run "cabal update" first. (The "cabal install
> Lastik" step states this explicitly, but you might want it in your README.)
>

Agreed -- fixed. Thanks.


> One thing I will note, if there's ANY way to simplify this within the Ant
> script (maybe do all these downloads as part of an "ant init" step or
> something?), that would make it vastly more accessible to "average" Java
> devs. (Having said that, I dunno if fj is targeted at those folks or
> not--tell me to sit down & shut up if that's the case....)
>

I suppose one might use the <exec> task and call "ghc Build.hs -e
archive" to, for example, build the functionaljava.jar but is it really
worth it?

> Ted Neward | Principal Consultant, ThoughtWorks
> Java, .NET, XML Services
> Consulting, Teaching, Speaking, Writing
> http://www.thoughtworks.com | http://www.tedneward.com
>
>

Runar Bjarnason

unread,
Jul 5, 2009, 6:03:28 PM7/5/09
to functio...@googlegroups.com
The average Java dev will just download the binary distribution.

Ted Neward

unread,
Jul 5, 2009, 6:20:58 PM7/5/09
to functio...@googlegroups.com
Good point. :-)

Ted Neward

unread,
Aug 10, 2009, 7:37:58 PM8/10/09
to functio...@googlegroups.com
Having fetched the latest from the SVN repo, when trying to build, I get a
GHC crash whenever I try to execute the "archive" task. Being something of
the Haskell n00b, and lacking any kind of visible stack trace, what options
do I have to either fix this on my own or send some info to the list to fix?
(The error seems to occur whenever it's trying to package up the MANIFEST
file for the jar.)

Ted Neward
Java, .NET, XML Services
Consulting, Teaching, Speaking, Writing

Tony Morris

unread,
Aug 10, 2009, 9:16:16 PM8/10/09
to functio...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I think there is a bug in the zip-archive package which Lastik depends
on. I shall try to isolate it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqAxl0ACgkQmnpgrYe6r63RKACgxNY0xswg/35txyXIrJ9s05x7
zJcAoMppAFDxf+toU5pzc7oYTdwWoSKL
=kT6Q
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages