Skip to content

A Leiningen plugin for building Clojure/iOS projects

License

Notifications You must be signed in to change notification settings

gibbonsd1/lein-fruit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A Leiningen plugin for building native iOS apps in Clojure and Java using the RoboVM bytecode-to-native translator. It is modeled after lein-droid and the commands are similar. Both plugins are included in Nightcode, for those who prefer not using the command line.

Caveats

  1. There is no REPL and any attempt to call eval at runtime will cause an exception because iOS doesn't allow executable memory.
  2. Due to Clojure's import behavior, importing most RoboVM Cocoa Touch classes will lead to a compile error. Instead, you must invoke these classes dynamically. The template provides an example of this, including some helpful convenience functions.

Installation

  1. Get a computer running Mac OS X
  2. Install Xcode
  3. Install JDK 7
  4. Download and extract robovm-0.0.8.tar.gz
  5. Install Leiningen, and create or modify ~/.lein/profiles.clj so it looks like this:
{:user {
    :plugins [[lein-fruit "x.x.x"]]
    :ios {:robovm-path "/absolute/path/to/robovm-0.0.8"}
}}

Replace the "x.x.x" with the version below:

Usage

# Create a new Clojure/iOS project
lein fruit new hello-world
# ...or a new Java/iOS project
lein fruit new-java hello-world
# You may optionally specify a package name
lein fruit new-java hello-world info.oakleaf.hello_world

# Build an x86 version and run in a simulator
lein fruit doall
# ...which is the same thing as
lein fruit compile && lein fruit run
# Use the iPad simulator
lein fruit doall -ios-sim-family ipad

# Build an ARM version and run on a device
lein fruit release
# ..which is the same thing as
lein fruit compile && lein fruit ipa
# Show RoboVM flags (all flags are passed to it)
lein fruit help

Licensing

All files that originate from this project are dedicated to the public domain. I would love pull requests, and will assume that they are also dedicated to the public domain.

About

A Leiningen plugin for building Clojure/iOS projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published