Skip to content

Commit

Permalink
Minor example updates; add deploy-example.xml build script.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pivot/trunk@987172 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Gregory K. Brown committed Aug 19, 2010
1 parent 98c7409 commit 12c1cd5
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 3 deletions.
109 changes: 109 additions & 0 deletions deploy-example.xml
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<project name="examples" default="deploy">
<property file="build.properties"/>

<property name="folder.src" value="src"/>
<property name="folder.bin" value="ant-bin"/>
<property name="folder.lib" value="lib"/>
<property name="folder.www" value="www"/>

<property name="example.path" value="org/apache/pivot/examples/deployment"/>

<!--
TODO Demonstrate three means of deployment:
1) Applet
2) Windows .exe
3) Mac OS X bundle
-->
<target name="compile">
<ant target="package"/>

<mkdir dir="${ant.project.name}/${folder.bin}"/>
<javac srcDir="${ant.project.name}/${folder.src}"
destDir="${ant.project.name}/${folder.bin}"
includejavaruntime="true"
includeantruntime="true"
deprecation="true"
debug="true"
target="1.6"
encoding="UTF-8"
failonerror="true">
<include name="${example.path}/**"/>
<classpath>
<fileset dir="lib" includes="*.jar"/>
</classpath>
</javac>
</target>

<target name="clean">
<ant target="clean"/>
<delete dir="${ant.project.name}/${folder.bin}"/>

<!-- TODO Delete generated .war, .exe, and .app files/directories -->
<delete dir="${ant.project.name}/${folder.www}"/>
</target>

<target name="deploy" depends="deploy-applet, deploy-windows, deploy-osx"/>

<!-- Packages example application for deployment via web browser -->
<target name="deploy-applet" depends="compile">
<mkdir dir="${ant.project.name}/${folder.www}"/>
<mkdir dir="${ant.project.name}/${folder.www}/lib"/>

<!-- Copy the platform JARs -->
<copy todir="${ant.project.name}/${folder.www}/lib">
<fileset dir="${folder.lib}">
<include name="pivot-core-${version}.jar"/>
<include name="pivot-wtk-${version}.jar"/>
<include name="pivot-wtk-terra-${version}.jar"/>
</fileset>
</copy>

<!-- Generate the example JAR -->
<jar destfile="${ant.project.name}/${folder.www}/lib/deployment-example.jar">
<fileset dir="${ant.project.name}/${folder.bin}"/>
<fileset dir="${ant.project.name}/${folder.src}">
<exclude name="**/*.java"/>
</fileset>
</jar>

<!-- Generate the host page -->
<copy file="${ant.project.name}/${folder.src}/${example.path}/index.html"
tofile="${ant.project.name}/${folder.www}/index.html">
<filterset>
<filter token="version" value="${version}"/>
</filterset>
</copy>

<!-- Generate the WAR file -->
<war destfile="${folder.lib}/deployment-example.war"
webxml="${ant.project.name}/${folder.src}/${example.path}/web.xml">
<fileset dir="${ant.project.name}/${folder.www}"/>
</war>
</target>

<!-- Packages example application for deployment via Windows executable -->
<target name="deploy-windows" depends="compile">
</target>

<!-- Packages example application for deployment via Mac OS X bundle -->
<target name="deploy-osx" depends="compile">
</target>
</project>
Expand Up @@ -38,7 +38,7 @@
width:"100%",
height:"100%"
};
var parameters = {application_class_name:"org.apache.pivot.examples.deployment",
var parameters = {application_class_name:"org.apache.pivot.examples.deployment.DeploymentExample",
codebase_lookup:false
};
var version = "1.6";
Expand Down
Expand Up @@ -39,7 +39,7 @@
import org.apache.pivot.wtk.ApplicationContext;
import org.apache.pivot.wtk.Window;

public class SwingDemo extends ApplicationContext {
public class SwingExample extends ApplicationContext {
public static class HostApplet extends JApplet {
private static final long serialVersionUID = 0;

Expand Down Expand Up @@ -152,7 +152,7 @@ private static void createPivotFrame() {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
Window window;
try {
window = (Window)bxmlSerializer.readObject(SwingDemo.class.getResource("pivot_window.bxml"));
window = (Window)bxmlSerializer.readObject(SwingExample.class.getResource("pivot_window.bxml"));
} catch (IOException exception) {
throw new RuntimeException(exception);
} catch (SerializationException exception) {
Expand Down

0 comments on commit 12c1cd5

Please sign in to comment.