Skip to content

Commit

Permalink
8347362: RichTextArea Demo Apps Build Script
Browse files Browse the repository at this point in the history
Reviewed-by: kcr
  • Loading branch information
Andy Goryachev committed Jan 13, 2025
1 parent b7b4d6e commit dcfe56b
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 2 deletions.
25 changes: 23 additions & 2 deletions apps/samples/RichTextAreaDemo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ for the purposes of demonstration of capabilities as well as testing.

## Building

Using Eclipse: import and run the project.
### Using Eclipse IDE

Import and run the project.



### Using Command Line

Execute `ant` command in this directory.



## Running Demos

Use the following commands to run demos build in the previous section:

Code Area Demo: `ant run-codearea-demo`

Notebook Demo: `ant run-notebook-demo`

Rich Editor Demo: `ant run-richeditor-demo`

RichTextArea Tester: `ant run-richtextarea-demo`

Using command line: TBD.
108 changes: 108 additions & 0 deletions apps/samples/RichTextAreaDemo/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This build requires javafx.home property, pointing to JavaFX SDK (23+) directory, e.g.:
ant -Djavafx.home=<DIR>
unless built as a part of openjfx repository where the default value is sufficient.
-->
<project default="build-all" basedir=".">

<!-- project config -->
<property name="TARGET" value="RichEditorDemo" />
<property name="MAIN_CLASS" value="com.oracle.demo.richtext.editor.RichEditorDemoApp"/>
<property name="javafx.home" value="../../../build/sdk" />

<target name="clean">
<delete includeEmptyDirs="true" dir="build" failonerror="false" />
<delete includeEmptyDirs="true" dir="dist" failonerror="false" />
</target>


<target name="init" depends="clean">
<mkdir dir="build" />
<mkdir dir="build/classes" />
<mkdir dir="build/jars" />
<mkdir dir="dist" />
</target>


<target name="compile" depends="init">
<javac
srcdir="src"
destdir="build/classes"
debug="true"
encoding="utf-8"
fork="true"
nowarn="true"
optimize="false"
source="23"
target="23"
includeantruntime="false"
>
<compilerarg value="-Xlint:none"/>
<compilerarg line="--module-path ${javafx.home}/lib --add-modules javafx.base,javafx.graphics,javafx.controls,jfx.incubator.input,jfx.incubator.richtext"/>
</javac>
</target>


<!-- copies non-java resources -->
<target name="copy-resources" depends="init">
<copy todir="build/classes">
<fileset dir="src" excludes="**/*.java" />
</copy>
</target>


<!-- builds the app jar -->
<target name="make-jar" depends="compile, copy-resources">
<delete file="build/jars/${TARGET}.jar" />

<jar jarfile="build/jars/${TARGET}.jar" basedir="build/classes" filesonly="true">
<manifest>
<attribute name="Main-Class" value="${MAIN_CLASS}" />
<attribute name="Created-By" value="andy@goryachev.com" />
</manifest>
</jar>
</target>


<!-- copies jar to base dir -->
<target name="copy-jar" depends="make-jar">
<copy file="build/jars/${TARGET}.jar" todir="dist/" />
</target>


<!-- builds all -->
<target name="build-all" depends="compile, copy-resources, make-jar, copy-jar" />


<target name="run-codearea-demo">
<exec executable="java">
<arg line="--module-path '${javafx.home}/lib' --add-modules 'javafx.base,javafx.graphics,javafx.controls,jfx.incubator.input,jfx.incubator.richtext' -classpath 'dist/${TARGET}.jar' com.oracle.demo.richtext.codearea.CodeAreaDemoApp" />
</exec>
</target>


<target name="run-notebook-demo">
<exec executable="java">
<arg line="--module-path '${javafx.home}/lib' --add-modules 'javafx.base,javafx.graphics,javafx.controls,jfx.incubator.input,jfx.incubator.richtext' -classpath 'dist/${TARGET}.jar' com.oracle.demo.richtext.notebook.NotebookMockupApp" />
</exec>
</target>


<target name="run-richeditor-demo">
<exec executable="java">
<arg line="--module-path ${javafx.home}/lib --add-modules javafx.base,javafx.graphics,javafx.controls,jfx.incubator.input,jfx.incubator.richtext -classpath dist/${TARGET}.jar com.oracle.demo.richtext.editor.RichEditorDemoApp" />
</exec>
</target>


<target name="run-richtextarea-demo">
<exec executable="java">
<arg line="--module-path ${javafx.home}/lib --add-modules javafx.base,javafx.graphics,javafx.controls,jfx.incubator.input,jfx.incubator.richtext -classpath dist/${TARGET}.jar com.oracle.demo.richtext.rta.RichTextAreaDemoApp" />
</exec>
</target>


<!-- alias to build-all target, to make it compatible with the rest of the apps -->
<target name="jar" depends="build-all" />
</project>

1 comment on commit dcfe56b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.