Working with Codename One Sources
Checking out the Sources
$ mkdir workspace $ cd workspace $ git clone https://github.com/codenameone/CodenameOne
|Creating a clean "workspace" directory is optional, and there is nothing special about the name "workspace". It is just recommended to create a clean directory into which you check out Codename One, because building Codename One will check out a few dependent projects and place then at the same level as the CodenameOne folder, so having a clean workspace will make it easier to manage.|
$ cd CodenameOne $ ant
| The |
Running Unit Tests
You can run the unit test suite locally in the Codename One simulator using the "test-javase" ant target.
$ ant test-javase
Running iOS Unit Tests
|Running iOS Unit tests is currently limited to interal use only by Codename One.|
TLDR: You can run Codename One’s unit tests on a local iOS simulator by running the "test-ios" ant target in the main CodenameOne directory. E.g.
This assumes the following requirements
You are running Mac OS X with Xcode 7.3 or higher installed.
You have npm installed and in your environment PATH.
You have appium installed and running.
Either download the installer from https://nodejs.org/en/ OR run
brew install node from terminal.
Installing and Running Appium
Open a new terminal window, then
$ mkdir appium $ cd appium $ npm install appium $ ./node_modules/.bin/appium
| You may want to run the last command |
Running the Unit tests
$ cd CodenameOne $ ant test-ios
Overriding the Codename One Build Server Target
$ ant test-ios -Dcn1.iphone.target=iphone_new
This will send to the "iphone_new" build server instead of the default "iphone" server.