Skip to content

lovejavaee/functionaljava

Repository files navigation

$LastChangedDate: 2009-12-04 20:30:21 +1000 (Fri, 04 Dec 2009) $
$LastChangedRevision: 288 $
$LastChangedBy: tomjadams $
$URL: https://functionaljava.googlecode.com/svn/trunk/README $

Build 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) Cabal update with the command 'cabal update'
3) Install Lastik with the command 'cabal install Lastik'
    http://hackage.haskell.org/package/Lastik

You are now ready to start playing with the build functionality.

To enter the GHC interpreter with the Build.hs source, type:
> ghci Build.hs

You will find yourself at a prompt
*Build>

This is a GHCi prompt and you have loaded the Functional Java build module.

The special GHCi commands are prefixed with a semi-colon (:).
GHCi also has tab-completion so you may type : then hit TAB and you will see all GHCi special commands.

You can view all of the available Functional Java build functions and their type with the :browse command. The output will be a list of function name followed by :: followed by the type. You read the word :: out aloud as "is of type" so for example src :: [FilePath] would be read as "src is of type list of FilePath". You can get its value by typing src and hitting enter.

*Build> src
["src/main","src/package-info"]

They are the Functional Java source directories. Functions that have the type "IO ()" or "IO ExitCode" will execute a command of some sort. You are probably most interested in these functions for doing compiling and so on. Tab-completion is also available for function names so don't forget to use it.

For example, suppose you want to compile and build a JAR file, then you would execute the "archive" function. At the *Build> prompt type "ar<TAB>". This will fill out the word "archive". Hit enter and the build of the JAR archive will commence. If the tab-completion is ambiguous, hit tab twice in quick succession to list your available options.

Want to know where the JAR file built to? There is a function called 'jardir' which is of the type FilePath. You'll have seen in your :browse. Just type jardir and hit ENTER.

*Build> jardir
"build/jar"

That's where your JAR file will be.

Want to compile all outstanding source files then start a Scala Read-Eval-Print-Loop with all the compiled classes on the classpath? That would be the 'repl' function. You get the drift.

There is the full power of the Haskell programming language and tools to supplement your experience. No more piss-farting about with Apache Ant or Maven or Buildr or any of that nonsense, yay!


But if you must have Maven...

To create a Maven release:

$ # Edit pom.xml in HEAD to point to correct version, 2.16 below.
$ svn co https://functionaljava.googlecode.com/svn/tags/2.16 functionaljava-2.16
$ cd functionaljava-2.16
$ export ANT_OPTS=-Xmx1024m
$ ant -Dbuild.number=2.16 -Dbuild.username=<SVN username> -Dbuild.password=<SVN password> maven-deploy
$ # Post to list.

About

Functional programming in Java

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 97.1%
  • Scala 2.9%