NIC

From iPhone Development Wiki
Revision as of 00:03, 4 September 2016 by Uroboro (talk | contribs) (→‎How to set default values: It doesn't magically know the email.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

New Instance Creator is a project templating system that creates ready-to-build empty projects for varying purposes.

To do: would be nice to explain what the five options mean, what the arguments mean, and why you might want to use those options and those arguments.

How to use a template

$THEOS/bin/nic.pl

NIC will list all the available templates present in $THEOS/templates/. Usually, these templates will reside within a second folder named iphone as most templates are made for the iPhone platform (includes iPhones, iPods and iPads).

NIC will prompt you for all the necessary information before creating a project.

NIC Example

Here is an example of what you will see when using the NIC to create a project (with user input shown in bold):

$ $THEOS/bin/nic.pl
NIC 1.0 - New Instance Creator
------------------------------
  [1.] iphone/application
  [2.] iphone/library
  [3.] iphone/preference_bundle
  [4.] iphone/tool
  [5.] iphone/tweak
Choose a Template (required): 1
Project Name (required): iPhoneDevWiki
Package Name [com.yourcompany.iphonedevwiki]: net.howett.iphonedevwiki
Authour/Maintainer Name [Dustin L. Howett]:              
Instantiating iphone/application in iphonedevwiki/...
Done.
$

The above will create a folder ./iphonedevwiki in the current working directory - make sure you have permissions to create a folder.

Alternately, nic.pl supports the following arguments:

short flag long flag argument example
-t -template iphone/template iphone/tweak
-n -name project name iPhoneDevWiki
-p -packagename package name net.howett.iphonedevwiki
-u -user user name "Dustin L. Howett"
-nic template file libactivator_listener.nic

If a template requires extra variables, they will have to be provided by hand.

How to create new templates

Say something about old and new templates, refer to denicify.pl and nicify.pl

How to set default values

You can create the file ~/.nicrc to set up some default values for NIC to use. Writing the following lines in this file:

 username = "Dustin L. Howett <[email protected]>"
 package_prefix = "net.howett"

will make NIC not ask for username. When prompted for a packagename,

 Package Name [com.yourcompany.iphonedevwiki]:

will be

 Package Name [net.howett.iphonedevwiki]:

If you add an e-mail address in the username like this:

 username = "Dustin L. Howett <[email protected]>"

will make the "Author" cell in the package description in Cydia prompt to create a mail with the To: field already set.

External links