C4 is an emacs mode for Java 7.
In the examples below I'll mention two variables: SRC and BIN.
The variable SRC is the location of the project's src directory.
The variable BIN is the location of the bin directory which is created by the build process.
The path to BIN is affected by the variable BUILDTYPE, which has two possible values: Debug or Release. Check the Build section for more information.
Prerequisite:
Install Protocol Buffers before compiling c4. See https://developers.google.com/protocol-buffers/ for more information.
# Fedora
dnf -y install protobuf-devel
# OSX running macports
brew install protobuf-cYou can build c4 in Debug mode (default), or in Release mode.
git clone git://github.com/dberg/c4.git
cd c4/src
make BUILDTYPE=ReleaseThe default compiler is clang if you're running OSX and gcc if you're running GNU/Linux.
You can set the flag CXX to use your compiler of choice. For example:
make CXX=clang++
# or
make CXX=g++- Open the file $SRC/c4-mode/c4-mode.el and set the variable
;; Replace BIN with the path to the c4 executable
(defvar c4-executable "BIN/c4")- Add the following to your .emacs or init.el file:
;; Replace SRC with the path to c4-mode
(add-to-list 'load-path "SRC/c4-mode")
(autoload 'c4j-mode "c4j-mode" "C4 Major mode." t)
(add-to-list 'auto-mode-alist '("\\.java$" . c4-mode))# Print usage information
BIN/c4 --help
# Print the emacs output of a java source file
BIN/c4 -i java -f MyClass.javaTo run all tests execute
BIN/run-allCheck the Dockerfile for instructions on how to build c4 with Fedora.