2008-10-21 07:17:43 +00:00
<?xml version='1.0'?>
2019-09-17 05:20:12 -07:00
<project name= "stendhal" default= "compile" basedir= "." xmlns:jacoco= "antlib:org.jacoco.ant"
2022-06-18 07:24:45 -07:00
xmlns:if="ant:if" xmlns:unless="ant:unless">
<!--
Sets a property (by name and value), or set of properties (from file or resource) in the project. Properties are case sensitive.
Properties are immutable: whoever sets a property first freezes it for the rest of the build; they are most definitely not variables.
-->
<property environment= "env" />
<condition property= "os.win" >
<os family= "windows" />
</condition>
<condition property= "exe.ext" value= ".exe" else= "" >
<equals arg1= "${os.win}" arg2= "true" />
</condition>
<condition property= "executable.npm" value= "npm.cmd" else= "npm" >
2022-06-18 11:39:39 -07:00
<equals arg1= "${os.win}" arg2= "true" />
2022-06-18 07:24:45 -07:00
</condition>
<!-- check for some executables -->
<available property= "python.present" file= "python${exe.ext}" filepath= "${env.PATH}" />
<available property= "python3.present" file= "python3${exe.ext}" filepath= "${env.PATH}" />
<property file= "build.ant-private.properties" />
<property file= "build.ant.properties" />
<property name= "build_tests" value= "${buildroot}/build_tests" />
<property name= "build_tests_report" value= "${buildroot}/build_test_report" />
<property name= "build_client" value= "${buildroot}/build_client" />
<property name= "build_client_data" value= "${buildroot}/build_client_data" />
<property name= "build_client_sound_data" value= "${buildroot}/build_client_sound_data" />
<property name= "build_client_music_data" value= "${buildroot}/build_client_music_data" />
2022-12-06 11:41:04 -08:00
2023-03-11 18:12:10 -08:00
<property name= "build_webclient" value= "${buildroot}/build_webclient" />
2022-12-03 14:11:04 +01:00
<property name= "build_docker" value= "${buildroot}/build_docker" />
<property name= "buildtools_docker" value= "buildtools/docker" />
2022-12-06 11:41:04 -08:00
2022-06-18 07:24:45 -07:00
<property name= "build_postman" value= "${buildroot}/buildbot/" />
<property name= "build_server" value= "${buildroot}/build_server" />
<property name= "build_server_maps" value= "${buildroot}/build_server_maps" />
<property name= "build_server_script" value= "${buildroot}/build_server_script" />
<property name= "build_server_mods" value= "${buildroot}/build_server_mods" />
<property name= "build_server_xmlconf" value= "${buildroot}/build_server_xmlconf" />
<property name= "build_stendhaltools" value= "${buildroot}/build_stendhaltools" />
<property name= "build_stendhaltextclient" value= "${buildroot}/build_stendhaltextclient" />
<property name= "client_data" value= "stendhal-data-${version}.jar" />
<property name= "client_jarname" value= "stendhal-${version}.jar" />
<property name= "client_sound_data" value= "stendhal-sound-data-${version}.jar" />
<property name= "client_music_data" value= "stendhal-music-data-${version}.jar" />
<property name= "client_starter_jarname" value= "stendhal-starter-${version}.jar" />
2022-12-06 11:41:04 -08:00
2022-12-03 14:11:04 +01:00
<property name= "dist_server_binary" value= "${buildroot}/stendhal-server-${version}.zip" />
2022-06-18 07:24:45 -07:00
<property name= "maps_jarname" value= "stendhal-maps-${version}.jar" />
<property name= "server_jarname" value= "stendhal-server-${version}.jar" />
<property name= "xmlconf_jarname" value= "stendhal-xmlconf-${version}.jar" />
<property name= "config_dir" value= "data/conf" />
<property name= "schema_location" value= "${config_dir}" />
2022-06-18 11:39:39 -07:00
<property name= "cobertura.dir" value= "${libdir}/cobertura" />
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
<import file= "build-private.xml" optional= "true" />
2022-06-18 07:24:45 -07:00
<condition property= "exclude.signing" value= "true" >
<not >
<available file= "keystore.ks" />
</not>
</condition>
<condition property= "exclude.jardiff" value= "true" >
<not >
<available file= "${build-archive}/stendhal-${version.old}.zip" />
</not>
</condition>
2022-10-26 17:28:15 +02:00
<!-- On Microsoft Windows binary files do not have to be on $env.PATH,
2022-12-06 11:41:04 -08:00
so this check does not work.
2022-06-18 07:24:45 -07:00
<condition property= "exclude.webclient" value= "true" >
<not >
<available file= "${executable.npm}" filepath= "${env.PATH}" />
</not>
</condition>
2022-10-26 17:28:15 +02:00
-->
2022-06-18 07:24:45 -07:00
<!-- Windows fails to execute "ng" unless it is invoked as "ng.cmd" -->
<condition property= "executable.suffix" value= ".cmd" >
2022-06-18 11:39:39 -07:00
<os family= "windows" />
2022-06-18 07:24:45 -07:00
</condition>
2022-06-18 11:39:39 -07:00
<property name= "executable.suffix" value= "" />
2022-06-18 07:24:45 -07:00
<tstamp >
2022-06-18 11:39:39 -07:00
<format property= "timestamp" pattern= "yyyy-MM-dd HH:mm:ss" />
2022-06-18 07:24:45 -07:00
</tstamp>
<condition property= "doxygen.fix_urls" value= "true" >
<and >
<equals arg1= "${python.present}" arg2= "true" />
<available file= "buildtools/doxygen/fix_urls.py" />
</and>
</condition>
<!-- Android properties -->
<condition property= "exclude.webview" value= "true" >
<and >
<not >
2022-06-18 11:39:39 -07:00
<isset property= "env.ANDROID_SDK_ROOT" />
2022-06-18 07:24:45 -07:00
</not>
<not >
2022-06-18 11:39:39 -07:00
<available file= "${user.dir}/android/local.properties" />
2022-06-18 07:24:45 -07:00
</not>
</and>
</condition>
<!-- END: Android properties -->
2022-06-18 08:52:44 -07:00
<!-- START: maintenance -->
2022-06-18 07:24:45 -07:00
<target name= "init" >
<mkdir dir= "${lib}" />
<!-- We update the version number -->
<replaceregexp file= "${src}/games/stendhal/common/Debug.java"
match="String VERSION ?= ?" .*" ;"
replace="String VERSION = " ${version}" ;"
byline="true"/>
<replaceregexp file= "${src}/games/stendhal/server/core/engine/GenerateINI.java"
match="out.println\(" server_version=.*" \);"
replace="out.println(" server_version=${version}" );"
byline="true"/>
<replaceregexp file= "runserver.bat"
match="STENDHAL_VERSION=.*"
replace="STENDHAL_VERSION=${version}"
byline="true"/>
<replaceregexp file= "runserver.sh"
match="STENDHAL_VERSION ?= ?" .*" "
replace="STENDHAL_VERSION=" ${version}" "
byline="true"/>
<replaceregexp file= "buildtools/doxygen/Doxyfile"
match="^PROJECT_NUMBER .*$"
replace="PROJECT_NUMBER = ${version}"
byline="true"/>
<!-- Update location of resources -->
<replaceregexp file= "${src}/games/stendhal/client/update/game-default.properties"
match="GAME_NAME=.*"
replace="GAME_NAME=${game_name}"
byline="true"/>
<replaceregexp file= "${src}/games/stendhal/client/update/game-default.properties"
match="DEFAULT_SERVER=.*"
replace="DEFAULT_SERVER=${default_server}"
byline="true"/>
<replaceregexp file= "${src}/games/stendhal/client/update/game-default.properties"
match="UPDATE_SERVER_FOLDER=.*"
replace="UPDATE_SERVER_FOLDER=${updates_server}"
byline="true"/>
<replaceregexp file= "${src}/games/stendhal/client/update/game-default.properties"
match="UPDATE_SERVER_FOLDER_FALLBACK=.*"
replace="UPDATE_SERVER_FOLDER_FALLBACK=${updates_server_fallback}"
byline="true"/>
<replaceregexp file= "${src}/games/stendhal/client/update/game-default.properties"
match="UPDATE_VERSION_CHECK=.*"
replace="UPDATE_VERSION_CHECK=${version_server}"
byline="true"/>
<replaceregexp file= "stendhal.jnlp"
match="-0\..*\.jar" "
replace="-${version}.jar" "
byline="true"/>
<!-- pre release version -->
<replaceregexp file= "${src}/games/stendhal/common/Debug.java"
match="String PRE_RELEASE_VERSION ?= .*;"
replace="String PRE_RELEASE_VERSION = null;"
byline="true"/>
2022-06-18 11:39:39 -07:00
<antcall target= "internalUpdatePrereleaseVersion" />
2022-06-18 07:24:45 -07:00
</target>
2022-06-18 08:52:44 -07:00
<target name= "checkxml" description= "Verify XML files are well-formed" >
<schemavalidate failonerror= "yes" lenient= "yes" warn= "yes" >
<schema namespace= "stendhal" file= "${config_dir}/zones.xsd" />
<fileset dir= "${config_dir}/zones" >
<include name= "*.xml" />
</fileset>
</schemavalidate>
<schemavalidate >
2023-01-18 03:01:44 -08:00
<schema namespace= "stendhal" file= "${config_dir}/creatures.xsd" />
2022-06-18 08:52:44 -07:00
<fileset dir= "${config_dir}/creatures" >
2022-06-18 11:39:39 -07:00
<include name= "*.xml" />
2022-06-18 08:52:44 -07:00
</fileset>
</schemavalidate>
<schemavalidate >
2022-06-18 11:39:39 -07:00
<schema namespace= "stendhal" file= "${config_dir}/items.xsd" />
2022-06-18 08:52:44 -07:00
<fileset dir= "data/conf/items" >
<include name= "*.xml" />
<exclude name= "armors.xml" />
<exclude name= "arrows.xml" />
<exclude name= "axes.xml" />
<exclude name= "boots.xml" />
<exclude name= "cloaks.xml" />
<exclude name= "clubs.xml" />
<exclude name= "dummy_weapons.xml" />
<exclude name= "helmets.xml" />
<exclude name= "legs.xml" />
2023-03-04 17:39:17 -08:00
<exclude name= "meta.xml" />
2022-06-18 08:52:44 -07:00
<exclude name= "missiles.xml" />
<exclude name= "ranged.xml" />
<exclude name= "rings.xml" />
<exclude name= "shields.xml" />
<exclude name= "swords.xml" />
2023-01-17 21:19:18 -08:00
<exclude name= "whips.xml" />
2022-06-18 08:52:44 -07:00
</fileset>
</schemavalidate>
<schemavalidate >
2022-06-18 11:39:39 -07:00
<schema namespace= "stendhal" file= "${config_dir}/equipment.xsd" />
2022-06-18 08:52:44 -07:00
<fileset dir= "data/conf/items" >
<include name= "armors.xml" />
<include name= "arrows.xml" />
<include name= "boots.xml" />
<include name= "cloaks.xml" />
<include name= "dummy_weapons.xml" />
<include name= "helmets.xml" />
<include name= "legs.xml" />
<include name= "missiles.xml" />
<include name= "rings.xml" />
<include name= "shields.xml" />
2023-01-18 03:01:44 -08:00
</fileset>
</schemavalidate>
<schemavalidate >
<schema namespace= "stendhal" file= "${config_dir}/weapons.xsd" />
<fileset dir= "${config_dir}/items" >
<include name= "axes.xml" />
<include name= "clubs.xml" />
<include name= "ranged.xml" />
2022-06-18 08:52:44 -07:00
<include name= "swords.xml" />
2023-01-17 21:19:18 -08:00
<include name= "whips.xml" />
2022-06-18 08:52:44 -07:00
</fileset>
</schemavalidate>
<schemavalidate >
<schema namespace= "stendhal" file= "${config_dir}/groups.xsd" />
<fileset dir= "${config_dir}" >
<filename name= "zones.xml" />
<filename name= "items.xml" />
<filename name= "creatures.xml" />
2023-02-17 03:56:03 -08:00
<filename name= "shops.xml" />
2022-06-18 08:52:44 -07:00
</fileset>
</schemavalidate>
<schemavalidate >
<schema namespace= "stendhal" file= "${config_dir}/shops.xsd" />
2023-02-17 03:56:03 -08:00
<fileset dir= "${config_dir}/shops" >
<include name= "*.xml" />
2022-06-18 08:52:44 -07:00
</fileset>
</schemavalidate>
</target> <!-- checkxml -->
2022-06-18 07:24:45 -07:00
<target name= "internalUpdatePrereleaseVersion" if= "PRE_RELEASE" >
<tstamp prefix= "date" >
2022-06-18 11:39:39 -07:00
<format property= "iso" pattern= "yyyy-MM-dd" />
2022-06-18 07:24:45 -07:00
</tstamp>
<replaceregexp file= "${src}/games/stendhal/common/Debug.java"
match="String PRE_RELEASE_VERSION ?= .*;"
replace="String PRE_RELEASE_VERSION = " PRE_RELEASE ${date.iso}" ;"
byline="true"/>
</target>
2022-06-18 08:52:44 -07:00
<target name= "clean" description= "Empties build directory" >
2022-06-18 11:39:39 -07:00
<delete dir= "${buildroot}" />
2022-06-18 07:24:45 -07:00
<delete dir= "${build_cobertura}" />
<delete dir= "${build_cobertura_report}" />
2022-06-18 11:39:39 -07:00
<delete file= "cobertura.ser" />
<delete dir= "android/app/build/" />
2022-06-18 07:24:45 -07:00
<delete >
2022-06-18 11:39:39 -07:00
<fileset dir= "." >
<include name= "TEST-*.xml" />
</fileset>
2022-06-18 07:24:45 -07:00
</delete>
</target>
2022-06-18 08:52:44 -07:00
<target name= "clean_client_data" >
<delete dir= "${build_client_data}" />
<delete dir= "${build_client_music_data}" />
<delete dir= "${build_client_sound_data}" />
</target>
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "cleanjs" >
<delete dir= "${buildroot}/js" />
<delete dir= "${buildroot}/ts" />
</target>
2022-06-18 07:24:45 -07:00
2023-05-16 23:16:24 -07:00
<target name= "clean_javadocs" description= "Delete javadoc generated HTML documentation." >
2022-06-18 11:39:39 -07:00
<delete dir= "${docs}" />
2022-06-18 07:24:45 -07:00
</target>
2023-05-16 23:16:24 -07:00
<target name= "clean_mkdocs" description= "Delete MkDocs generated HTML documentation." >
2022-06-18 11:39:39 -07:00
<delete dir= "${buildroot}/mkdocs/" />
2022-06-18 08:52:44 -07:00
</target>
2022-06-18 07:24:45 -07:00
2023-05-16 23:16:24 -07:00
<target name= "clean_doxygen" description= "Delete Doxygen generated HTML documentation." >
2022-06-18 11:39:39 -07:00
<delete dir= "${buildroot}/doxygen" />
2022-06-18 08:52:44 -07:00
</target>
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
<target name= "clean_whitespace" description= "cleans whitespace in source and other specified file types" depends= "compile_stendhaltools" >
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<java classname= "games.stendhal.tools.CleanWhitespace" >
<classpath >
2022-06-18 11:39:39 -07:00
<pathelement path= "${build_stendhaltools}" />
2022-06-18 08:52:44 -07:00
</classpath>
2022-06-18 11:39:39 -07:00
<arg value= "src/" />
<arg value= "tests/" />
<arg value= "android/app/src/" />
<arg value= "java,xml,lua" />
2022-06-18 08:52:44 -07:00
</java>
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<java classname= "games.stendhal.tools.CleanWhitespace" >
2022-06-18 07:24:45 -07:00
<classpath >
2022-06-18 11:39:39 -07:00
<pathelement path= "${build_stendhaltools}" />
2022-06-18 07:24:45 -07:00
</classpath>
2022-06-18 11:39:39 -07:00
<arg value= "srcjs/" />
<arg value= "js,ts,css" />
2022-06-18 08:52:44 -07:00
</java>
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<java classname= "games.stendhal.tools.CleanWhitespace" >
<classpath >
2022-06-18 11:39:39 -07:00
<pathelement path= "${build_stendhaltools}" />
2022-06-18 08:52:44 -07:00
</classpath>
2022-06-18 11:39:39 -07:00
<arg value= "data/" />
<arg value= "tiled/" />
<arg value= "xml,xsd,lua,py" />
2022-06-18 08:52:44 -07:00
</java>
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
</target> <!-- clean_whitespace -->
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
<target name= "cleanwhitespace" depends= "clean_whitespace" description= "Alias for clean_whitespace" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "rendermaps" description= "Converts the *.tmx files to PNG images scaled 1:16" depends= "compile_stendhaltools" >
<taskdef name= "maprenderer" classname= "games.stendhal.tools.MapRenderer" >
<classpath >
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${tiled_jar}" />
</classpath>
</taskdef>
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<mkdir dir= "tiled/world" />
<maprenderer imagePath= "${tiled}/world/" >
<fileset dir= "tiled" >
<include name= "Level */**/*.tmx" />
<include name= "interiors/**/*.tmx" />
2022-06-18 11:39:39 -07:00
<exclude name= "**/memory/**" />
2022-06-18 08:52:44 -07:00
</fileset>
</maprenderer>
</target> <!-- rendermaps -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "renderatlas" description= "Generates the files for the Stendhal Atlas" depends= "compile_stendhaltools" >
<taskdef name= "maprenderer" classname= "games.stendhal.tools.MapRenderer" >
2022-06-18 07:24:45 -07:00
<classpath >
2022-06-18 08:52:44 -07:00
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${tiled_jar}" />
2022-06-18 07:24:45 -07:00
</classpath>
2022-06-18 08:52:44 -07:00
</taskdef>
<!--
7 1 1
6 2 0.5
5 4 0.25
4 8 0.125
3 16 0.0625
2 32 0.03125
1 64 0.015625
0 128 0.0078125
-->
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
<mkdir dir= "tiled/world" />
2022-06-18 08:52:44 -07:00
<maprenderer imagePath= "${tiled}/world/" zoom= "0.0625" >
<fileset dir= "tiled" >
<include name= "Level 0/**/*.tmx" />
2022-06-18 11:39:39 -07:00
<exclude name= "**/memory/**" />
2022-06-18 07:24:45 -07:00
</fileset>
2022-06-18 08:52:44 -07:00
</maprenderer>
2022-06-18 11:39:39 -07:00
<mkdir dir= "tiled/world/large" />
2022-06-18 08:52:44 -07:00
<maprenderer imagePath= "${tiled}/world/large" zoom= "0.25" >
<fileset dir= "tiled" >
<include name= "Level 0/**/*.tmx" />
2022-06-18 11:39:39 -07:00
<exclude name= "**/memory/**" />
2022-06-18 08:52:44 -07:00
</fileset>
</maprenderer>
</target> <!-- renderatlas -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "renderworldmap" description= "Exports the world.tmx file to .png" depends= "rendermaps" >
<property name= "pycmd" value= "python3" if:true= "${python3.present}" />
<property name= "pycmd" value= "python" unless:true= "${python3.present}" if:true= "${python.present}" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<!-- embed area images with area name -->
<!-- FIXME: need to detect the Python "PIL" module to ensure script can run or
write Java class that can do this -->
<exec executable= "${pycmd}" if:set= "pycmd" >
<arg value= "./tiled/vampire_maplabel.py" />
<arg value= "-world" />
</exec>
<!-- render world map after images have been embedded with map names -->
<!-- FIXME: this should be skipped if previous Python script was not run -->
<taskdef name= "maprenderer" classname= "games.stendhal.tools.MapRenderer" >
<classpath >
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${tiled_jar}" />
</classpath>
</taskdef>
<maprenderer imagePath= "${tiled}/world/" zoom= "1.0" >
<fileset dir= "tiled/world" >
<include name= "world.tmx" />
</fileset>
</maprenderer>
<!-- FIXME: should 'rendermaps' be called again to remove labels from individual images? -->
</target> <!-- renderworldmap -->
<target name= "updatemaps" description= "Load and save TMX files to fix tilesets changes." depends= "compile_stendhaltools" >
<taskdef name= "mapupdater" classname= "games.stendhal.tools.MapUpdater" >
<classpath >
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${tiled_jar}" />
</classpath>
</taskdef>
<mapupdater >
<fileset dir= "tiled" >
<include name= "Level */**/*.tmx" />
<include name= "interiors/**/*.tmx" />
</fileset>
</mapupdater>
</target> <!-- updatemaps -->
<!-- END: maintenance -->
2022-06-18 11:25:02 -07:00
<target name= "jar" depends= "client_build,server_build" description= "Builds client and server" >
2022-06-18 08:52:44 -07:00
<echo > Built client and server for NetBeans.</echo>
</target>
<target name= "signjar" unless= "exclude.signing" >
<signjar
alias="${keystore.alias}"
keystore="keystore.ks"
storepass="${keystore.password}"
2022-06-18 11:39:39 -07:00
jar="${lib}/${client_starter_jarname}"/>
2022-06-18 08:52:44 -07:00
</target>
<target name= "compile" depends= "server_build, client_build, server_build" description= "Generates JAR files for both client and server" />
2022-12-03 14:43:20 +01:00
<target name= "dist" depends= "clean, dist_binary, dist_source, signupdates" description= "Creates all the packages needed for a Stendhal release" />
2022-06-18 08:52:44 -07:00
2022-06-18 11:16:58 -07:00
<target name= "dist_binary" depends= "clean, dist_server_binary, dist_client_binary, dist_client_starter, dist_webclient_binary, dist_client_android" />
2022-06-18 08:52:44 -07:00
<!-- START: source -->
<target name= "dist_source" >
<mkdir dir= "${buildroot}/stendhal-${version}-src" />
<copy todir= "${buildroot}/stendhal-${version}-src/src" >
<fileset dir= "src" />
</copy>
<mkdir dir= "${buildroot}/stendhal-${version}-src/libs" />
<copy todir= "${buildroot}/stendhal-${version}-src/libs" >
<fileset dir= "libs" />
</copy>
<copy todir= "${buildroot}/stendhal-${version}-src/tests" >
<fileset dir= "tests" />
</copy>
<copy todir= "${buildroot}/stendhal-${version}-src/data" >
<fileset dir= "data" >
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-${version}-src/tiled" >
<fileset dir= "${tiled}" >
2022-06-18 11:39:39 -07:00
<exclude name= "world/**" />
2022-06-18 08:52:44 -07:00
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-${version}-src" file= "build.xml" />
<copy todir= "${buildroot}/stendhal-${version}-src" file= "build.ant.properties" />
<copy todir= "${buildroot}/stendhal-${version}-src" file= "README.md" />
<copy todir= "${buildroot}/stendhal-${version}-src" file= "LICENSE.txt" />
<copy todir= "${buildroot}/stendhal-${version}-src" file= "runserver.bat" />
<copy todir= "${buildroot}/stendhal-${version}-src" file= "runserver.sh" />
<copy todir= "${buildroot}/stendhal-${version}-src/lib" >
<fileset dir= "libs" >
<include name= "*.txt" />
<include name= "*.html" />
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-${version}-src/doc" >
<fileset dir= "doc" />
<fileset dir= "." includes= "LICENSE.txt" />
</copy>
<tar destfile= "${buildroot}/stendhal-${version}-src.tar.gz" compression= "gzip" longfile= "gnu" >
<tarfileset dir= "${buildroot}/stendhal-${version}-src" prefix= "stendhal-${version}" >
<exclude name= "**/CVS/**" />
</tarfileset>
</tar>
<delete dir= "${buildroot}/stendhal-${version}-src" />
</target> <!-- dist_source -->
<!-- END: source -->
<!-- START: server -->
<target name= "server_build" depends= "init,checkxml" description= "Build JAR file for Stendhal server" >
<mkdir dir= "${build_server}" />
<copy todir= "${build_server}/data/conf" file= "data/conf/stendhalcreateaccount.properties" />
<copy todir= "${build_server}/games/stendhal/server" file= "${src}/games/stendhal/server/stendhal_init.sql" />
<copy todir= "${build_server}/games/stendhal/common" >
<fileset dir= "${src}/games/stendhal/common" >
<include name= "**/*.txt" />
</fileset>
</copy>
<javac srcdir= "${src}" destdir= "${build_server}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/common/*.java" />
<include name= "games/stendhal/common/**/*.java" />
<include name= "games/stendhal/server/*.java" />
<include name= "games/stendhal/server/**/*.java" />
<exclude name= "games/stendhal/server/maps/**" />
<exclude name= "games/stendhal/server/script/**" />
<include name= "games/stendhal/tools/tiled/LayerDefinition.java" />
<include name= "games/stendhal/tools/tiled/ServerTMXLoader.java" />
<include name= "games/stendhal/tools/tiled/StendhalMapStructure.java" />
<include name= "games/stendhal/tools/tiled/TileSetDefinition.java" />
<include name= "games/stendhal/tools/test/LineAnalyser.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${simple_jar}" />
<pathelement path= "${guava_jar}" />
<pathelement path= "${luaj_jar}" />
</classpath>
</javac>
<!-- built - in Lua scripts -->
<copy todir= "${build_server}/games/stendhal/server/core/scripting/lua" >
<fileset dir= "${src}/games/stendhal/server/core/scripting/lua" >
<include name= "**/*.lua" />
</fileset>
</copy>
2023-03-08 22:24:52 +01:00
<path id= "serverclasspathlist" >
<fileset dir= "libs" >
<include name= "**/*.jar" />
<exclude name= "**/marauroa-client-only.jar" />
</fileset>
</path>
<pathconvert property= "serverclasspath" pathsep= " " >
<path refid= "serverclasspathlist" />
<regexpmapper from= "^.*/([^/]*)$$" to= "libs/\1" />
</pathconvert>
2022-06-18 08:52:44 -07:00
<jar jarfile= "${lib}/${server_jarname}" basedir= "${build_server}" >
<manifest >
<attribute name= "Main-Class" value= "games.stendhal.server.StendhalServer" />
2023-03-08 22:24:52 +01:00
<attribute name= "Class-path" value= ". ${maps_jarname} ${xmlconf_jarname} ${serverclasspath}" />
2022-06-18 08:52:44 -07:00
</manifest>
</jar>
<chmod file= "${lib}/${server_jarname}" perm= "+x" />
<mkdir dir= "${build_server_maps}" />
<javac srcdir= "${src}" destdir= "${build_server_maps}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/server/maps/*.java" />
<exclude name= "games/stendhal/server/maps/ZoneConfigurator.java" />
<include name= "games/stendhal/server/maps/**/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
<pathelement path= "${build_server}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${guava_jar}" />
</classpath>
</javac>
<copy todir= "${build_server_maps}/data/maps" >
<fileset dir= "${tiled}" >
<include name= "**/*.tmx" />
</fileset>
</copy>
<jar jarfile= "${lib}/${maps_jarname}" basedir= "${build_server_maps}" />
<mkdir dir= "${build_server_xmlconf}" />
<copy todir= "${build_server_xmlconf}/data/conf" >
<fileset dir= "data/conf" >
2022-06-18 07:24:45 -07:00
<include name= "creatures.xml" />
<include name= "creatures/*.xml" />
<include name= "items.xml" />
<include name= "items/*.xml" />
<include name= "zones.xml" />
<include name= "zones/*.xml" />
<include name= "riddles-example.xml" />
2022-06-18 11:39:39 -07:00
<include name= "spells.xml" />
<include name= "spells/*.xml" />
<include name= "shops.xml" />
2023-02-17 03:56:03 -08:00
<include name= "shops/*.xml" />
2023-03-04 17:39:17 -08:00
<exclude name= "items/meta.xml" />
2022-06-18 07:24:45 -07:00
</fileset>
</copy>
<copy todir= "${build_server_xmlconf}/data/languages" >
2022-06-18 11:39:39 -07:00
<fileset dir= "data/languages" />
2022-06-18 07:24:45 -07:00
</copy>
<jar jarfile= "${lib}/${xmlconf_jarname}" basedir= "${build_server_xmlconf}" />
<mkdir dir= "${build_server_script}" />
2022-06-18 11:39:39 -07:00
<javac srcdir= "${src}" destdir= "${build_server_script}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
2022-06-18 07:24:45 -07:00
<include name= "games/stendhal/server/script/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${simple_jar}" />
<pathelement path= "${guava_jar}" />
<pathelement path= "${lib}/${server_jarname}" />
<pathelement path= "${lib}/${maps_jarname}" />
</classpath>
</javac>
<!-- data Groovy & Lua scripts -->
<copy todir= "${build_server_script}" >
<fileset dir= "data/script" >
<include name= "**/*" />
</fileset>
</copy>
<!-- Lua mods -->
<!--
<mkdir dir= "${build_server_mods}" />
<copy todir= "${build_server_mods}" >
<fileset dir= "data/mods" >
<include name= "**/*" />
</fileset>
</copy>
-->
2022-06-18 08:52:44 -07:00
</target> <!-- server_build -->
2022-06-18 07:24:45 -07:00
2023-03-11 20:30:34 -08:00
<target name= "dist_server_binary" depends= "server_build" >
2022-06-18 08:52:44 -07:00
<mkdir dir= "${buildroot}/stendhal-server-${version}" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<copy todir= "${buildroot}/stendhal-server-${version}/data/script" >
<fileset dir= "${buildroot}/build_server_script" >
<include name= "games/stendhal/server/script/**.*" />
<include name= "**/*" />
</fileset>
</copy>
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<!--
<copy todir= "${buildroot}/stendhal-server-${version}/data/mods" >
<fileset dir= "${build_server_mods}" >
<include name= "**/*" />
</fileset>
2022-06-18 07:24:45 -07:00
</copy>
2022-06-18 08:52:44 -07:00
-->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<copy todir= "${buildroot}/stendhal-server-${version}" file= "${lib}/${server_jarname}" />
<copy todir= "${buildroot}/stendhal-server-${version}" file= "${lib}/${maps_jarname}" />
<copy todir= "${buildroot}/stendhal-server-${version}" file= "${lib}/${xmlconf_jarname}" />
<copy todir= "${buildroot}/stendhal-server-${version}" file= "runserver.sh" />
<copy todir= "${buildroot}/stendhal-server-${version}" file= "runserver.bat" />
2023-03-08 22:24:52 +01:00
<copy todir= "${buildroot}/stendhal-server-${version}/libs" >
2022-06-18 08:52:44 -07:00
<fileset dir= "libs" >
2023-03-08 22:24:52 +01:00
<exclude name= "marauroa-client-only.jar" />
2022-06-18 08:52:44 -07:00
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-server-${version}/doc" >
<fileset dir= "doc" >
<exclude name= "mkdocs/" />
</fileset>
<fileset dir= "." includes= "LICENSE.txt" />
2022-06-18 07:24:45 -07:00
</copy>
2022-06-18 08:52:44 -07:00
<copy todir= "${buildroot}/stendhal-server-${version}/data/conf" file= "data/conf/admins.txt" />
2023-03-11 20:30:34 -08:00
<antcall target= "webclient_build" unless:set= "exclude.webclient" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<copy todir= "${buildroot}/stendhal-server-${version}" file= "README.md" />
2022-06-18 11:39:39 -07:00
<mkdir dir= "${buildroot}/stendhal-server-${version}/log" />
<touch file= "${buildroot}/stendhal-server-${version}/log/empty" />
2022-12-03 14:11:04 +01:00
<zip destfile= "${dist_server_binary}" >
2022-06-18 08:52:44 -07:00
<zipfileset dir= "${buildroot}/stendhal-server-${version}" excludes= "${server_jarname}" />
<zipfileset dir= "${buildroot}/stendhal-server-${version}" includes= "${server_jarname}" filemode= "755" />
2023-03-11 20:30:34 -08:00
<!-- webclient files -->
<zipfileset dir= "${build_client_data}" unless:set= "exclude.webclient" />
<zipfileset dir= "${build_client_music_data}" unless:set= "exclude.webclient" />
<zipfileset dir= "${build_client_sound_data}" unless:set= "exclude.webclient" />
<zipfileset dir= "${build_webclient}" prefix= "js" unless:set= "exclude.webclient" />
2022-06-18 08:52:44 -07:00
</zip>
<delete dir= "${buildroot}/stendhal-server-${version}" />
2023-03-11 20:30:34 -08:00
<delete dir= "${build_webclient}" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
</target> <!-- dist_server_binary -->
2022-12-06 11:41:04 -08:00
2022-12-03 14:11:04 +01:00
<target name= "dist_docker" depends= "docker_build,docker_push" description= "Builds and pushes the container images" />
2022-12-06 11:41:04 -08:00
2022-12-03 14:11:04 +01:00
<target name= "docker_build_prepare" depends= "dist_server_binary" description= "Prepares container image build" >
<mkdir dir= "${build_docker}" />
<copy file= "${buildtools_docker}/Dockerfile" todir= "${build_docker}" />
<copy file= "${buildtools_docker}/.dockerignore" todir= "${build_docker}" />
2023-01-15 15:31:23 +01:00
<copy file= "${buildtools_docker}/start.sh" todir= "${build_docker}" />
2022-12-03 14:11:04 +01:00
<unzip dest= "${build_docker}" src= "${dist_server_binary}" />
2022-12-06 11:41:04 -08:00
</target>
2022-12-03 14:11:04 +01:00
<target name= "docker_build" depends= "docker_build_prepare" description= "Builds the container image" >
2022-12-03 20:50:48 +01:00
<exec dir= "${build_docker}" executable= "docker" >
<arg value= "build" />
<arg value= "-t" />
<arg value= "marauroa/stendhalserver:${version}" />
<arg value= "." />
</exec>
2022-12-03 14:11:04 +01:00
</target>
2022-12-06 11:41:04 -08:00
2022-12-03 14:11:04 +01:00
<target name= "docker_push" description= "Pushes the container image" >
</target>
2022-12-06 11:41:04 -08:00
2022-06-18 07:24:45 -07:00
<target name= "server_run" depends= "server_build, compilejs" description= "Runs the server" >
<mkdir dir= "run_srvr" />
<copy todir= "run_srvr" >
<fileset file= "build/lib/${server_jarname}" />
<fileset file= "build/lib/${xmlconf_jarname}" />
<fileset file= "build/lib/${maps_jarname}" />
<fileset file= "libs/marauroa.jar" />
<fileset file= "libs/groovy.jar" />
<fileset file= "libs/guava.jar" />
<fileset file= "libs/log4j.jar" />
<fileset file= "libs/${mysqldriver_jarname}" />
</copy>
<chmod file= "run_srvr/${server_jarname}" perm= "+x" />
<exec dir= "." executable= "java" >
<arg line= "-Xmx256m -cp run_srvr -jar run_srvr/${server_jarname} -c server.ini -l" />
</exec>
<!-- we've run the program, so delete the jars -->
<delete dir= "run_srvr" />
2022-06-18 08:52:44 -07:00
</target> <!-- server_run -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<!-- END: server -->
<!-- START: client data -->
2022-06-18 08:01:07 -07:00
<target name= "build_client_data" >
<!-- base data -->
<mkdir dir= "${build_client_data}" />
<copy todir= "${build_client_data}/data/sprites" >
<fileset dir= "${sprites}" >
<exclude name= "**/*.bz2" />
<exclude name= "**/*.gz" />
<exclude name= "**/*.psd" />
<exclude name= "**/*.xcf" />
<exclude name= "**/*.xcf.*" />
<exclude name= "templates/" />
<exclude name= "placeholder-*.png" />
<exclude name= "cursor/*.svg" />
2023-03-04 17:39:17 -08:00
<exclude name= "items/meta/" />
2022-06-18 08:01:07 -07:00
</fileset>
</copy>
<copy todir= "${build_client_data}/data/tileset" >
<fileset dir= "${tiled}/tileset" >
<exclude name= "**/*.bz2" />
<exclude name= "**/*.gz" />
<exclude name= "**/*.psd" />
<exclude name= "**/*.xcf" />
<exclude name= "**/*.xcf.*" />
2023-02-11 19:58:43 -08:00
<exclude name= "README.animation.txt" />
2023-03-04 19:57:06 -08:00
<exclude name= "logic/generatetiles.py" />
2023-03-05 23:33:23 -08:00
<exclude name= "logic/layer/" />
2022-06-18 08:01:07 -07:00
</fileset>
</copy>
<copy todir= "${build_client_data}/data/font" >
<fileset dir= "data/font" />
</copy>
<copy todir= "${build_client_data}/data/gui" >
<fileset dir= "${data}" >
<exclude name= "paneldrock009.jpg" />
<exclude name= "panelmetal003.gif" />
<exclude name= "panelrock016.jpg" />
<exclude name= "panelwood006.jpg" />
<exclude name= "panelwood032.gif" />
<exclude name= "panelwood003.jpg" />
<exclude name= "**/*.bz2" />
<exclude name= "**/*.gz" />
<exclude name= "**/*.psd" />
<exclude name= "**/*.xcf" />
<exclude name= "**/*.xcf.*" />
<exclude name= "**/*.svg" />
</fileset>
</copy>
<copy todir= "${build_client_data}/data/conf" file= "data/conf/log4j.properties" />
<!-- music data -->
<mkdir dir= "${build_client_music_data}" />
<copy todir= "${build_client_music_data}/data/music" >
<fileset dir= "data/music" >
<include name= "**/*.ogg" />
</fileset>
</copy>
<!-- sounds data -->
<mkdir dir= "${build_client_sound_data}" />
<copy todir= "${build_client_sound_data}/data/sounds" >
<fileset dir= "data/sounds" >
<include name= "**/*.ogg" />
</fileset>
</copy>
2022-06-18 08:52:44 -07:00
</target> <!-- build_client_data -->
<!-- END: client data -->
<!-- START: java client -->
2022-06-18 08:01:07 -07:00
<target name= "client_build" depends= "init,build_client_data" description= "Build JAR file for Stendhal client" >
2022-06-18 07:24:45 -07:00
<mkdir dir= "${build_client}" />
<copy todir= "${build_client}/games/stendhal/client" >
<fileset dir= "${src}/games/stendhal/client" >
<include name= "**/*.txt" />
</fileset>
</copy>
<copy todir= "${build_client}/games/stendhal/common" >
<fileset dir= "${src}/games/stendhal/common" >
<include name= "**/*.txt" />
</fileset>
</copy>
<echo file= "${src}/games/stendhal/client/StendhalBuild.java" >
package games.stendhal.client;
public class StendhalBuild {
private static final String BUILD_NUMBER = "${timestamp}";
public static String getBuildNumber() {return BUILD_NUMBER;}
}
</echo>
<javac srcdir= "${src}" destdir= "${build_client}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/client/*.java" />
<include name= "games/stendhal/client/**/*.java" />
<exclude name= "games/stendhal/client/update/Starter.java" />
<include name= "games/stendhal/common/*.java" />
<include name= "games/stendhal/common/**/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<!-- Only include the libraries which are distributed to detect
unwanted dependencies (i. e. .jar which are not part of the
client-distribution) during compile time -->
<classpath >
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${jorbis_jar}" />
<pathelement path= "${jsonsimple_jar}" />
</classpath>
</javac>
2022-06-18 11:39:39 -07:00
<delete file= "${src}/games/stendhal/client/StendhalBuild.java" quiet= "true" failonerror= "false" />
2022-06-18 07:24:45 -07:00
<!-- compile Starter.java for Java 1.7. So we will be able to
display a dialogbox if running on an old Java Version -->
<javac srcdir= "${src}" destdir= "${build_client}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.7" target= "1.7" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/client/update/Starter.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
</javac>
<copy todir= "${build_client}/games/stendhal/client/update" >
<fileset file= "${src}/games/stendhal/client/update/**" >
2022-06-18 11:39:39 -07:00
<exclude name= "*.java" />
2022-06-18 07:24:45 -07:00
</fileset>
</copy>
<jar jarfile= "${lib}/${client_starter_jarname}" >
<fileset dir= "${build_client}" >
<include name= "games/stendhal/client/update/*" />
</fileset>
<manifest >
2022-06-18 11:39:39 -07:00
<attribute name= "Application-Name" value= "Stendhal" />
<attribute name= "Application-Library-Allowable-Codebase" value= "https://arianne-project.org http://arianne.sf.net http://arianne.sourceforge.net https://arianne.sf.net https://arianne.sourceforge.net https://stendhalgame.org *" />
2022-06-18 07:24:45 -07:00
<attribute name= "Main-Class" value= "games.stendhal.client.update.Starter" />
2022-07-21 21:40:14 +02:00
<attribute name= "Class-path" value= "." />
2022-06-18 07:24:45 -07:00
<attribute name= "Permissions" value= "all-permissions" />
<attribute name= "Codebase" value= "*" />
2022-06-18 11:39:39 -07:00
<attribute name= "Trusted-Library" value= "true" />
2022-06-18 07:24:45 -07:00
</manifest>
</jar>
2022-06-18 11:39:39 -07:00
<antcall target= "signjar" />
2022-06-18 07:24:45 -07:00
<chmod file= "${lib}/${client_starter_jarname}" perm= "+x" />
<jar jarfile= "${lib}/${client_jarname}" >
<fileset dir= "${build_client}" >
<exclude name= "games/stendhal/client/update/**" />
</fileset>
</jar>
2022-06-18 08:01:07 -07:00
<!-- base data -->
2022-06-18 07:24:45 -07:00
<jar jarfile= "${lib}/${client_data}" basedir= "${build_client_data}" />
2022-06-18 08:01:07 -07:00
<!-- sounds data -->
2022-06-18 07:24:45 -07:00
<jar jarfile= "${lib}/${client_sound_data}" basedir= "${build_client_sound_data}" />
2022-06-18 08:01:07 -07:00
<!-- music data -->
2022-06-18 07:24:45 -07:00
<jar jarfile= "${lib}/${client_music_data}" basedir= "${build_client_music_data}" />
2022-06-18 08:52:44 -07:00
</target> <!-- client_build -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "compile_stendhaltextclient" description= "compiles the Stendhal text client " >
<mkdir dir= "${build_stendhaltextclient}" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<javac srcdir= "${src}" destdir= "${build_stendhaltextclient}" source= "1.8" target= "1.8" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/bot/textclient/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
2022-06-18 07:24:45 -07:00
<classpath >
<pathelement path= "${guava_jar}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
2022-06-18 08:52:44 -07:00
<pathelement path= "${groovy_jar}" />
2022-06-18 07:24:45 -07:00
<pathelement path= "${tiled_jar}" />
2022-06-18 08:52:44 -07:00
<pathelement path= "${jorbis_jar}" />
<pathelement path= "${swinglayout_jar}" />
2022-06-18 07:24:45 -07:00
</classpath>
2022-06-18 08:52:44 -07:00
</javac>
2018-01-01 11:47:54 +01:00
2022-06-18 08:52:44 -07:00
</target> <!-- compile_stendhaltextclient -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:01:07 -07:00
<target name= "dist_client_binary" depends= "clean_client_data,client_build" >
2022-06-18 07:24:45 -07:00
<mkdir dir= "${buildroot}/stendhal-${version}" />
<mkdir dir= "${buildroot}/stendhal-${version}/lib" />
<mkdir dir= "${buildroot}/stendhal-${version}/log" />
<copy tofile= "${buildroot}/stendhal-${version}/stendhal-starter.jar" file= "${lib}/${client_starter_jarname}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/stendhal.jar" file= "${lib}/${client_jarname}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/log4j.jar" file= "${log4j_jar}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/marauroa.jar" file= "${marauroa_jar}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/jorbis.jar" file= "${jorbis_jar}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/${jsonsimple_jarname}" file= "${jsonsimple_jar}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/stendhal-sound-data.jar" file= "${lib}/${client_sound_data}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/stendhal-music-data.jar" file= "${lib}/${client_music_data}" />
<copy tofile= "${buildroot}/stendhal-${version}/lib/stendhal-data.jar" file= "${lib}/${client_data}" />
<copy todir= "${buildroot}/stendhal-${version}/lib" >
<fileset dir= "libs" >
<include name= "*.txt" />
<include name= "*.html" />
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-${version}/doc" >
<fileset dir= "doc" >
<exclude name= "mkdocs/" />
</fileset>
2022-06-18 11:39:39 -07:00
<fileset file= "LICENSE.txt" />
2022-06-18 07:24:45 -07:00
</copy>
2022-06-18 11:39:39 -07:00
<touch file= "${buildroot}/stendhal-${version}/log/stendhal.txt" />
2022-06-18 07:24:45 -07:00
<copy todir= "${buildroot}/stendhal-${version}" file= "README.md" />
2022-09-06 13:35:55 -07:00
<copy tofile= "${buildroot}/stendhal-${version}/icon.png" file= "data/gui/StendhalIcon.png" />
2022-06-18 07:24:45 -07:00
<zip destfile= "${buildroot}/stendhal-${version}.zip" >
<zipfileset dir= "${buildroot}/stendhal-${version}" excludes= "stendhal-starter.jar" />
<zipfileset dir= "${buildroot}/stendhal-${version}" includes= "stendhal-starter.jar" filemode= "755" />
2022-06-18 11:39:39 -07:00
<zipfileset file= "buildtools/launch4j/stendhal-starter.exe" filemode= "755" />
2022-06-18 07:24:45 -07:00
</zip>
<delete dir= "${buildroot}/stendhal-${version}" />
2022-06-18 08:52:44 -07:00
</target> <!-- dist_client_binary -->
<target name= "dist_client_starter" depends= "client_build" >
<mkdir dir= "${buildroot}/stendhal-${version}" />
<copy todir= "${buildroot}/stendhal-${version}" file= "${lib}/${client_starter_jarname}" />
<copy todir= "${buildroot}/stendhal-${version}/lib" >
<fileset dir= "libs" >
<include name= "*.txt" />
<include name= "*.html" />
</fileset>
</copy>
<copy todir= "${buildroot}/stendhal-${version}/doc" >
<fileset dir= "doc" >
<exclude name= "mkdocs/" />
</fileset>
2022-06-18 11:39:39 -07:00
<fileset file= "LICENSE.txt" />
2022-06-18 08:52:44 -07:00
</copy>
<copy todir= "${buildroot}/stendhal-${version}" file= "README.md" />
<zip destfile= "${buildroot}/stendhal-starter-${version}.zip" >
<zipfileset dir= "${buildroot}/stendhal-${version}" excludes= "${client_starter_jarname}" />
<zipfileset dir= "${buildroot}/stendhal-${version}" includes= "${client_starter_jarname}" filemode= "755" />
</zip>
<delete dir= "${buildroot}/stendhal-${version}" />
</target> <!-- dist_client_starter -->
<target name= "client_run" depends= "client_build" description= "Runs the client" >
<mkdir dir= "run_clnt" />
<mkdir dir= "run_clnt/lib" />
<copy todir= "run_clnt" >
<fileset file= "build/lib/${client_jarname}" />
</copy>
<copy todir= "run_clnt/lib" >
<fileset file= "build/lib/${client_data}" />
<fileset file= "build/lib/${client_sound_data}" />
<fileset file= "build/lib/${client_music_data}" />
<fileset file= "build/lib/${client_starter_jarname}" />
<fileset file= "${marauroa_jar}" />
<fileset file= "${log4j_jar}" />
<fileset file= "${jorbis_jar}" />
<fileset file= "${jsonsimple_jar}" />
</copy>
<chmod file= "run_clnt/lib/${client_jarname}" perm= "+x" />
<java classname= "games.stendhal.client.stendhal"
fork="true"
failonerror="true"
maxmemory="128m">
<classpath >
<pathelement location= "run_clnt/*" />
<pathelement location= "run_clnt/lib/*" />
</classpath>
</java>
<!-- we've run the program, so delete the jars -->
<delete dir= "run_clnt" />
</target> <!-- client_run -->
<!-- Netbeans won't let you choose ant options, so this does it for us -->
2022-06-18 11:39:39 -07:00
<target name= "run" depends= "client_run" description= "Runs client for netbeans trick" />
2022-06-18 08:52:44 -07:00
<!-- END: java client -->
<!-- START: web client -->
<target name= "js-prepare-marauroa" >
2022-06-18 11:39:39 -07:00
<mkdir dir= "build/js" />
2022-06-18 08:52:44 -07:00
<unzip dest= "build" src= "libs/marauroa.jar" >
<patternset >
<include name= "js/**" />
</patternset>
</unzip>
2022-06-18 07:24:45 -07:00
</target>
2022-06-18 08:52:44 -07:00
<target name= "js-prepare-build" >
<echo file= "build/js/build.js" >
var stendhal = window.stendhal = window.stendhal || {};
stendhal.data = stendhal.data || {};
stendhal.data.build = {
version: "${version}",
build: "${timestamp}",
dist: "webclient"
}
</echo>
2022-06-18 07:24:45 -07:00
</target>
2022-06-18 11:39:39 -07:00
<extension-point name= "js-prepare" depends= "js-prepare-marauroa,js-prepare-build,js-prepare-node" />
2022-06-18 08:52:44 -07:00
<target name= "js-prepare-node" >
<exec executable= "npm${executable.suffix}" failonerror= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "install" />
<arg value= "--no-save" />
2022-06-18 08:52:44 -07:00
</exec>
</target>
<target name= "js-invoke-compiler" >
<exec executable= "npx${executable.suffix}" dir= "srcjs/stendhal" failonerror= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "tsc" />
2022-06-18 08:52:44 -07:00
</exec>
2022-06-18 11:39:39 -07:00
<property name= "js-debug" value= "--debug --formatting=PRETTY_PRINT --create_source_map srcjs/stendhal-compiled.js.map --source_map_include_content" />
<property name= "js-files-license" value= "srcjs/stendhal/license.js" />
<property name= "js-files-marauroa" value= "build/js/marauroa.js build/js/client-framework.js build/js/message-factory.js build/js/perception.js build/js/rpfactory.js build/js/inflate.js build/js/deserializer.js" />
2022-12-31 07:15:50 -08:00
<property name= "js-files-config" value= "build/js/build.js" />
2022-06-18 11:39:39 -07:00
<property name= "js-files-lib1" value= "srcjs/jsxgraph-util.js" />
<property name= "js-files-lib2" value= "" />
2023-02-07 11:38:34 -08:00
<property name= "js-files-data1" value= "srcjs/stendhal/data/sha3.js" />
2022-06-18 11:39:39 -07:00
<property name= "js-files-data2" value= "" />
2023-02-05 06:09:36 -08:00
<property name= "js-files-entity5" value= "" />
2022-06-18 11:39:39 -07:00
<property name= "js-files-entity6" value= "" />
2023-02-07 02:57:57 -08:00
<property name= "js-files-ui1" value= "" />
2023-02-05 06:25:47 -08:00
<property name= "js-files-ui2" value= "" />
2022-06-18 11:39:39 -07:00
<property name= "js-files-ui3" value= "" />
2023-02-05 22:52:51 -08:00
<property name= "js-files-main1" value= "" />
2023-02-05 07:14:53 -08:00
<property name= "js-files-ui4" value= "" />
2022-06-18 11:39:39 -07:00
<property name= "js-files-main2" value= "srcjs/stendhal/main.js" />
<property name= "js-files-main3" value= "" />
2023-02-05 00:35:04 -08:00
<property name= "js-files-ts" value= "build/ts/*.js build/ts/**/*.js" />
2023-02-24 23:48:12 +01:00
<property name= "js-files-ts2" value= "" />
2022-06-18 08:52:44 -07:00
<java jar= "buildtools/closure-compiler/compiler.jar"
fork="true"
failonerror="true"
maxmemory="128m">
<arg value= "--language_in=ECMASCRIPT_2020" />
<arg value= "--language_out=STABLE" />
2022-06-18 11:39:39 -07:00
<arg value= "--compilation_level" />
<arg value= "ADVANCED" />
<arg line= "${js-debug}" />
<arg value= "--process_common_js_modules" />
<arg value= "--module_resolution=node" />
2023-02-06 04:42:00 -08:00
<arg value= "--jscomp_off=checkVars" />
<!-- DEBUG: -->
<!-- <arg value=" - \ - jscomp_off=globalThis"/> -->
2022-06-18 08:52:44 -07:00
<arg value= "--js_output_file=srcjs/stendhal-compiled.js" />
2022-06-18 11:39:39 -07:00
<arg line= "${js-files-license}" />
<arg line= "${js-files-marauroa}" />
<arg line= "${js-files-config}" />
<arg line= "${js-files-lib1}" />
<arg line= "${js-files-lib2}" />
<arg line= "${js-files-data1}" />
<arg line= "${js-files-data2}" />
<arg line= "${js-files-entity5}" />
<arg line= "${js-files-entity6}" />
<arg line= "${js-files-ui1}" />
<arg line= "${js-files-ui2}" />
<arg line= "${js-files-ui3}" />
<arg line= "${js-files-main1}" />
<arg line= "${js-files-ui4}" />
<arg line= "${js-files-main2}" />
<arg line= "${js-files-main3}" />
<arg line= "${js-files-ts}" />
2023-02-24 23:48:12 +01:00
<arg line= "${js-files-ts2}" />
2022-06-18 08:52:44 -07:00
</java>
<echo file= "srcjs/stendhal-compiled.js" append= "true" >
//# sourceMappingURL=stendhal-compiled.js.map
</echo>
2023-02-24 23:48:12 +01:00
<antcall target= "compilejs-hook" />
2022-06-18 08:52:44 -07:00
</target> <!-- js - invoke - compiler -->
2023-02-24 23:48:12 +01:00
<target name= "compilejs-hook" if= "compilejs-hook" >
<exec executable= "${compilejs-hook}" />
</target>
2022-06-18 11:15:39 -07:00
<target name= "compilejs" depends= "cleanjs" >
2022-06-18 11:39:39 -07:00
<antcall target= "js-prepare" unless:set= "exclude.webclient" />
<antcall target= "js-invoke-compiler" unless:set= "exclude.webclient" />
2022-06-18 08:52:44 -07:00
<echo if:set= "exclude.webclient" level= "warning"
2022-06-18 11:39:39 -07:00
message="WARNING: Node.js is not installed, skipping web client build."/>
2022-06-18 08:52:44 -07:00
</target> <!-- compilejs -->
2023-03-11 20:30:34 -08:00
<target name= "webclient_build" depends= "compilejs,clean_client_data,build_client_data" >
2023-03-11 18:12:10 -08:00
<mkdir dir= "${build_webclient}" />
<copy todir= "${build_webclient}" >
<fileset dir= "${srcjs}" >
<include name= "stendhal.html" />
<include name= "stendhal.css" />
<include name= "stendhal-compiled.js*" />
<include name= "favicon.ico" />
</fileset>
</copy>
2023-03-11 20:30:34 -08:00
<copy todir= "${build_webclient}/marauroa" >
<fileset dir= "${buildroot}/js" />
</copy>
<copy todir= "${build_webclient}/stendhal" >
<fileset dir= "${buildroot}/ts" />
</copy>
2023-03-11 18:12:10 -08:00
<replaceregexp file= "${build_webclient}/stendhal.html"
2023-03-11 19:27:16 -08:00
match="data-tileset-path=" /tileset" "
replace="data-tileset-path=" /data/tileset" "
byline="false"/>
<replaceregexp file= "${build_webclient}/stendhal-compiled.js.map"
match="build/js/"
replace="js/marauroa/"
byline="true"
flags="g"/>
<replaceregexp file= "${build_webclient}/stendhal-compiled.js.map"
match="build/ts/"
replace="js/stendhal/"
byline="true"
flags="g"/>
2023-03-11 20:30:34 -08:00
</target> <!-- webclient_build -->
<target name= "build_webclient" depends= "webclient_build" />
2023-03-11 18:12:10 -08:00
2023-03-11 20:30:34 -08:00
<target name= "dist_webclient_binary" depends= "webclient_build" >
2022-06-18 07:24:45 -07:00
<zip destfile= "${buildroot}/stendhal-webclient-${version}.zip" >
2022-06-18 09:41:43 -07:00
<zipfileset dir= "${build_client_data}" />
<zipfileset dir= "${build_client_music_data}" />
<zipfileset dir= "${build_client_sound_data}" />
2023-03-11 18:48:51 -08:00
<zipfileset dir= "${build_webclient}" prefix= "js" />
2022-06-18 11:14:28 -07:00
<zipfileset dir= "doc" prefix= "doc" >
<include name= "contributors.md" />
<include name= "Licenses/**" />
<include name= "sources/**" />
</zipfileset>
<zipfileset file= "LICENSE.txt" prefix= "doc" />
2022-06-18 07:24:45 -07:00
</zip>
2023-03-11 20:30:34 -08:00
<delete dir= "${build_webclient}" />
2022-10-24 13:35:16 -07:00
</target> <!-- dist_webclient_binary -->
2022-06-18 08:52:44 -07:00
<!-- END: web client -->
<!-- START: android webview client -->
<target name= "client_android_build" description= "Builds WebView client for Android devices" >
2022-06-18 13:01:21 -07:00
<condition property= "gradlew.exec" value= "cmd" >
<os family= "windows" />
</condition>
<condition property= "gradlew.script" value= "/c "${user.dir}/android/gradlew.bat"" >
<os family= "windows" />
</condition>
<property name= "gradlew.exec" value= "sh" />
<property name= "gradlew.script" value= ""${user.dir}/android/gradlew"" />
2022-06-18 08:52:44 -07:00
<echo
if:set="exclude.webview"
2022-06-18 11:39:39 -07:00
message="ANDROID_SDK_ROOT environment variable not set. Skipping Android WebView client build."/>
2022-06-18 08:52:44 -07:00
<echo
unless:set="exclude.webview"
2022-06-18 11:39:39 -07:00
message="Building Android WebView client."/>
2022-06-18 13:01:21 -07:00
<echo
unless:set="exclude.webview"
message="Gradle command: ${gradlew.exec} ${gradlew.script}"/>
2022-06-18 08:52:44 -07:00
2022-06-18 11:39:39 -07:00
<property name= "android.build" value= "assembleDebug" />
2022-06-18 08:52:44 -07:00
<condition property= "android.build_wout_rev" >
<and >
<not >
2022-06-18 11:39:39 -07:00
<isset property= "android.rev" />
2022-06-18 08:52:44 -07:00
</not>
<not >
2022-06-18 11:39:39 -07:00
<isset property= "gradle.params" />
2022-06-18 08:52:44 -07:00
</not>
</and>
</condition>
<condition property= "android.build_w_rev" >
<and >
2022-06-18 11:39:39 -07:00
<isset property= "android.rev" />
2022-06-18 08:52:44 -07:00
<not >
2022-06-18 11:39:39 -07:00
<isset property= "gradle.params" />
2022-06-18 08:52:44 -07:00
</not>
</and>
</condition>
<exec unless:set= "exclude.webview" failonerror= "true"
2022-06-18 13:01:21 -07:00
executable="${gradlew.exec}" dir="android/">
<arg line= "${gradlew.script}" />
2022-06-18 11:39:39 -07:00
<arg if:set= "gradle.params" line= "${gradle.params}" />
<arg if:set= "android.build_wout_rev" value= "${android.build}" />
<arg if:set= "android.build_w_rev" line= "-Pandroid.rev=${android.rev} ${android.build}" />
2022-06-18 08:52:44 -07:00
</exec>
</target> <!-- client_android_build -->
2022-06-18 07:24:45 -07:00
2022-06-18 11:25:02 -07:00
<target name= "build_android_client" depends= "client_android_build" description= "Alias for client_android_build" />
2022-06-18 07:24:45 -07:00
2022-06-18 11:25:02 -07:00
<target name= "dist_client_android" description= "Builds Android client distribution package" >
2022-06-18 07:24:45 -07:00
<echo
if:set="exclude.webview"
2022-06-18 11:39:39 -07:00
message="ANDROID_SDK_ROOT environment variable not set. Skipping Android WebView client build."/>
2022-06-18 07:24:45 -07:00
2022-06-18 11:39:39 -07:00
<antcall unless:set= "exclude.webview" target= "client_android_build" />
2022-06-18 07:24:45 -07:00
<copy unless:set= "exclude.webview" todir= "${buildroot}" flatten= "true" >
<fileset dir= "${buildroot}/build_android_client/outputs/apk/" >
2022-06-18 11:39:39 -07:00
<include name= "**/*.apk" />
2022-06-18 07:24:45 -07:00
</fileset>
</copy>
</target> <!-- dist_client_android -->
2022-06-18 08:52:44 -07:00
<!-- alias for "dist_client_android" -->
2022-06-18 11:39:39 -07:00
<target name= "dist_android_client" depends= "dist_client_android" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<!-- END: android webview client -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<!-- START: tools -->
2022-06-18 07:24:45 -07:00
<target name= "compile_stendhaltools" description= "compiles the Stendhal build tools" >
<mkdir dir= "${build_stendhaltools}" />
<javac srcdir= "${src}" destdir= "${build_stendhaltools}" source= "1.8" target= "1.8" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" deprecation= "${javac.deprecation}" includeantruntime= "true" >
<include name= "games/stendhal/tools/**/*.java" />
<include name= "games/stendhal/tools/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
<pathelement path= "${guava_jar}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${tiled_jar}" />
<pathelement path= "${jorbis_jar}" />
<pathelement path= "${swinglayout_jar}" />
<pathelement path= "${luaj_jar}" />
<pathelement path= "${jsonsimple_jar}" />
</classpath>
</javac>
2022-06-18 08:52:44 -07:00
</target> <!-- compile_stendhaltools -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "postman" description= "Builds postman bot" >
<mkdir dir= "${buildroot}/buildbot" />
<javac srcdir= "${src}" destdir= "${buildroot}/buildbot" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "games/stendhal/bot/postman/*.java" />
<include name= "games/stendhal/bot/package-info.java" />
<include name= "games/stendhal/bot/shouter/*.java" />
<include name= "games/stendhal/bot/core/*.java" />
2022-06-18 07:24:45 -07:00
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
2022-06-18 08:52:44 -07:00
<pathelement path= "${build_server}" />
2022-06-18 07:24:45 -07:00
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
2022-06-18 08:52:44 -07:00
<pathelement path= "${junit_jar}" />
<pathelement path= "libs/pircbot.jar" />
2022-06-18 07:24:45 -07:00
</classpath>
2022-06-18 08:52:44 -07:00
</javac>
<jar jarfile= "${buildroot}/buildbot/postman.jar" >
<fileset dir= "${buildroot}/buildbot" >
<include name= "games/stendhal/bot/postman/*" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<include name= "games/stendhal/bot/core/*" />
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<include name= "games/stendhal/bot/shouter/*" />
2022-06-18 07:24:45 -07:00
</fileset>
2022-06-18 08:52:44 -07:00
<manifest >
<attribute name= "Main-Class" value= "games.stendhal.bot.postman.PostmanMain" />
</manifest>
</jar>
<!-- end build bot -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
</target> <!-- postman -->
2022-06-18 07:24:45 -07:00
2022-06-18 08:52:44 -07:00
<target name= "signupdates" description= "signs updates" depends= "compile_stendhaltools,jardiff" unless= "exclude.signing" >
<taskdef name= "updatesigner" classname= "games.stendhal.tools.updateprop.UpdateSigner" >
2022-06-18 07:24:45 -07:00
<classpath >
2022-06-18 08:52:44 -07:00
<pathelement path= "." />
2022-06-18 07:24:45 -07:00
<pathelement path= "${build_stendhaltools}" />
</classpath>
</taskdef>
2022-06-18 08:52:44 -07:00
<updatesigner >
<fileset dir= "${lib}" >
<include name= "*.jar" />
2022-06-18 07:24:45 -07:00
</fileset>
2022-06-18 08:52:44 -07:00
</updatesigner>
</target> <!-- signupdates -->
2022-06-18 07:24:45 -07:00
<target name= "jardiff" depends= "client_build" unless= "exclude.jardiff" >
<echo > Creating update from ${version.old} to ${version}</echo>
<delete >
<fileset dir= "${build-archive}" >
<exclude name= "*.zip" />
</fileset>
</delete>
2022-06-18 11:39:39 -07:00
<unzip src= "${build-archive}/stendhal-${version.old}.zip" dest= "${build-archive}" />
2022-06-18 07:24:45 -07:00
<java jar= "libs/jardiff.jar" fork= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "-nonminimal" />
<arg value= "-creatediff" />
<arg value= "-output" />
<arg value= "${build}/lib/stendhal-diff-${version.old}-${version}.jar" />
<arg value= "${build-archive}/lib/stendhal.jar" />
<arg value= "${build}/lib/stendhal-${version}.jar" />
2022-06-18 07:24:45 -07:00
</java>
<java jar= "libs/jardiff.jar" fork= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "-nonminimal" />
<arg value= "-creatediff" />
<arg value= "-output" />
<arg value= "${build}/lib/stendhal-data-diff-${version.old}-${version}.jar" />
<arg value= "${build-archive}/lib/stendhal-data.jar" />
<arg value= "${build}/lib/stendhal-data-${version}.jar" />
2022-06-18 07:24:45 -07:00
</java>
<java jar= "libs/jardiff.jar" fork= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "-nonminimal" />
<arg value= "-creatediff" />
<arg value= "-output" />
<arg value= "${build}/lib/stendhal-music-data-diff-${version.old}-${version}.jar" />
<arg value= "${build-archive}/lib/stendhal-music-data.jar" />
<arg value= "${build}/lib/stendhal-music-data-${version}.jar" />
2022-06-18 07:24:45 -07:00
</java>
2022-06-18 08:52:44 -07:00
<java jar= "libs/jardiff.jar" fork= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "-nonminimal" />
<arg value= "-creatediff" />
<arg value= "-output" />
<arg value= "${build}/lib/stendhal-sound-data-diff-${version.old}-${version}.jar" />
<arg value= "${build-archive}/lib/stendhal-sound-data.jar" />
<arg value= "${build}/lib/stendhal-sound-data-${version}.jar" />
2022-06-18 08:52:44 -07:00
</java>
<!-- TODO: maraurora.jar -->
</target> <!-- jardiff -->
2022-06-18 07:24:45 -07:00
<!-- USAGE: ant balance - Dcreature="<creature_name>" -->
2022-06-18 11:25:02 -07:00
<target name= "balance" description= "Runs enemy balancer" depends= "compile_stendhaltools,server_build" >
2022-06-18 07:24:45 -07:00
<java classname= "games.stendhal.tools.BalanceRPGame" >
<classpath >
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "." />
<pathelement path= "${build_server}" />
<pathelement path= "${testsrc}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${guava_jar}" />
<pathelement path= "${groovy_jar}" />
</classpath>
<arg line= "${creature}" />
<sysproperty key= "showxp" value= "" />
</java>
2022-06-18 08:52:44 -07:00
</target> <!-- balance -->
<!-- END: tools -->
<!-- START: documentation -->
2023-05-16 23:16:24 -07:00
<target name= "javadocs" description= "Generate HTML documentation for Java API with javadoc."
depends="clean_javadocs">
2022-06-18 08:52:44 -07:00
<condition property= "include.marauroa" value= "true" >
2022-12-07 12:48:50 -08:00
<available file= "${marauroa_src}" type= "dir" />
2022-06-18 08:52:44 -07:00
</condition>
2022-12-07 12:48:50 -08:00
<javadoc
defaultexcludes="yes"
destdir="${docs}"
author="true"
encoding="UTF-8"
version="true"
use="true"
windowtitle="Stendhal API Documentation Version: ${version}"
failonerror="yes"
additionalparam="-Xdoclint:-html">
2022-06-18 08:52:44 -07:00
<!-- include marauroa source if available -->
2022-12-07 12:48:50 -08:00
<fileset dir= "${marauroa_src}" includes= "**/*.java"
if:true="${include.marauroa}"/>
<fileset dir= "${src}" includes= "**/*.java" />
<fileset dir= "${testsrc}" includes= "utilities/**/*.java" />
2022-06-18 08:52:44 -07:00
<classpath >
2022-12-07 12:48:50 -08:00
<pathelement path= "${marauroa_src}"
if:true="${include.marauroa}"/>
<pathelement path= "${src}" />
<pathelement path= "${testsrc}" />
2022-06-18 08:52:44 -07:00
<pathelement path= "${guava_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${jorbis_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${simple_jar}" />
<pathelement path= "${swinglayout_jar}" />
<pathelement path= "${tiled_jar}" />
2022-12-07 12:48:50 -08:00
<pathelement path= "${libdir}/ant.jar" />
<pathelement path= "${libdir}/jcurses.jar" />
<pathelement path= "${libdir}/pircbot.jar" />
2022-06-18 08:52:44 -07:00
<pathelement path= "${luaj_jar}" />
2022-12-06 11:42:04 -08:00
<pathelement path= "${jsonsimple_jar}" />
2022-12-07 12:48:50 -08:00
<pathelement path= "${hamcrest_jar}" />
<pathelement path= "${easymock_jar}" />
<pathelement path= "${easymockclassextension_jar}" />
<!-- put marauroa/libs last because it may contain duplicate
libraries of a different version -->
<pathelement path= "${marauroa_libs}/*"
if:true="${include.marauroa}"/>
2022-06-18 08:52:44 -07:00
</classpath>
</javadoc>
2023-05-16 23:16:24 -07:00
</target> <!-- javadocs -->
2022-06-18 08:52:44 -07:00
2023-05-16 23:16:24 -07:00
<target name= "mkdocs" description= "Generate HTML documentation for Lua API with MkDocs."
depends="clean_mkdocs">
<!-- Note: call "javadocs" first to include Java documentation -->
2022-06-18 08:52:44 -07:00
<echo unless:true= "${python.present}"
2022-06-18 11:39:39 -07:00
message="Python unavailable, cannot run mkdocs"/>
2022-06-18 08:52:44 -07:00
<!-- <antcall if:true="${python.present}" target="docs"/> -->
2023-05-17 05:36:47 -07:00
<exec if:true= "${python.present}" executable= "python" failonerror= "true"
dir="./buildtools/mkdocs/">
2022-06-18 11:39:39 -07:00
<arg value= "-u" />
<arg value= "build.py" />
2022-06-18 08:52:44 -07:00
</exec>
</target> <!-- mkdocs -->
2023-05-16 23:16:24 -07:00
<target name= "doxygen" description= "Generate HTML documentation with Doxygen."
depends="clean_doxygen">
2022-06-18 08:52:44 -07:00
<exec executable= "doxygen" failonerror= "true" >
2022-06-18 11:39:39 -07:00
<arg value= "./buildtools/doxygen/Doxyfile" />
2022-06-18 08:52:44 -07:00
</exec>
2020-03-25 21:39:15 -07:00
2022-06-18 08:52:44 -07:00
<!-- Doxygen 1.9.3 has some issues with tags files URLs -->
<exec if:set= "doxygen.fix_urls" executable= "python" >
<arg value= "./buildtools/doxygen/fix_urls.py" />
</exec>
2023-05-16 23:16:24 -07:00
</target> <!-- doxygen -->
<target name= "docs" description= "Generate HTML documentation." depends= "javadocs,mkdocs" />
2011-07-09 12:13:50 +00:00
2022-06-18 08:52:44 -07:00
<!-- END: documentation -->
2011-07-09 12:13:50 +00:00
2022-06-18 08:52:44 -07:00
<!-- START: testing -->
2011-07-09 12:13:50 +00:00
<!-- ************************************************************************ -->
<!-- ************************************************************************ -->
<!-- **** **** -->
<!-- **** T E S T I N G **** -->
<!-- **** **** -->
<!-- ************************************************************************ -->
<!-- ************************************************************************ -->
2011-07-09 11:45:59 +00:00
2022-06-18 07:24:45 -07:00
<target name= "test" description= "Compile and run tests" depends= "compile_tests,prepare_serverini_for_tests,run_tests,report_test" >
<exec executable= "curl" >
2022-06-18 11:39:39 -07:00
<arg value= "-q" />
<arg value= "-F" />
<arg value= "filename=testresults.xml" />
<arg value= "-F" />
<arg value= "file=@build/build_test_report/testresults-short.xml" />
2022-06-18 07:24:45 -07:00
<arg value= "https://stendhalgame.org?id=content/scripts/cireport&cikey=${env.cikey}&buildnumber=${env.GITHUB_RUN_NUMBER}&buildid=${env.GITHUB_RUN_ID}&commit=${env.GITHUB_SHA}&commits=${env.TRAVIS_COMMIT_RANGE}&slug=${env.TRAVIS_REPO_SLUG}&pullrequest=${env.GITHUB_HEAD_REF}&branch=${env.GITHUB_REF_NAME}" />
</exec>
2022-06-18 11:39:39 -07:00
<fail message= "Test errors detected, check test results." if= "test.error" />
<fail message= "Test failure detected, check test results." if= "test.failure" />
2022-06-18 08:52:44 -07:00
</target> <!-- test -->
2022-06-18 07:24:45 -07:00
<target name= "compile_tests" description= "Compile all tests" depends= "server_build, client_build, compile_stendhaltools, compile_stendhaltextclient, postman" >
<mkdir dir= "${build_tests}" />
<copy todir= "${build_tests}" >
<fileset dir= "tests" >
<exclude name= "**/*.java" />
</fileset>
</copy>
<javac srcdir= "tests" destdir= "${build_tests}" debug= "${javac.debug}" debuglevel= "${javac.debuglevel}" source= "1.8" target= "1.8" deprecation= "${javac.deprecation}" includeantruntime= "false" >
<include name= "**/*.java" />
<compilerarg value= "-encoding" />
<compilerarg value= "utf-8" />
<compilerarg value= "-Xlint:unchecked" />
<classpath >
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${build_stendhaltextclient}" />
<pathelement path= "${build_client}" />
<pathelement path= "${build_server}" />
<pathelement path= "${build_server_maps}" />
<pathelement path= "${build_server_script}" />
<!-- <pathelement path="${build_server_mods}"/> -->
<pathelement path= "${build_postman}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${hamcrest_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${simple_jar}" />
<pathelement path= "${easymock_jar}" />
<pathelement path= "${easymockclassextension_jar}" />
<pathelement path= "${build_server_script}" />
<pathelement path= "${tiled_jar}" />
2023-01-26 20:30:04 -08:00
<pathelement path= "${guava_jar}" />
2022-06-18 07:24:45 -07:00
</classpath>
</javac>
2022-06-18 08:52:44 -07:00
</target> <!-- compile_tests -->
2022-06-18 07:24:45 -07:00
<available property= "server.ini" file= "server.ini" />
<target name= "prepare_serverini_for_tests" unless= "server.ini" >
<echo file= "server.ini" >
2015-08-16 18:25:19 +02:00
database_implementation=games.stendhal.server.core.engine.StendhalPlayerDatabase
factory_implementation=games.stendhal.server.core.engine.StendhalRPObjectFactory
database_adapter=marauroa.server.db.adapter.H2DatabaseAdapter
jdbc_url=jdbc:h2:~/stendhal/database/h2db;AUTO_RECONNECT=TRUE;DB_CLOSE_ON_EXIT=FALSE
jdbc_class=org.h2.Driver
tcp_port=32160
world=games.stendhal.server.core.engine.StendhalRPWorld
ruleprocessor=games.stendhal.server.core.engine.StendhalRPRuleProcessor
turn_length=300
server_typeGame=stendhal
server_name=stendhal Marauroa server
server_version=1.17.5
server_contact=https://sourceforge.net/tracker/?atid=514826& group_id=66537& func=browse
n = 966117159215070350422008719727400433209081371975507132437556194069529307432746058120899703845731090424709994853484674454738958575201865208533043689325553646377
e = 15
d = 901709348600732327060541471745573737661809280510473323608385781131560686937229596225645929798090122419343070307904183075525081589946196209839163758401803422679
2022-06-18 07:24:45 -07:00
</echo>
2022-06-18 08:52:44 -07:00
</target> <!-- prepare_serverini_for_tests -->
2022-06-18 07:24:45 -07:00
<target name= "run_tests" description= "Run tests" >
<mkdir dir= "${build_tests_report}" />
<taskdef uri= "antlib:org.jacoco.ant" resource= "org/jacoco/ant/antlib.xml" >
<classpath path= "buildtools/jacoco/jacocoant.jar" />
</taskdef>
<jacoco:coverage destfile= "${build_tests_report}/jacoco.exec" append= "false" includes= "games.stendhal.*" >
<junit fork= "yes" forkmode= "once" errorproperty= "test.error" failureproperty= "test.failure" >
<classpath >
<pathelement path= "${build_tests}" />
<pathelement path= "${build_client}" />
<pathelement path= "${build_server}" />
<pathelement path= "${build_server_maps}" />
<pathelement path= "${build_stendhaltools}" />
<pathelement path= "${build_stendhaltextclient}" />
<pathelement path= "${build_server_script}" />
<!-- <pathelement path="${build_server_mods}"/> -->
<pathelement path= "${build_postman}" />
<pathelement path= "${easymock_jar}" />
<pathelement path= "${easymockclassextension_jar}" />
<pathelement path= "${cglib_jar}" />
<pathelement path= "${marauroa_jar}" />
<pathelement path= "${hamcrest_jar}" />
<pathelement path= "${log4j_jar}" />
<pathelement path= "${junit_jar}" />
<pathelement path= "${groovy_jar}" />
<pathelement path= "${simple_jar}" />
<pathelement path= "${guava_jar}" />
<pathelement path= "${mysqldriver_jar}" />
<pathelement path= "${h2_jar}" />
<pathelement path= "${jorbis_jar}" />
<pathelement path= "${luaj_jar}" />
<pathelement path= "." />
<pathelement path= "data/conf" />
<pathelement path= "data/script" />
</classpath>
<formatter type= "xml" />
<batchtest todir= "${build_tests_report}" >
<fileset dir= "tests" >
<include name= "**/*Test.java" />
<include name= "**/Test*.java" />
</fileset>
</batchtest>
</junit>
</jacoco:coverage>
<jacoco:report >
<executiondata >
2022-06-18 11:39:39 -07:00
<file file= "${build_tests_report}/jacoco.exec" />
2022-06-18 07:24:45 -07:00
</executiondata>
<structure name= "stendhal" >
<classfiles >
<fileset dir= "${build_client}" />
<fileset dir= "${build_server}" />
</classfiles>
<sourcefiles encoding= "UTF-8" >
2022-06-18 11:39:39 -07:00
<fileset dir= "${src}" />
2022-06-18 07:24:45 -07:00
</sourcefiles>
</structure>
2022-06-18 11:39:39 -07:00
<xml destfile= "${build_tests_report}/jacoco.xml" />
2022-06-18 07:24:45 -07:00
</jacoco:report>
2022-06-18 08:52:44 -07:00
</target> <!-- run_tests -->
2022-06-18 07:24:45 -07:00
<target name= "report_test" description= "Aggregate Testresults" >
2022-06-18 11:39:39 -07:00
<mkdir dir= "${build_tests_report}" />
2022-06-18 07:24:45 -07:00
<junitreport todir= "${build_tests_report}" tofile= "testresults.xml" >
<fileset dir= "${build_tests_report}" >
<include name= "TEST-*.xml" />
</fileset>
<report format= "frames" todir= "${build_tests_report}" />
</junitreport>
<copy file= "${build_tests_report}/testresults.xml" tofile= "${build_tests_report}/testresults-short.xml" />
<replaceregexp file= "${build_tests_report}/testresults-short.xml"
2022-06-18 11:39:39 -07:00
match="< properties> .*?< /properties> |< system-out /> |< system-err /> |^ *"
replace=""
flags="gsm"
byline="false"
2022-06-18 07:24:45 -07:00
/>
<delete >
<fileset dir= "${build_tests_report}" >
<include name= "TEST-*.xml" />
</fileset>
</delete>
2022-06-18 08:52:44 -07:00
</target> <!-- report_test -->
2019-05-31 17:05:58 -07:00
2008-10-21 07:17:43 +00:00
</project>