Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #335 from codenameone/master
Browse files Browse the repository at this point in the history
Updated the Codename One version to the latest version
  • Loading branch information
ColinEberhardt authored Sep 5, 2016
2 parents d879b17 + 1c27d1b commit 4b1901a
Show file tree
Hide file tree
Showing 16 changed files with 406 additions and 270 deletions.
Binary file modified codenameone/CodeNameOneBuildClient.jar
Binary file not shown.
Binary file modified codenameone/JavaSE.jar
Binary file not shown.
53 changes: 53 additions & 0 deletions codenameone/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Codename One Implementation

Visit the [Codename One article](https://www.codenameone.com/blog/property-cross-revisited.html) on the property cross demo and the [demo page in the website](https://www.codenameone.com/demos-PropertyCross.html) to learn more.

## Introduction

<img align="right" width="400px" src="https://www.codenameone.com/img/property-cross.png" alt="Property Cross">

[Codename One](https://www.codenameone.com) is an open source framework that lets Java developers build native apps for mobile devices. It's chief goal is to bring Java style WORA (Write Once Run Anywhere) into mobile development by leveraging a "Swing like" architecture.

[Codename One](https://www.codenameone.com) has ports for iOS, Android, Windows Phone (defunct), Universal Windows Platform (UWP - Windows 10/Mobile), JavaScript (with threads), Desktop (Mac/Windows) & RIM. It uses a cloud build system to convert the Java bytecode to native code and thus removes the need for a Mac machine or a Windows Machine (for UWP/Windows Phone) notice that [offline build](https://www.codenameone.com/blog/offline-build.html) is also supported.

You can read more about Codename One and its architecture in its [developer guide](https://www.codenameone.com/manual/).


## Building The application

You first need to install Codename One which is available for all 3 top Java IDE's (NetBeans, Eclipse & IntelliJ/IDEA). You can read the instructions [here](https://www.codenameone.com/download.html).

### The Really Easy Way

You can create a local version of this demo by using the new project wizard in the IDE and selecting:

`Codename One -> Demos -> Property Cross`.

### Building From Scratch

The project included is for NetBeans so you will need to install Codename One on top of NetBeans. You can open the project and update the missing jar resources from a newly created project.


## Application Structure

The application is a simple yet typical Codename One/NetBeans application, it has the following directories/files of interest:

- `build.xml` - ant build file used for the build scripts launched from the IDE.

- `src` - the full source of the application and its required resources.

- `src/theme.res` - theme and resource file containing a portable represntation of data.

- `icon.png` - a 512x512 icon that is automatically adapted to all device resolutions.

- `native` - this is unused for this demo as Property Cross doesn't require any native functionality. However, it can contain device specific native OS code if required.

- `lib` - contains basic libraries required as well as plugins/extensions. This demo doesn't need any libraries or extensions at this point so the lib directory has the default value.

## Further Reading

- [Codename One Developer Guide](https://www.codenameone.com/manual/)

- [JavaDocs](https://www.codenameone.com/javadoc/) - reference guide to Codename One methods/classes

- [Learn Mobile Programing by Examplw with Codename One](https://www.udemy.com/learn-mobile-programming-by-example-with-codename-one/) - a free Udemy course that covers an older version of this demo.
107 changes: 90 additions & 17 deletions codenameone/build.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--build_version=2.4-->
<!--build_version=3.0-->
<!--
This build script was generated by Codename One to build native mobile applications using Java.
To learn more about Codename One go to https://www.codenameone.com/
-->

<project name="PropertyCross" default="default" basedir=".">
<description>Builds, tests, and runs the project PropertyCross.</description>
<import file="nbproject/build-impl.xml"/>
<property file="codenameone_settings.properties"/>
<property name="automated" value="false" />
<taskdef name="codeNameOne" classname="com.codename1.build.client.CodeNameOneBuildTask" classpath="CodeNameOneBuildClient.jar"/>
<taskdef name="prepareTests" classname="com.codename1.build.client.PrepareTestsTask" classpath="CodeNameOneBuildClient.jar"/>
<taskdef name="installLibs" classname="com.codename1.build.client.InstallLibsTask" classpath="CodeNameOneBuildClient.jar"/>
<taskdef name="verifyDir" classname="com.codename1.build.client.VerifyDir" classpath="CodeNameOneBuildClient.jar"/>
<taskdef name="generateGuiSources" classname="com.codename1.build.client.GenerateGuiSources" classpath="CodeNameOneBuildClient.jar"/>

<target depends="init,compile,jar" name="compile-test">
<mkdir dir="${build.test.classes.dir}" />
<mkdir dir="${test.src.dir}" />
<javac destdir="${build.test.classes.dir}"
encoding="${source.encoding}"
source="1.5"
target="1.5"
source="1.8"
target="1.8"
bootclasspath="CLDC11.jar" excludes="${excludes}"
classpath="${javac.classpath}:${build.classes.dir}">
<src path="${test.src.dir}"/>
Expand Down Expand Up @@ -43,8 +50,8 @@
<mkdir dir="build/tmp"/>
<javac destdir="build/tmp"
encoding="${source.encoding}"
source="1.5"
target="1.5"
source="1.8"
target="1.8"
bootclasspath="lib/CLDC11.jar" excludes="${excludes}"
classpath="${javac.classpath}:${build.classes.dir}">
<src path="${src.dir}"/>
Expand Down Expand Up @@ -79,12 +86,13 @@
certPassword="${codename1.ios.debug.certificatePassword}"
provisioningProfile="${codename1.ios.debug.provision}"
appid="${codename1.ios.appid}"
automated="${automated}"
/>
</target>

<target name="test-for-ios-device" depends="clean,copy-ios-override,copy-libs,jar,clean-override">
<target name="test-for-ios-device" depends="clean,copy-ios-override,copy-libs,compile-test,clean-override">
<codeNameOne
jarFile="${dist.jar}"
jarFile="dist/unitTests.jar"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
Expand All @@ -98,12 +106,13 @@
certPassword="${codename1.ios.debug.certificatePassword}"
provisioningProfile="${codename1.ios.debug.provision}"
appid="${codename1.ios.appid}"
automated="${automated}"
/>
</target>

<target name="test-for-android-device" depends="clean,copy-android-override,copy-libs,jar,clean-override">
<target name="test-for-android-device" depends="clean,copy-android-override,copy-libs,compile-test,clean-override">
<codeNameOne
jarFile="${dist.jar}"
jarFile="dist/unitTests.jar"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
Expand All @@ -116,12 +125,13 @@
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/>
</target>

<target name="test-for-rim-device" depends="clean,copy-rim-override,copy-libs,jar,clean-override">
<target name="test-for-rim-device" depends="clean,copy-rim-override,copy-libs,compile-test,clean-override">
<codeNameOne
jarFile="${dist.jar}"
jarFile="dist/unitTests.jar"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
Expand All @@ -134,15 +144,16 @@
sigtoolDb="${codename1.rim.signtoolDb}"
certPassword="${codename1.rim.certificatePassword}"
sigtoolCsk="${codename1.rim.signtoolCsk}"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
</delete>
</target>

<target name="test-for-j2me-device" depends="clean,j2me-native-theme-init,copy-j2me-native,copy-j2me-override,copy-libs,jar,clean-j2me-native,clean-override">
<target name="test-for-j2me-device" depends="clean,j2me-native-theme-init,copy-j2me-native,copy-j2me-override,copy-libs,compile-test,clean-j2me-native,clean-override">
<codeNameOne
jarFile="${dist.jar}"
jarFile="dist/unitTests.jar"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
Expand All @@ -152,6 +163,7 @@
subtitle="${codename1.secondaryTitle}"
targetType="me"
buildArgs="build.unitTest=1"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
Expand All @@ -176,6 +188,7 @@
certPassword="${codename1.ios.release.certificatePassword}"
provisioningProfile="${codename1.ios.release.provision}"
appid="${codename1.ios.appid}"
automated="${automated}"
/>
</target>

Expand Down Expand Up @@ -217,6 +230,17 @@
</copy>
</target>

<target name="copy-javascript-override">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="override" />
<mkdir dir="native/javascript" />
<mkdir dir="lib/impl/native/javascript" />
<copy todir="${build.classes.dir}">
<fileset dir="native/javascript" includes="**/*"/>
<fileset dir="lib/impl/native/javascript" includes="**/*"/>
</copy>
</target>

<target name="copy-rim-override">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="override" />
Expand All @@ -234,6 +258,10 @@
<mkdir dir="${build.classes.dir}" />
<mkdir dir="override" />
<mkdir dir="lib/impl/native/javase" />
<copy todir="${build.classes.dir}">
<fileset dir="override" includes="**/*_tablet.ovr"/>
<fileset dir="override" includes="**/*_desktop.ovr"/>
</copy>
<copy todir="${build.classes.dir}">
<fileset dir="native/javase" includes="**/*"/>
<fileset dir="lib/impl/native/javase" includes="**/*"/>
Expand Down Expand Up @@ -277,9 +305,26 @@
keystoreAlias="${codename1.android.keystoreAlias}"
keystore="${codename1.android.keystore}"
certPassword="${codename1.android.keystorePassword}"
automated="${automated}"
/>
</target>

<target name="build-for-javascript" depends="clean,copy-javascript-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"

targetType="javascript"
automated="${automated}"
/>
</target>

<target name="build-for-rim-device" depends="clean,copy-rim-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
Expand All @@ -295,6 +340,7 @@
sigtoolDb="${codename1.rim.signtoolDb}"
certPassword="${codename1.rim.certificatePassword}"
sigtoolCsk="${codename1.rim.signtoolCsk}"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
Expand All @@ -313,6 +359,7 @@
subtitle="${codename1.secondaryTitle}"

targetType="desktop_macosx"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
Expand All @@ -331,6 +378,7 @@
subtitle="${codename1.secondaryTitle}"

targetType="desktop_windows"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
Expand All @@ -348,6 +396,7 @@
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"
targetType="me"
automated="${automated}"
/>
<delete>
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
Expand All @@ -368,14 +417,16 @@

<target name="-pre-init">
<property name="application.args" value="${codename1.packageName}.${codename1.mainName}"/>
<property name="javac.source" value="1.5" />
<property name="javac.target" value="1.5" />
<property name="javac.source" value="1.8" />
<property name="javac.target" value="1.8" />
<mkdir dir="native/javase" />
<mkdir dir="native/android" />
<mkdir dir="native/internal_tmp" />
<mkdir dir="native/ios" />
<mkdir dir="native/j2me" />
<mkdir dir="native/rim" />
<mkdir dir="native/win" />
<mkdir dir="native/javascript" />
<mkdir dir="lib/impl/cls" />
<mkdir dir="lib/impl/stubs" />
<mkdir dir="lib/impl/native" />
Expand All @@ -384,7 +435,9 @@
<mkdir dir="lib/impl/native/j2me" />
<mkdir dir="lib/impl/native/rim" />
<mkdir dir="lib/impl/native/win" />
<mkdir dir="lib/impl/native/javascript" />
<installLibs lib="lib" dest="lib/impl" />
<generateGuiSources srcDir="src" encoding="UTF-8" guiDir="res/guibuilder" />
</target>

<target name="-post-jar">
Expand All @@ -393,8 +446,8 @@
<mkdir dir="lib/impl/native/javase" />
<javac destdir="native/internal_tmp"
encoding="${source.encoding}"
source="1.5"
target="1.5"
source="1.8"
target="1.8"
bootclasspath="CLDC11.jar" excludes="${excludes}"
classpath="${javac.classpath}:${build.classes.dir}">
<src path="native/javase"/>
Expand Down Expand Up @@ -439,6 +492,26 @@
subtitle="${codename1.secondaryTitle}"

targetType="win"
automated="${automated}"
/>
</target>

<target name="build-for-windows-device" depends="clean,copy-windows-override,copy-libs,jar,clean-override">
<codeNameOne
jarFile="${dist.jar}"
displayName="${codename1.displayName}"
packageName = "${codename1.packageName}"
mainClassName = "${codename1.mainName}"
version="${codename1.version}"
icon="${codename1.icon}"
vendor="${codename1.vendor}"
subtitle="${codename1.secondaryTitle}"

certificate="${codename1.windows.certificate}"
certPassword="${codename1.windows.certificatePassword}"

targetType="windows"
automated="${automated}"
/>
</target>

Expand Down
11 changes: 6 additions & 5 deletions codenameone/codenameone_settings.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
#Mon Feb 02 21:36:10 EET 2015
#Fri Jun 17 07:57:40 IDT 2016
codename1.ios.appid=Q5GHSKAL2F.com.propertycross.codename1
codename1.ios.release.provision=
codename1.arg.rim.obfuscation=false
Expand All @@ -11,8 +11,8 @@ codename1.android.keystoreAlias=
codename1.ios.release.certificate=
codename1.android.keystorePassword=
codename1.ios.provision=
codename1.arg.ios.dsym=false
codename1.arg.android.release=true
codename1.arg.ios.dsym=false
codename1.arg.ios.statusbar_hidden=false
codename1.languageLevel=5
codename1.android.keystore=
Expand All @@ -26,19 +26,20 @@ codename1.ios.release.certificatePassword=
codename1.arg.ios.prerendered_icon=false
codename1.arg.vserv.scaleMode=false
codename1.ios.debug.certificate=
libVersion=81
libVersion=111
codename1.arg.ios.application_exits=false
codename1.secondaryTitle=CodenameOne_Template
codename1.description=
codename1.ios.debug.provision=
codename1.arg.j2me.nativeThemeConst=0
codename1.rim.certificatePassword=
codename1.version=1.0
codename1.version=1.1
codename1.ios.certificate=
codename1.icon=icon.png
codename1.rim.signtoolCsk=
codename1.arg.android.debug=false
codename1.rim.signtoolDb=
codename1.arg.vserv.transition=20000
codename1.rim.signtoolDb=
codename1.arg.ios.includePush=false
codename1.arg.ios.testFlight=false
codename1.packageName=com.propertycross.codename1
Binary file modified codenameone/lib/CLDC11.jar
Binary file not shown.
Binary file modified codenameone/lib/CodenameOne.jar
Binary file not shown.
Binary file modified codenameone/lib/CodenameOne_SRC.zip
Binary file not shown.
Loading

0 comments on commit 4b1901a

Please sign in to comment.