1 <?xml version="1.0" encoding="UTF-8"?>
3 <!-- ********************************************************** -->
5 <!-- * Apache Ant build file used to build FreeTTS. To build * -->
6 <!-- * everything, just type the following: * -->
10 <!-- * For more information: http://ant.apache.org/ * -->
12 <!-- ********************************************************** -->
13 <project basedir="." default="all" name="FreeTTS">
15 <!-- ********************************************************** -->
17 <!-- * Where to find things... * -->
19 <!-- ********************************************************** -->
20 <property name="version" value="1.2.2" />
22 <fileset dir="lib" includes="**/jsapi.jar" />
24 <property name="src_dir" value="src" />
25 <property name="build_dir" value="bld" />
26 <property name="classes_dir" value="${build_dir}/classes" />
27 <property name="demo_classes_dir" value="${build_dir}/demo_classes" />
28 <property name="lib_dir" value="lib" />
29 <property name="mbrola_dir" value="mbrola" />
30 <property name="bin_dir" value="bin" />
31 <property name="javadoc_dir" value="javadoc" />
32 <property name="webstart_dir" value="${build_dir}/webstart" />
33 <property name="deploy_dir" value="deploy" />
36 <!-- ********************************************************** -->
38 <!-- * Determine which sources should be compiled depending * -->
39 <!-- * on the availability of lib/jsapi.jar. This creates a * -->
40 <!-- * property called "patternset_to_compile" and sets its * -->
41 <!-- * val to either "all_files" or "no_jsapi", which refers * -->
42 <!-- * to the name of a patternset. The value of * -->
43 <!-- * srcs_to_compile will be used in the javac target as a * -->
44 <!-- * patternset refid. * -->
46 <!-- ********************************************************** -->
47 <patternset id="all_files" includes="com/**,de/**" />
49 <patternset id="no_jsapi"
50 includes="com/**,de/**"
51 excludes="com/sun/speech/engine/**,
52 com/sun/speech/freetts/jsapi/**" />
54 <target name="set_patternset_to_compile">
55 <condition property="patternset_to_compile" value="all_files">
56 <available file="lib/jsapi.jar" />
58 <condition property="patternset_to_compile" value="no_jsapi">
60 <available file="lib/jsapi.jar" />
65 <!-- ********************************************************** -->
67 <!-- * Handle JSAPI: * -->
69 <!-- * 1) If a jsapi.jar file can be found, use it and * -->
70 <!-- * compile all the sources. * -->
72 <!-- * 2) If a jsapi.jar file cannot be found, issue a * -->
73 <!-- * message and just compile the sources that do * -->
74 <!-- * not depend upon jsapi.jar. * -->
76 <!-- ********************************************************** -->
77 <target name="check_jsapi_jar.isPresent">
78 <available file="lib/jsapi.jar" property="jsapi_jar.isPresent" />
81 <target name="issue_jsapi_warning" unless="jsapi_jar.isPresent">
83 Cannot find lib/jsapi.jar needed to build Java Speech API
84 (JSAPI) support for FreeTTS. Will not build any sources
85 that require jsapi.jar. If you'd like to enable JSAPI
86 support, please extract jsapi.jar by running jsapi.sh or
87 jsapi.exe from the lib directory.
91 <target name="handle_jsapi"
92 depends="check_jsapi_jar.isPresent,
94 set_patternset_to_compile" />
97 <!-- ********************************************************** -->
99 <!-- * Builds srcs, voices, lexicons, jars, demos * -->
101 <!-- ********************************************************** -->
103 depends="compile,jars,demos"
104 description="Build everything">
105 <echo message="Build complete." />
109 <!-- compile everything -->
110 <target name="compile"
111 depends="compile_src,compile_voices,compile_lexicons"
112 description="Build srcs, voices, and lexicons" />
115 <!-- ********************************************************** -->
117 <!-- * Builds just the srcs. The tests are omitted. * -->
119 <!-- ********************************************************** -->
120 <target name="compile_src"
121 depends="check_jsapi_jar.isPresent,
123 set_patternset_to_compile"
124 description="Build just the srcs">
125 <mkdir dir="${classes_dir}" />
131 destdir="${classes_dir}">
132 <patternset refid="${patternset_to_compile}" />
133 <classpath refid="libs" />
138 <!-- ********************************************************** -->
140 <!-- * Builds just the tests - these need JUnit. * -->
142 <!-- ********************************************************** -->
143 <target name="compile_tests"
145 description="Build just the tests">
146 <mkdir dir="${classes_dir}" />
152 destdir="${classes_dir}">
153 <classpath refid="libs" />
158 <!-- ********************************************************** -->
160 <!-- * Generates the binaries for the voices. * -->
162 <!-- ********************************************************** -->
163 <target name="compile_voices"
164 depends="kal8_db,kal16_db,time_awb_db,user_voice_db"
165 description="Generate all of the voice binaries">
170 <property name="kal8_data" value="cmu_us_kal.txt" />
171 <property name="kal8_path"
172 value="com/sun/speech/freetts/en/us/cmu_us_kal" />
173 <target name="check_kal8_db.isUpToDate"
174 description="Compares timestamps of kal8 ASCII and binary">
175 <uptodate property="kal8_db.isUpToDate"
176 srcfile="${src_dir}/${kal8_path}/${kal8_data}"
177 targetfile="${classes_dir}/${kal8_path}/cmu_us_kal.bin" />
180 <target name="kal8_db"
181 depends="compile_src,check_kal8_db.isUpToDate"
182 unless="kal8_db.isUpToDate"
183 description="Generate kal8 voice binaries">
184 <java classname="com.sun.speech.freetts.diphone.DiphoneUnitDatabase"
188 <path refid="libs" />
189 <pathelement location="${classes_dir}" />
191 <arg line="-src ${src_dir}/${kal8_path}" />
192 <arg line="-dest ${classes_dir}/${kal8_path}" />
193 <arg line="-generate_binary ${kal8_data}" />
198 <property name="kal16_data" value="cmu_us_kal16.txt" />
199 <property name="kal16_path"
200 value="com/sun/speech/freetts/en/us/cmu_us_kal" />
201 <target name="check_kal16_db.isUpToDate"
202 description="Compares timestamps of kal16 ASCII and binary">
203 <uptodate property="kal16_db.isUpToDate"
204 srcfile="${src_dir}/${kal16_path}/${kal16_data}"
205 targetfile="${classes_dir}/${kal16_path}/cmu_us_kal16.bin" />
208 <target name="kal16_db"
209 depends="compile_src,check_kal16_db.isUpToDate"
210 unless="kal16_db.isUpToDate"
211 description="Generate kal16 binaries">
212 <java classname="com.sun.speech.freetts.diphone.DiphoneUnitDatabase"
216 <path refid="libs" />
217 <pathelement location="${classes_dir}" />
219 <arg line="-src ${src_dir}/${kal16_path}" />
220 <arg line="-dest ${classes_dir}/${kal16_path}" />
221 <arg line="-generate_binary ${kal16_data}" />
226 <property name="time_awb_data" value="cmu_time_awb.txt" />
227 <property name="time_awb_path"
228 value="com/sun/speech/freetts/en/us/cmu_time_awb" />
229 <target name="check_time_awb_db.isUpToDate"
230 description="Compares timestamps of time_awb ASCII and binary">
231 <uptodate property="time_awb_db.isUpToDate"
232 srcfile="${src_dir}/${time_awb_path}/${time_awb_data}"
233 targetfile="${classes_dir}/${time_awb_path}/cmu_time_awb.bin" />
236 <target name="time_awb_db"
237 depends="compile_src,check_time_awb_db.isUpToDate"
238 unless="time_awb_db.isUpToDate"
239 description="Generate time_awb binaries">
240 <java classname="com.sun.speech.freetts.clunits.ClusterUnitDatabase"
244 <path refid="libs" />
245 <pathelement location="${classes_dir}" />
247 <arg line="-src ${src_dir}/${time_awb_path}" />
248 <arg line="-dest ${classes_dir}/${time_awb_path}" />
249 <arg line="-generate_binary ${time_awb_data}" />
254 <!-- ********************************************************** -->
256 <!-- * User defined voices (e.g., those created by the * -->
257 <!-- * FestVoxToFreeTTS tool) can be compiled by running * -->
258 <!-- * ant with the -D parameter to define either the * -->
259 <!-- * 'clunit_voice' or 'diphone_voice' property: * -->
261 <!-- * -Darctic_voice=cmu_us_bdl_arctic * -->
262 <!-- * -Dclunit_voice=sun_time_wdw * -->
263 <!-- * -Ddiphone_voice=sun_us_wdw * -->
265 <!-- * If the voice is to be created at a custom path * -->
266 <!-- * (e.g., for non-us-English voices), the following * -->
267 <!-- * property can OPTIONALLY be set: * -->
269 <!-- * -Duser_voice_base_path=de/dfki/lt/freetts/de * -->
271 <!-- ********************************************************** -->
272 <target name="set_user_voice_to_clunit_voice" if="clunit_voice">
273 <property name="user_voice" value="${clunit_voice}" />
275 <target name="set_user_voice_to_diphone_voice" if="diphone_voice">
276 <property name="user_voice" value="${diphone_voice}" />
278 <target name="set_user_voice"
279 depends="set_user_voice_to_clunit_voice,
280 set_user_voice_to_diphone_voice">
281 <property name="user_voice_base_path"
282 value="com/sun/speech/freetts/en/us" />
283 <property name="user_voice_path"
284 value="${user_voice_base_path}/${user_voice}" />
287 <target name="check_user_voice_db.isUpToDate"
288 depends="set_user_voice"
289 description="Compares timestamps of user voice ASCII and binary">
290 <uptodate property="user_voice_db.isUpToDate"
291 srcfile="${src_dir}/${user_voice_path}/${user_voice}.txt"
292 targetfile="${classes_dir}/${user_voice_path}/${user_voice}.bin" />
295 <target name="user_voice_db"
296 depends="set_user_voice,
300 description="Generate user voice binaries" />
302 <target name="clunit_voice_db"
303 depends="compile_src,check_user_voice_db.isUpToDate"
305 unless="user_voice_db.isUpToDate"
306 description="Generate user voice binaries">
307 <java classname="com.sun.speech.freetts.clunits.ClusterUnitDatabase"
311 <path refid="libs" />
312 <pathelement location="${classes_dir}" />
314 <arg line="-src ${src_dir}/${user_voice_path}" />
315 <arg line="-dest ${classes_dir}/${user_voice_path}" />
316 <arg line="-generate_binary ${user_voice}.txt" />
318 <copy todir="${classes_dir}/${user_voice_path}" failonerror="false">
319 <fileset dir="${src_dir}/${user_voice_path}"
320 includes="phoneset.txt ${user_voice}.debug" />
324 <target name="diphone_voice_db"
325 depends="compile_src,check_user_voice_db.isUpToDate"
327 unless="user_voice_db.isUpToDate"
328 description="Generate user voice binaries">
329 <java classname="com.sun.speech.freetts.diphone.DiphoneUnitDatabase"
333 <path refid="libs" />
334 <pathelement location="${classes_dir}" />
336 <arg line="-src ${src_dir}/${user_voice_path}" />
337 <arg line="-dest ${classes_dir}/${user_voice_path}" />
338 <arg line="-generate_binary ${user_voice}.txt" />
343 <!-- ********************************************************** -->
345 <!-- * Generate the binaries for the lexicons * -->
347 <!-- ********************************************************** -->
348 <target name="compile_lexicons"
349 depends="cmulex_db,cmudict04_db,cmutimelex_db"
350 description="Generate cmulex, cmudict04, and cmutimelex binaries">
354 <property name="cmulex_data" value="cmulex" />
355 <property name="cmulex_path" value="com/sun/speech/freetts/en/us" />
357 <!-- The *_{compiled,addenda}.bin files are created at once.
358 So, if any of the *.txt files are newer than one of these
359 files (I chose *_compiled.bin), then recreate the *.bin files.
361 <target name="check_cmulex_db.isUpToDate"
362 description="Compares timestamps of cmulex ASCII and binary">
363 <uptodate property="cmulex_db.isUpToDate"
364 targetfile="${classes_dir}/${cmulex_path}/${cmulex_data}_compiled.bin">
365 <srcfiles dir="${src_dir}/${cmulex_path}"
366 includes="${cmulex_data}_*.txt" />
370 <target name="cmulex_db"
371 depends="compile_src,
372 check_cmulex_db.isUpToDate,
374 unless="cmulex_db.isUpToDate"
375 description="Generate cmulex compiled and addenda binaries">
376 <java classname="com.sun.speech.freetts.en.us.CMULexicon"
380 <path refid="libs" />
381 <pathelement location="${classes_dir}" />
383 <arg line="-src ${src_dir}/${cmulex_path}" />
384 <arg line="-dest ${classes_dir}/${cmulex_path}" />
385 <arg line="-name ${cmulex_data}" />
386 <arg line="-generate_binary" />
391 <target name="check_cmulex_lts_db.isUpToDate"
392 description="Compares timestamps of cmulex_lts ASCII and binary">
393 <uptodate property="cmulex_lts_db.isUpToDate"
394 srcfile="${src_dir}/${cmulex_path}/${cmulex_data}_lts.txt"
395 targetfile="${classes_dir}/${cmulex_path}/${cmulex_data}_lts.bin" />
398 <target name="cmulex_lts_db"
399 depends="compile_src,check_cmulex_lts_db.isUpToDate"
400 unless="cmulex_lts_db.isUpToDate"
401 description="Generate cmulex lts binary">
402 <java classname="com.sun.speech.freetts.lexicon.LetterToSoundImpl"
406 <path refid="libs" />
407 <pathelement location="${classes_dir}" />
409 <arg line="-src ${src_dir}/${cmulex_path}" />
410 <arg line="-dest ${classes_dir}/${cmulex_path}" />
411 <arg line="-name ${cmulex_data}_lts" />
412 <arg line="-generate_binary" />
418 <property name="cmudict04_data" value="cmudict04" />
419 <property name="cmudict04_path" value="com/sun/speech/freetts/en/us" />
421 <!-- The *_{compiled,addenda}.bin files are created at once.
422 So, if any of the *.txt files are newer than one of these
423 files (I chose *_compiled.bin), then recreate the *.bin files.
425 <target name="check_cmudict04_db.isUpToDate"
426 description="Compares timestamps of cmudict04 ASCII and binary">
427 <uptodate property="cmudict04_db.isUpToDate"
428 targetfile="${classes_dir}/${cmudict04_path}/${cmudict04_data}_compiled.bin">
429 <srcfiles dir="${src_dir}/${cmudict04_path}"
430 includes="${cmudict04_data}_*.txt" />
434 <target name="cmudict04_db"
435 depends="compile_src,
436 check_cmudict04_db.isUpToDate,
438 unless="cmudict04_db.isUpToDate"
439 description="Generate cmudict04 compiled and addenda binaries">
440 <java classname="com.sun.speech.freetts.en.us.CMULexicon"
444 <path refid="libs" />
445 <pathelement location="${classes_dir}" />
447 <arg line="-src ${src_dir}/${cmudict04_path}" />
448 <arg line="-dest ${classes_dir}/${cmudict04_path}" />
449 <arg line="-name ${cmudict04_data}" />
450 <arg line="-generate_binary" />
455 <target name="check_cmudict04_lts_db.isUpToDate"
456 description="Compares timestamps of cmudict04_lts ASCII and binary">
457 <uptodate property="cmudict04_lts_db.isUpToDate"
458 srcfile="${src_dir}/${cmudict04_path}/${cmudict04_data}_lts.txt"
459 targetfile="${classes_dir}/${cmudict04_path}/${cmudict04_data}_lts.bin" />
462 <target name="cmudict04_lts_db"
463 depends="compile_src,check_cmudict04_lts_db.isUpToDate"
464 unless="cmudict04_lts_db.isUpToDate"
465 description="Generate cmudict04 lts binary">
466 <java classname="com.sun.speech.freetts.lexicon.LetterToSoundImpl"
470 <path refid="libs" />
471 <pathelement location="${classes_dir}" />
473 <arg line="-src ${src_dir}/${cmudict04_path}" />
474 <arg line="-dest ${classes_dir}/${cmudict04_path}" />
475 <arg line="-name ${cmudict04_data}_lts" />
476 <arg line="-generate_binary" />
482 <property name="cmutimelex_data" value="cmutimelex" />
483 <property name="cmutimelex_path" value="com/sun/speech/freetts/en/us" />
485 <!-- The *_{compiled,addenda}.bin files are created at once.
486 So, if any of the *.txt files are newer than one of these
487 files (I chose *_compiled.bin), then recreate the *.bin files.
489 <target name="check_cmutimelex_db.isUpToDate"
490 description="Compares timestamps of cmulextime ASCII and binary">
491 <uptodate property="cmutimelex_db.isUpToDate"
492 targetfile="${classes_dir}/${cmutimelex_path}/${cmutimelex_data}_compiled.bin">
493 <srcfiles dir="${src_dir}/${cmutimelex_path}"
494 includes="${cmutimelex_data}_*.txt" />
498 <target name="cmutimelex_db"
499 depends="compile_src,
500 check_cmutimelex_db.isUpToDate,
502 unless="cmutimelex_db.isUpToDate"
503 description="Generate cmutimelex compiled and addenda binaries">
504 <java classname="com.sun.speech.freetts.en.us.CMULexicon"
508 <path refid="libs" />
509 <pathelement location="${classes_dir}" />
511 <arg line="-src ${src_dir}/${cmutimelex_path}" />
512 <arg line="-dest ${classes_dir}/${cmutimelex_path}" />
513 <arg line="-name ${cmutimelex_data}" />
514 <arg line="-generate_binary" />
519 <target name="check_cmutimelex_lts_db.isUpToDate"
520 description="Compares timestamps of cmulextime_lts ASCII and binary">
521 <uptodate property="cmutimelex_lts_db.isUpToDate"
522 srcfile="${src_dir}/${cmutimelex_path}/${cmutimelex_data}_lts.txt"
523 targetfile="${classes_dir}/${cmutimelex_path}/${cmutimelex_data}_lts.bin" />
526 <target name="cmutimelex_lts_db"
527 depends="compile_src,check_cmutimelex_lts_db.isUpToDate"
528 unless="cmutimelex_lts_db.isUpToDate"
529 description="Generate cmutimelex lts binary">
530 <java classname="com.sun.speech.freetts.lexicon.LetterToSoundImpl"
534 <path refid="libs" />
535 <pathelement location="${classes_dir}" />
537 <arg line="-src ${src_dir}/${cmutimelex_path}" />
538 <arg line="-dest ${classes_dir}/${cmutimelex_path}" />
539 <arg line="-name ${cmutimelex_data}_lts" />
540 <arg line="-generate_binary" />
545 <!-- German dummy lexicon -->
546 <!-- As this is only a dummy at the moment, it is not added -->
547 <!-- to the general compile_lexicons targert -->
548 <property name="germanlex_data" value="germanlex" />
549 <property name="germanlex_path" value="de/dfki/lt/freetts/de" />
551 <!-- The *_{compiled,addenda}.bin files are created at once.
552 So, if any of the *.txt files are newer than one of these
553 files (I chose *_compiled.bin), then recreate the *.bin files.
555 <target name="check_germanlex_db.isUpToDate"
556 description="Compares timestamps of ASCII and binary">
557 <uptodate property="germanlex_db.isUpToDate"
558 targetfile="${classes_dir}/${germanlex_path}/${germanlex_data}_compiled.bin">
559 <srcfiles dir="${src_dir}/${germanlex_path}"
560 includes="${germanlex_data}_*.txt" />
564 <target name="germanlex_db"
565 depends="compile_src,
566 check_germanlex_db.isUpToDate,
568 unless="germanlex_db.isUpToDate"
569 description="Generate compiled and addenda binaries">
570 <java classname="de.dfki.lt.freetts.de.GermanLexicon"
574 <path refid="libs" />
575 <pathelement location="${classes_dir}" />
577 <arg line="-src ${src_dir}/${germanlex_path}" />
578 <arg line="-dest ${classes_dir}/${germanlex_path}" />
579 <arg line="-name ${germanlex_data}" />
580 <arg line="-generate_binary" />
585 <target name="check_germanlex_lts_db.isUpToDate"
586 description="Compares timestamps of germanlex_lts ASCII and binary">
587 <uptodate property="germanlex_lts_db.isUpToDate"
588 srcfile="${src_dir}/${germanlex_path}/${germanlex_data}_lts.txt"
589 targetfile="${classes_dir}/${germanlex_path}/${germanlex_data}_lts.bin" />
592 <target name="germanlex_lts_db"
593 depends="compile_src,check_germanlex_lts_db.isUpToDate"
594 unless="germanlex_lts_db.isUpToDate"
595 description="Generate germanlex lts binary">
596 <java classname="com.sun.speech.freetts.lexicon.LetterToSoundImpl"
600 <path refid="libs" />
601 <pathelement location="${classes_dir}" />
603 <arg line="-src ${src_dir}/${germanlex_path}" />
604 <arg line="-dest ${classes_dir}/${germanlex_path}" />
605 <arg line="-name ${germanlex_data}_lts" />
606 <arg line="-generate_binary" />
611 <!-- ********************************************************** -->
613 <!-- * Generates the jar files. * -->
615 <!-- ********************************************************** -->
617 depends="freetts_jar,
627 description="Builds all the jar files" />
630 <property name="freetts__jsapi10_jar"
\r
631 value="${lib_dir}/freetts-jsapi10.jar" />
\r
632 <property name="freetts_jar" value="${lib_dir}/freetts.jar" />
634 <target name="-freetts_jsapi10_jar" depends="compile_src">
\r
635 <mkdir dir="${lib_dir}" />
\r
636 <jar destfile="${freetts__jsapi10_jar}" compress="true">
\r
638 <attribute name="Built-By" value="${user.name}" />
\r
639 <section name="common">
\r
640 <attribute name="Implementation-Title"
\r
641 value="FreeTTS JSAPI 1.0 layer" />
\r
644 <fileset dir="${classes_dir}">
\r
645 <include name="com/sun/speech/engine/**"/>
\r
646 <include name="com/sun/speech/freetts/jsapi/**"/>
\r
651 <target name="freetts_jar"
652 depends="-freetts_jsapi10_jar,compile_src"
653 description="Create ${lib_dir}/freetts.jar">
654 <mkdir dir="${lib_dir}" />
655 <jar destfile="${freetts_jar}" compress="true">
\r
657 <attribute name="Built-By" value="${user.name}" />
\r
658 <attribute name="Main-Class"
\r
659 value="com.sun.speech.freetts.FreeTTS" />
\r
660 <section name="common">
\r
661 <attribute name="Implementation-Title"
\r
662 value="FreeTTS core library" />
\r
665 <fileset dir="${classes_dir}">
\r
666 <include name="com/sun/speech/freetts/**"/>
\r
667 <exclude name="com/sun/speech/freetts/en/**"/>
\r
668 <exclude name="com/sun/speech/freetts/jsapi/**"/>
\r
669 <include name="de/dfki/lt/freetts/**"/>
\r
670 <exclude name="de/dfki/lt/freetts/en/**"/>
\r
671 <exclude name="de/dfki/lt/freetts/de/**"/>
\r
672 <exclude name="de/dfki/lt/mbrola/**"/>
\r
673 <exclude name="tests/**"/>
\r
674 <exclude name="**/*.bin"/>
\r
675 <exclude name="**/*.idx"/>
\r
677 <fileset dir="${src_dir}">
\r
678 <include name="com/sun/speech/freetts/internal_voices.txt"/>
\r
685 <property name="mbrola_jar" value="${mbrola_dir}/mbrola.jar" />
687 <target name="mbrola_jar"
688 depends="compile_src"
689 description="Create ${mbrola_dir}/mbrola.jar">
690 <mkdir dir="${mbrola_dir}" />
691 <jar destfile="${mbrola_jar}"
692 manifest="${src_dir}/de/dfki/lt/freetts/en/us/Manifest"
694 <fileset dir="${classes_dir}"
695 includes="de/dfki/lt/freetts/mbrola/**,
696 de/dfki/lt/freetts/en/us//**" />
702 <property name="en_us_jar" value="${lib_dir}/en_us.jar" />
704 <target name="en_us_jar"
705 depends="compile_src"
706 description="Create ${lib_dir}/en_us.jar">
707 <mkdir dir="${lib_dir}" />
708 <jar destfile="${en_us_jar}"
709 manifest="${src_dir}/com/sun/speech/freetts/en/us/en_us.Manifest"
712 <fileset dir="${classes_dir}"
713 includes="com/sun/speech/freetts/en/*.class,
714 com/sun/speech/freetts/en/us/*.class" />
715 <fileset dir="${src_dir}"
716 includes="com/sun/speech/freetts/en/us/*.txt"
717 excludes="**/cmu*lex*.txt" />
722 <!-- As this is only a dummy at the moment, it is not added -->
723 <!-- to the general jars target -->
724 <property name="de_jar" value="${lib_dir}/de.jar" />
726 <target name="de_jar"
727 depends="compile_src"
728 description="Create ${lib_dir}/de.jar">
729 <mkdir dir="${lib_dir}" />
730 <jar destfile="${de_jar}"
731 manifest="${src_dir}/de/dfki/lt/freetts/de/de.Manifest"
734 <fileset dir="${classes_dir}"
735 includes="de/dfki/lt/freetts/de/*.class" />
736 <fileset dir="${src_dir}"
737 includes="de/dfki/lt/freetts/de/*.txt"
738 excludes="**/*lex*.txt" />
744 <property name="cmulex_jar" value="${lib_dir}/cmulex.jar" />
746 <target name="cmulex_jar"
747 depends="compile_lexicons"
748 description="Create ${lib_dir}/cmulex.jar">
749 <mkdir dir="${lib_dir}" />
750 <jar destfile="${cmulex_jar}"
751 manifest="${src_dir}/com/sun/speech/freetts/en/us/cmulex.Manifest"
754 <fileset dir="${classes_dir}"
755 includes="com/sun/speech/freetts/en/us/cmulex_*.bin" />
760 <!-- cmudict04.jar -->
761 <property name="cmudict04_jar" value="${lib_dir}/cmudict04.jar" />
763 <target name="cmudict04_jar"
764 depends="compile_lexicons"
765 description="Create ${lib_dir}/cmudict04.jar">
766 <mkdir dir="${lib_dir}" />
767 <jar destfile="${cmudict04_jar}"
768 manifest="${src_dir}/com/sun/speech/freetts/en/us/cmudict04.Manifest"
771 <fileset dir="${classes_dir}"
772 includes="com/sun/speech/freetts/en/us/cmudict04_*.bin" />
777 <!-- cmutimelex.jar -->
778 <property name="cmutimelex_jar" value="${lib_dir}/cmutimelex.jar" />
780 <target name="cmutimelex_jar"
781 depends="compile_lexicons"
782 description="Create ${lib_dir}/cmutimelex.jar">
783 <mkdir dir="${lib_dir}" />
784 <jar destfile="${cmutimelex_jar}"
785 manifest="${src_dir}/com/sun/speech/freetts/en/us/cmutimelex.Manifest"
788 <fileset dir="${classes_dir}"
789 includes="com/sun/speech/freetts/en/us/cmutimelex_*.bin" />
795 <!-- germanlex.jar -->
796 <!-- As this is only a dummy at the moment, it is not added -->
797 <!-- to the general jars target -->
798 <property name="germanlex_jar" value="${lib_dir}/germanlex.jar" />
800 <target name="germanlex_jar"
801 depends="germanlex_db"
802 description="Create ${lib_dir}/germanlex.jar">
803 <mkdir dir="${lib_dir}" />
804 <jar destfile="${germanlex_jar}"
805 manifest="${src_dir}/de/dfki/lt/freetts/de/germanlex.Manifest"
808 <fileset dir="${classes_dir}"
809 includes="de/dfki/lt/freetts/de/germanlex_*.bin" />
814 <!-- cmu_us_kal.jar -->
815 <property name="cmu_us_kal_jar" value="${lib_dir}/cmu_us_kal.jar" />
817 <target name="cmu_us_kal_jar"
818 depends="compile_voices"
819 description="Create ${lib_dir}/cmu_us_kal.jar">
820 <mkdir dir="${lib_dir}" />
821 <jar destfile="${cmu_us_kal_jar}"
822 manifest="${src_dir}/com/sun/speech/freetts/en/us/cmu_us_kal/voice.Manifest"
825 <fileset dir="${classes_dir}"
826 includes="com/sun/speech/freetts/en/us/cmu_us_kal/*" />
831 <!-- cmu_time_awb.jar -->
832 <property name="cmu_time_awb_jar" value="${lib_dir}/cmu_time_awb.jar" />
834 <target name="cmu_time_awb_jar"
835 depends="compile_voices"
836 description="Create ${lib_dir}/cmu_time_awb.jar">
837 <mkdir dir="${lib_dir}" />
838 <jar destfile="${cmu_time_awb_jar}"
839 manifest="${src_dir}/com/sun/speech/freetts/en/us/cmu_time_awb/voice.Manifest"
842 <fileset dir="${classes_dir}"
843 includes="com/sun/speech/freetts/en/us/cmu_time_awb/*" />
848 <!-- arctic voice -->
849 <target name="arctic_voice_jar"
852 description="Create ${lib_dir}/${arctic_voice}.jar">
853 <mkdir dir="${lib_dir}" />
854 <jar destfile="${lib_dir}/${arctic_voice}.jar"
855 manifest="${src_dir}/com/sun/speech/freetts/en/us/${arctic_voice}/voice.Manifest"
858 <fileset dir="${classes_dir}"
859 includes="com/sun/speech/freetts/en/us/${arctic_voice}/*" />
860 <fileset dir="${src_dir}"
861 includes="com/sun/speech/freetts/en/us/${arctic_voice}/*.txt" />
866 <target name="user_voice_jar"
867 depends="compile_voices"
869 description="Create ${lib_dir}/${user_voice}.jar">
870 <mkdir dir="${lib_dir}" />
871 <jar destfile="${lib_dir}/${user_voice}.jar"
872 manifest="${src_dir}/${user_voice_path}/voice.Manifest"
875 <fileset dir="${classes_dir}" includes="${user_voice_path}/*" />
880 <!-- ********************************************************** -->
882 <!-- * Generates the javadoc * -->
884 <!-- ********************************************************** -->
885 <property name="javadoc_desc" value="FreeTTS 1.2" />
886 <property name="javadoc_pkgs"
887 value="com.sun.speech.engine,
888 com.sun.speech.engine.synthesis,
889 com.sun.speech.engine.synthesis.text,
890 com.sun.speech.freetts,
891 com.sun.speech.freetts.jsapi,
892 com.sun.speech.freetts.en,
893 com.sun.speech.freetts.en.us,
894 com.sun.speech.freetts.audio,
895 com.sun.speech.freetts.cart,
896 com.sun.speech.freetts.clunits,
897 com.sun.speech.freetts.diphone,
898 com.sun.speech.freetts.lexicon,
899 com.sun.speech.freetts.relp,
900 com.sun.speech.freetts.util,
901 de.dfki.lt.freetts.mbrola,
902 de.dfki.lt.freetts.en.us" />
904 <target name="javadoc" description="Generate javadoc">
905 <mkdir dir="${javadoc_dir}" />
906 <javadoc sourcepath="${src_dir}"
908 additionalparam="-breakiterator"
909 destdir="${javadoc_dir}"
910 packagenames="${javadoc_pkgs}"
911 overview="overview.html"
912 windowtitle="${javadoc_desc}"
913 doctitle="${javadoc_desc}"
915 <classpath refid="libs" />
920 <!-- ********************************************************** -->
922 <!-- * Builds just the demos. * -->
924 <!-- ********************************************************** -->
926 depends="freetts_jar"
927 description="Compiles and jars the demos">
928 <ant antfile="demo.xml" inheritall="false" />
932 <!-- ********************************************************** -->
934 <!-- * Convenience for emacspeak-server. * -->
936 <!-- ********************************************************** -->
937 <target name="emacspeak-server" depends="compile,jars" description="">
938 <ant antfile="demo.xml" target="emacspeak-server" />
942 <!-- ********************************************************** -->
944 <!-- * Runs the unit tests. * -->
946 <!-- * This will execute AllTests.java from the test * -->
947 <!-- * directory. You can also tell ant to run one test by * -->
948 <!-- * adding the following to the ant command line: * -->
950 <!-- * -Dtestcase=<fully qualified classname> * -->
952 <!-- ********************************************************** -->
953 <path id="test_classpath">
954 <pathelement location="${lib_dir}/freetts.jar" />
955 <pathelement location="${classes_dir}" />
956 <pathelement location="${src_dir}" />
957 <pathelement location="${junit.jar}" />
958 <path refid="libs" />
960 <target name="junit" depends="jars">
961 <junit dir="tests" fork="yes" printsummary="false" haltonfailure="true">
962 <classpath refid="test_classpath" />
963 <formatter type="plain" usefile="false" />
964 <test name="${testcase}" if="testcase" />
965 <batchtest unless="testcase">
966 <fileset dir="${classes_dir}" includes="tests/AllTests.class" />
971 <!-- [[[WDW - don't know why this will not work anywhere, but
973 <target name="regression" depends="jars">
974 <echo message="Running regression tests."/>
975 <echo message="NOTE: these will not run on Windows."/>
976 <exec dir="tests" executable="regression.sh"/>
980 <!-- ********************************************************** -->
982 <!-- * Make the packages for deployment. * -->
984 <!-- ********************************************************** -->
985 <fileset id="srcs" dir="${src_dir}" includes="com/**,de/**" />
989 includes="acknowledgments.txt,
994 includes="index.html,overview.html,README.txt,RELEASE_NOTES,
996 docs/**,mbrola/*.html,
998 excludes="docs/*.awk" />
1000 <fileset id="demos" dir="." includes="demo/**" />
1002 <fileset id="tools" dir="." includes="tools/**" />
1004 <fileset id="tests" dir="." includes="tests/**" />
1006 <fileset id="binaries"
1008 includes="lib/*.jar,bin/*.jar,mbrola/*.jar"
1009 excludes="lib/jsapi.jar" />
1011 <fileset id="jsapi_sh"
1013 includes="lib/jsapi.sh,lib/jsapi.exe,lib/README.txt" />
1015 <target name="deploy"
1016 depends="deploy_init,
1020 deploy_webstartclock"
1021 description="Creates *.zip files for deployment" />
1023 <target name="deploy_init"
1024 description="Copies files to the deploy staging directory."
1025 depends="all,javadoc">
1026 <mkdir dir="${deploy_dir}/freetts-${version}" />
1027 <copy todir="${deploy_dir}/freetts-${version}" includeEmptyDirs="false">
1029 includes="build.xml,
1033 <fileset refid="srcs" />
1034 <fileset refid="legal" />
1035 <fileset refid="docs" />
1036 <fileset refid="demos" />
1037 <fileset refid="tools" />
1038 <fileset refid="tests" />
1039 <fileset refid="binaries" />
1040 <fileset refid="jsapi_sh" />
1044 <!-- freetts-srcs -->
1045 <target name="deploy_src" depends="deploy_init">
1046 <jar destfile="${deploy_dir}/freetts-${version}-src.zip"
1047 basedir="${deploy_dir}"
1050 includes="freetts-${version}/**"
1051 excludes="**/*.jar,**/tests/**" />
1055 <!-- freetts-bin -->
1056 <target name="deploy_bin" depends="deploy_init">
1057 <jar destfile="${deploy_dir}/freetts-${version}-bin.zip"
1058 basedir="${deploy_dir}"
1061 includes="freetts-${version}/**"
1062 excludes="freetts-${version}/build.xml,
1063 freetts-${version}/overview.html,
1065 freetts-${version}/de/**,
1066 freetts-${version}/com/**" />
1070 <!-- freetts-tests -->
1071 <target name="deploy_tst">
1072 <jar destfile="${deploy_dir}/freetts-${version}-tst.zip"
1073 basedir="${deploy_dir}"
1076 includes="freetts-${version}/acknowledgments.txt,
1077 freetts-${version}/license.terms,
1078 freetts-${version}/tests/**" />
1082 <!-- webstartclock -->
1083 <target name="deploy_webstartclock"
1085 description="Signs jars and creates tarball for web start demo">
1086 <ant antfile="demo.xml" target="deploy_webstartclock" />
1090 <!-- ********************************************************** -->
1092 <!-- * Make a tarball containing things free of JSAPI * -->
1093 <!-- * dependencies. Also omits the tests. * -->
1095 <!-- ********************************************************** -->
1096 <target name="freetts_only_tarball"
1097 depends="set_patternset_to_compile"
1098 description="Create a tarball of sources free of JSAPI dependencies.">
1099 <delete dir="${deploy_dir}/freetts-only-${version}" />
1100 <mkdir dir="${deploy_dir}/freetts-only-${version}" />
1101 <copy todir="${deploy_dir}/freetts-only-${version}"
1102 includeEmptyDirs="false">
1104 includes="build.xml,
1110 acknowledgments.txt,
1117 excludes="demo/JSAPI/**,
1120 <patternset refid="${patternset_to_compile}" />
1123 <copy file="docs/emacspeak_index.html"
1124 tofile="${deploy_dir}/freetts-only-${version}/index.html" />
1125 <tar destfile="${deploy_dir}/freetts-only-${version}.tar.gz"
1126 basedir="${deploy_dir}"
1127 includes="freetts-only-${version}/**"
1128 compression="gzip" />
1131 <!-- ********************************************************** -->
1133 <!-- * Deletes all build output and *~ file droppings * -->
1135 <!-- ********************************************************** -->
1136 <target name="clean" description="Delete all build output">
1137 <delete quiet="true" includeEmptyDirs="true">
1138 <fileset defaultexcludes="no" dir="." includes="**/*~" />
1139 <fileset defaultexcludes="no"
1142 excludes="**/jsapi.jar" />
1143 <fileset defaultexcludes="no"
1145 includes="**/mbrola.jar" />
1147 <delete dir="${bin_dir}" />
1148 <delete dir="${build_dir}" />
1149 <delete dir="${javadoc_dir}" />
1150 <delete dir="${deploy_dir}" />
1153 <target name="debug"
1156 description="Debug Project">
1157 <java fork="true" classname="FreeTTSHelloWorld">
1158 <jvmarg value="-Xdebug" />
1159 <jvmarg value="-Xnoagent" />
1160 <jvmarg value="-Djava.compiler=none" />
1161 <jvmarg value="-Dfreetts.voices=com.sun.speech.freetts.en.us.cmu_us_kal.KevinVoiceDirectory" />
1162 <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y" />
1164 <pathelement path="${src_dir}" />
1165 <pathelement path="bld/demo_classes/freetts/HelloWorld" />
1166 <pathelement path="${classes_dir}" />
1167 <pathelement location="lib/jsapi.jar" />