Skip to main content

Source code file content

Revision: 130

Mavenised Jigsaw source drop of application6
» Project Revision History

» Checkout URL

svn / trunk / screensaver / build.xml

Size: 7631 bytes, 1 line
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2004-2005 Sun Microsystems, Inc. All rights reserved. Use is
  subject to license terms.
  This program is free software; you can redistribute it and/or modify
  it under the terms of the Lesser GNU General Public License as
  published by the Free Software Foundation; either version 2 of the
  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  General Public License for more details.
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA
-->
<!--
  - Main build file for bouncingline.
  -
  - Generated with SaverBeans SDK Startup Kit
  - http://jdic.dev.java.net/
-->
<project basedir="." default="win32-installer" name="worldclocksaver">
  <target name="properties">
    <property file="build.properties"/>
    <property file="${user.home}/build.properties"/>
    <property name="build" value="build"/>
    <property name="dist" value="dist"/>
    <property name="src" value="src"/>
    <property name="screensaver" value="worldclocksaver"/>
    <property name="screensaver.class" value="lh.worldclock.saver.WorldClockSaver"/>
    <!-- Values for the Windows installer -->
    <property name="productName" value="World Clock Screensaver"/>
    <property name="productVersion" value="0.7"/>
    <property name="productPublisher" value="Ludovic HOCHET"/>
    <property name="productWebSite" value="https://worldclock-application.dev.java.net/"/>
  </target>
  <target name="check" description="Check to make sure properties are set">
    <fail unless="saverbeans.path">
      Property saverbeans.path not found.  Please copy
      build.properties.sample to build.properties and
      follow the instructions in that file.
    </fail>
    <available file="${saverbeans.path}" property="saverbeans.present"/>
    <fail unless="saverbeans.present">
      Property saverbeans.path is invalid.  Please set
      it to the installation path of the SaverBeans SDK.
    </fail>
  </target>
  <target name="check-nsis" description="Check if NSIS is present">
    <fail unless="nsis.path">
      Property nsis.path not found.  Please copy
      build.properties.sample to build.properties and
      follow the instructions in that file.
    </fail>
    <available file="${nsis.path}" property="nsis.present"/>
    <fail unless="nsis.present">
      Property nsis.path is invalid.  Please set
      it to the installation path of NSIS.
    </fail>
  </target>
  <target name="define" description="Define custom tasks">
    <taskdef name="foreachscreensaver" classname="org.jdesktop.jdic.screensaver.autogen.ForEachScreensaver" classpath="${saverbeans.path}/saverbeans-ant.jar"/>
    <taskdef name="makewin32installscript" classname="org.jdesktop.jdic.screensaver.autogen.NsiGeneratorTask" classpath="${saverbeans.path}/saverbeans-ant.jar"/>
  </target>
  <target name="init" depends="properties,check,define"/>
  <target name="compile" depends="init" description="Compile the screensaver">
    <mkdir dir="${build}/share"/>
    <javac debug="on" destdir="${build}/share" srcdir="${src}/java" classpath="${saverbeans.path}/saverbeans-api.jar" source="1.6" target="1.6"/>
    <copy todir="${build}/share">
      <fileset dir="${src}/java">
        <exclude name="**/CVS"/>
        <exclude name="**/*.java"/>
      </fileset>
    </copy>
    <!-- Generate Makefile and Unix source distribution for each -->
    <mkdir dir="${build}/unix"/>
    <!--
      <foreachscreensaver confDir="${src}/conf" outDir="${build}/unix"
      os="unix" />
    -->
    <!-- Generate Windows .scr and binary distribution for each -->
    <mkdir dir="${build}/win32"/>
    <foreachscreensaver confDir="${src}/conf" outDir="${build}/win32" os="win32"/>
  </target>
  <!-- Create screensaver distribution -->
  <target name="dist" depends="compile">
    <mkdir dir="${build}/jar"/>
    <jar destfile="${build}/jar/${screensaver}.jar">
      <fileset dir="${build}/share"/>
    </jar>
    <!-- Create distribution for win32: -->
    <mkdir dir="${dist}/${screensaver}-win32"/>
    <copy todir="${dist}/${screensaver}-win32">
      <fileset dir="${saverbeans.path}">
        <include name="saverbeans-api.jar"/>
      </fileset>
      <fileset dir="${build}/jar">
        <include name="*.jar"/>
      </fileset>
      <fileset dir="${build}/win32">
        <include name="*.scr"/>
      </fileset>
      <fileset dir="${basedir}">
        <include name="COPYING"/>
      </fileset>
      <fileset dir="${src}/doc/win32">
        <include name="README.txt"/>
      </fileset>
    </copy>
    <zip destfile="${dist}/${screensaver}-win32-${productVersion}.zip" basedir="${dist}" includes="${screensaver}-win32/**"/>
    <!-- Create distribution for Unix: -->
    <mkdir dir="${dist}/${screensaver}-unix"/>
    <copy todir="${dist}/${screensaver}-unix">
      <fileset dir="${saverbeans.path}">
        <include name="saverbeans-api.jar"/>
      </fileset>
      <fileset dir="${build}/jar">
        <include name="*.jar"/>
      </fileset>
      <fileset dir="${src}/conf">
        <include name="*.xml"/>
      </fileset>
      <fileset dir="${build}/unix"/>
      <fileset dir="${basedir}">
        <include name="COPYING"/>
      </fileset>
      <fileset dir="${src}/doc/unix">
        <include name="README.txt"/>
      </fileset>
    </copy>
    <zip destfile="${dist}/${screensaver}-unix-${productVersion}.zip" basedir="${dist}" includes="${screensaver}-unix/**"/>
  </target>
  <target name="win32-installer" depends="init,check-nsis,dist">
    <mkdir dir="${build}/win32-installer"/>
    <makewin32installscript
      productName="${productName}"
      productVersion="${productVersion}"
      productPublisher="${productPublisher}"
      productWebSite="${productWebSite}"
      licenseFile="${basedir}/COPYING"
      outputFilename="${screensaver}-setup-${productVersion}.exe"
      saverbeansSdkPath="${saverbeans.path}"
      outFile="${build}/win32-installer/${screensaver}.nsi"
      jarDir="${build}/jar"
      scrDir="${build}/win32">
      <fileset dir="${src}/conf" includes="*.xml"/>
    </makewin32installscript>
    <!-- Launch makensis on script to create the installer -->
    <exec executable="${nsis.path}/makensis.exe" failonerror="true">
      <arg line="${build}/win32-installer/${screensaver}.nsi"/>
    </exec>
    <echo message="Screensaver Installer generated to: ${build}/win32-installer/${screensaver}-setup.exe"/>
  </target>
  <!--
    - Compile and debug screensaver in a JFrame.
    - Can optionally attach to process using your Java IDE.  Change
    - to suspend=y if you need to debug before the first frame.
    - Use the port number that the JVM gives you.
  -->
  <target name="debug" depends="compile">
    <java classname="org.jdesktop.jdic.screensaver.ScreensaverFrame" fork="true">
      <classpath>
        <pathelement location="${build}/share"/>
        <pathelement location="${saverbeans.path}/saverbeans-api.jar"/>
      </classpath>
      <jvmarg value="-Xdebug"/>
      <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n"/>
      <arg value="${screensaver.class}"/>
      <arg line="${debug.params}"/>
    </java>
  </target>
  <target name="clean" depends="init" description="Cleans all generated files">
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>
 
 
Close
loading
Please Confirm
Close