Skip to content
forked from defagos/CoconutKit

CoconutKit is a library of high-quality iOS components

License

Notifications You must be signed in to change notification settings

xxhp/CoconutKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is a collection of tools and reusable components used at Hortis le Studio. It is meant to be used
as a standalone static library.

Most components can be used either on the iPhone or on iPad.


1) Building the library
   --------------------
To compile and use the library in the way it is intended to be used, download the make-fmwk and link-fmwk.sh commands 
available at:
    https://github.com/defagos/make-fmwk
    
To build the library, run the make-fmwk command from the nut project main directory (the one containing nut.xcodeproj), 
as follows:
    make-fmwk.sh Release                        for the release binaries
    make-fmwk.sh Debug                          for the debug binaries
    make-fmwk.sh -s Debug                       for the debug binaries (with source code for debugging)
These three commands create three .staticframework files in the ~/StaticFrameworks directory.

The debug library contains additional checks and assertions, as well as logging, and should be used during development. 
All this code is stripped off the release library, which should therefore be used for production code. 


2) Using the library
   -----------------
To use the library in a project, add a frameworks.txt file in its main directory, containing either
    nut-Release
    nut-Debug
    nut-Debug-src
depending on the .staticframework you intend to use.
Then run the link-fmwk.sh command (no parameter is needed) from the project main directory:
    link-fmwk.sh
This generates a symbolic link to the corresponding .staticframework package in ~/StaticFrameworks. This symbolic
link, which you will find in the StaticFrameworks subdirectory of your project (generated by link-fmwk), must then
be added to your project. Build and run, you are done.

To enable logging, add -DHLS_LOGGER to your configuration preprocessor flags, as well as a property called
    HLSLoggerLevel
to your project main .plist file (setting its value to either DEBUG, INFO, WARN, ERROR or FATAL). Note that
if you are linking against the nut-Debug or nut-Debug-src packages, you will get the library logs as well
(which can be especially useful during development).


3) Building the nut-demo project
   -----------------------------
An iPad demo project is provided. To compile it, first build the nut-Release .staticframework (as described above), then 
run the link-fmwk command from the nut-demo project main directory (the one containing nut-demo.xcodeproj). The
project can then be built and run using Xcode.


4) The nut-dev project
   -------------------
When working on a library component, it is not very convenient to use the nut-demo library, because every time a change
is made the library has to be recompiled before being linked to the demo project. For convenience, a nut-dev project has
therefore been introduced. This project simply combines the nut and nut-demo projects into one (all corresponding files
have been collected into the project "Shared" directory). With the exception of a few files, which have been collected
in the project "nut-dev Other Sources" directory, the nut-dev project is therefore an empty shell.

The recommended way to use the nut-dev project is the following:
  - during development, you can add files to the nut or nut-demo directly from within nut-dev
  - when you add a new public header, add it to the nut-dev pch file
  - when you are done with the development, mirror your changes into the nut and nut-demo projects. The headers you
    have added to the nut-dev pch file must be added to the publicHeaders.txt found in the nut project. If you
    made changes to your project or target settings, mirror them if needed
  - build the library and the demo project, and check that everything compiles, links and works as expected. You might 
    have to tune the nut bootstrap.txt file if new objects you have introduced do not behave correctly with the nut-demo
    project
  - commit all changes you made to the three projects to the repository

It would have been nice to use the nut-demo project also for development, but it was difficult not to introduce special
settings and tricks to get this working. Having a clean separate demo project is easier to understand (which is the
goal of a demo after all).

About

CoconutKit is a library of high-quality iOS components

Resources

License

Stars

Watchers

Forks

Packages

No packages published