Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shannah committed Oct 12, 2021
2 parents 14a2fc4 + 8655a2a commit 4c7dd9c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 59 deletions.
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/layouts/GroupLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ int getBaselineResizeBehavior() {
if (!baselineSpring.isResizable(VERTICAL)) {
// Spring to use for baseline isn't resizable. In this case
// baseline resize behavior can be determined based on how
// preceeding springs resize.
// preceding springs resize.
boolean leadingResizable = false;
for (int i = 0, max = springs.size(); i < max; i++) {
Spring spring = getSpring(i);
Expand Down
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,47 @@ You can get started with the binary and the birds eye view in the [download sect

## Setup & Getting Started With The Code

NOTE: We are in the process of migrating from Ant to Maven, which simplifies the process for building from source. This section still refers to the process for building with Ant. See [Maven Quick Start](#maven) for the new Maven build instructions.
NOTE: *We are in the process of migrating from Ant to Maven, which simplifies the process for building from source.
See [Ant Quick Start](#quick-start-with-ant) for the legacy Ant build instructions.*

Setup is covered in depth in [this article and video](https://www.codenameone.com/blog/how-to-use-the-codename-one-sources.html). Notice that this covers debugging the simulator and working with the code that requires the Codename One plugin for NetBeans. You can install that by installing NetBeans and typing "Codename One" in the plugin search section see [the getting started tutorial](https://www.codenameone.com/getting-started.html).
The setup is covered in depth in [this article and video](https://www.codenameone.com/blog/building-codename-one-from-source-maven-edition.html).

<div>
<a href="http://www.youtube.com/watch?v=2nD75pODPWk " target="_blank"><img src="https://i.imgur.com/1lckS4d.png" alt="Using The Codename One Source Code" img width="80%"> </a>
<a href="https://www.youtube.com/watch?v=H8-QMIsTHNc " target="_blank"><img src="https://i.imgur.com/X0xzM6H.jpg" alt="Building Codename One from Source - Maven Edition
" img width="80%"> </a>
</div>

<br>
**IMPORTANT:** Building Codename One requires **JDK 8**, currently. You cannot use JDK 11 as some sub-modules must use `-source 1.5` and `-target 1.5` to maintain backward compatibility with parts of the toolchain.


### Quick Start with Maven

~~~~
git clone https://github.com/codenameone/CodenameOne
cd CodenameOne/maven
mvn install
~~~~

This will build and install Codename One in your local Maven repository. This process can take a while since it automatically downloads dependencies with a size of ~1GB.


To build the archetype projects from source, you should check out the [cn1-maven-archetypes](https://github.com/shannah/cn1-maven-archetypes) repository and build it also:

~~~~
git clone https://github.com/shannah/cn1-maven-archetypes
cd cn1-maven-archetypes
mvn install
~~~~


While Codename One itself works with all major IDE's the code in this repository was designed to work with NetBeans.
Now that Codename One is installed in your local Maven repository, you can use that version in a project instead of the release version.
A new testing project can be quickly generated with the [Codename One initializr](https://start.codenameone.com).

<img src="http://resources.jetbrains.com/storage/products/intellij-idea/img/meta/intellij-idea_logo_300x300.png" width="50"> &nbsp; &nbsp; <img src="http://codenameone.com/img/NetBeans-logo.png" width="120"> &nbsp; &nbsp; <img src="http://codenameone.com/img/eclipse-logo.png" width="120">
After downloading and extracting the project, open its pom.xml file and and look for the `<cn1.version>` and `<cn1.plugin.version>` properties.
Then change these to point to the version that got installed into your *local* maven repository by `mvn install`. The locally built version will usually be a SNAPSHOT version (e.g. 7.0.21-SNAPSHOT).

Please notice that while we fully support IntelliJ/IDEA (both CE and Ultimate), we don't support Android Studio which diverted too much from the mainline IDE.

### Quick Start
### Quick Start with Ant

**Getting and Building Sources**

Expand All @@ -209,30 +233,6 @@ You can launch the sample runner app from the command-line using:
$ ant samples
~~~

<a id="maven">

### Quick Start with Maven

IMPORTANT: Building Codename One requires JDK 8, currently. You cannot use JDK 11 as some sub-modules must use `-source 1.5` and `-target 1.5` to maintain backward compatibility with parts of the toolchain.

~~~~
git clone https://github.com/codenameone/CodenameOne
cd CodenameOne/maven
mvn install
~~~~

This will build and install Codename One in your local Maven repository.

To build the archetype projects from source, you should check out the [cn1-maven-archetypes](https://github.com/shannah/cn1-maven-archetypes) repository and build it also:

~~~~
git clone https://github.com/shannah/cn1-maven-archetypes
cd cn1-maven-archetypes
mvn install
~~~~

To get started building projects using Maven, see https://start.codenameone.com.


## ParparVM
Codename One's iOS VM is quite unique and is open source as well. You can read more about it [in its dedicated folder in this repository](https://github.com/codenameone/CodenameOne/tree/master/vm).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ public abstract class AbstractCN1Mojo extends AbstractMojo {
protected static final String GROUP_ID="com.codenameone";
protected static final String JAVA_RUNTIME_ARTIFACT_ID = "java-runtime";
protected static final String ARTIFACT_ID="codenameone-maven-plugin";


@Component
protected MavenProjectHelper projectHelper;
@Component

@Parameter( defaultValue = "${project}", readonly = true)
protected MavenProject project;

@Parameter(property = "project.build.directory", readonly = true)
Expand Down
31 changes: 9 additions & 22 deletions maven/parparvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand Down Expand Up @@ -99,6 +86,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<id>compile-java-api</id>
Expand All @@ -115,17 +111,9 @@
destdir="${project.build.directory}/api-classes"
failonerror="true"
/>

</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>make-bundle</id>
<phase>package</phase>
Expand All @@ -142,7 +130,6 @@
<zip destfile="${project.build.directory}/${project.build.finalName}-bundle.jar">
<fileset dir="${project.build.directory}/bundle"/>
</zip>

</target>
</configuration>
</execution>
Expand Down

0 comments on commit 4c7dd9c

Please sign in to comment.