Skip to content

Commit

Permalink
Build an installer package as well as a live install below target -- …
Browse files Browse the repository at this point in the history
…see new Run section in README.txt for details.

git-svn-id: https://mary.opendfki.de/repos/branches/maven-branch@3020 953a6561-930b-0410-b2a6-db37d1b2ae63
  • Loading branch information
marc1s committed Jun 1, 2011
1 parent f34529e commit a44b33e
Show file tree
Hide file tree
Showing 48 changed files with 258 additions and 18 deletions.
File renamed without changes.
14 changes: 12 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 4,7 @@
Compile
-------

MARY TTS builds with Maven; tested with 2.2.1 and 3.0.1. If it is not installed
MARY TTS builds with Maven 3.0.x. If it is not installed
on your system, you can get it from here: http://maven.apache.org/download.html


Expand All @@ -24,4 24,14 @@ Compiling the MARY system itself can be done using

mvn install

in the top-level folder. This will compile the system, run all unit and integration tests, package the system to the extent possible, and install it in your local maven repository.
in the top-level folder. This will compile the system, run all unit and integration tests, package the system to the extent possible, and install it in your local maven repository.


Run
---

After a successful compile, you should find a ready-to-run unpacked install of the MARY TTS server system in target/marytts-<VERSION>. Run the server as

target/marytts-<VERSION>/bin/maryserver.sh

Then connect to it with your browser at http://localhost:59125
87 changes: 87 additions & 0 deletions marytts-assembly/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,87 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>marytts</artifactId>
<groupId>marytts</groupId>
<version>5.0-SNAPSHOT</version>
</parent>

<artifactId>marytts-assembly</artifactId>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-server</artifactId>
<version>5.0-SNAPSHOT</version>
<type>jar</type>
<classifier>jar-with-dependencies</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-lang-de</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-lang-en</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-lang-te</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-lang-tr</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>marytts-lang-ru</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>voice-cmu-slt-hsmm</artifactId>
<version>5.0-SNAPSHOT</version>
</dependency>


</dependencies>


<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<finalName>${project.parent.artifactId}-${project.parent.version}</finalName>
<outputDirectory>${project.parent.build.directory}</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/descriptors/runtime-dir.xml</descriptor>
<descriptor>src/main/descriptors/runtime-pkg.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>

</plugin>

</plugins>
</build>
</project>
14 changes: 14 additions & 0 deletions marytts-assembly/src/main/descriptors/runtime-dir.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,14 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>runtime-dir</id>
<formats>
<format>dir</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>

<componentDescriptors>
<componentDescriptor>src/main/descriptors/runtime.xml</componentDescriptor>
</componentDescriptors>
</assembly>
17 changes: 17 additions & 0 deletions marytts-assembly/src/main/descriptors/runtime-pkg.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,17 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>runtime-pkg</id>
<formats>
<format>tar.gz</format>
<!--format>tar.bz2</format-->
<format>zip</format>
</formats>

<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>${project.parent.build.finalName}</baseDirectory>

<componentDescriptors>
<componentDescriptor>src/main/descriptors/runtime.xml</componentDescriptor>
</componentDescriptors>
</assembly>
51 changes: 51 additions & 0 deletions marytts-assembly/src/main/descriptors/runtime.xml
Original file line number Diff line number Diff line change
@@ -0,0 1,51 @@
<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.2 http://maven.apache.org/xsd/component-1.1.2.xsd">

<fileSets>
<!-- Files from the parent project -->
<fileSet>
<directory>${project.basedir}/..</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>LICENSE*</include>
<include>gpl-3.0.txt</include>
<include>lgpl-3.0.txt</include>
<include>lib/voices/**/*</include>
<include>user-dictionaries/*</include>
</includes>
</fileSet>
<!-- General, non-executable files for release -->
<fileSet>
<directory>src/release</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>doc/examples/**/*</include>
</includes>
</fileSet>

<!-- Executable scripts: -->
<fileSet>
<directory>src/release</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>bin/*</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>

<dependencySets><!-- Copy over jar files -->
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<includes>
<include>${project.groupId}:marytts-server:jar:jar-with-dependencies</include>
<include>${project.groupId}:marytts-lang-*</include>
<include>${project.groupId}:voice-*</include>
</includes>
</dependencySet>
</dependencySets>
</component>
38 changes: 38 additions & 0 deletions marytts-assembly/src/release/bin/maryserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 1,38 @@
#!/bin/bash
##########################################################################
# Copyright (C) 2000-2006 DFKI GmbH.
# All rights reserved. Use is subject to license terms.
#
# Permission is hereby granted, free of charge, to use and distribute
# this software and its documentation without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of this work, and to
# permit persons to whom this work is furnished to do so, subject to
# the following conditions:
#
# 1. The code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
# 2. Any modifications must be clearly marked as such.
# 3. Original authors' names are not deleted.
# 4. The authors' names are not used to endorse or promote products
# derived from this software without specific prior written
# permission.
#
# DFKI GMBH AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DFKI GMBH NOR THE
# CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
# THIS SOFTWARE.
##########################################################################
# MARY TTS server
##########################################################################

# Set the Mary base installation directory in an environment variable:
BINDIR="`dirname "$0"`"
export MARY_BASE="`(cd "$BINDIR"/.. ; pwd)`"


java -showversion -ea -Xms40m -Xmx1g -cp "$MARY_BASE/lib/*" -Dmary.base="$MARY_BASE" $* marytts.server.Mary
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 22,7 @@


import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -93,8 94,13 @@ public JPhonemiser(String componentName,
allophoneSet = MaryRuntimeUtils.needAllophoneSet(allophonesProperty);
// userdict is optional
String userdictFilename = MaryProperties.getFilename(userdictProperty);
if (userdictFilename != null)
userdict = readLexicon(userdictFilename);
if (userdictFilename != null) {
if (new File(userdictFilename).exists()) {
userdict = readLexicon(userdictFilename);
} else {
logger.info("User dictionary '" userdictFilename "' for locale '" getLocale() "' does not exist. Ignoring.");
}
}
InputStream utf8toit3mapStream = MaryProperties.needStream(utf8toit3mapProperty);
lts = new TeluguLTS(utf8toit3mapStream);
}
Expand Down
10 changes: 8 additions & 2 deletions marytts-runtime/src/main/java/marytts/modules/JPhonemiser.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 20,7 @@
package marytts.modules;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -92,8 93,13 @@ public JPhonemiser(String componentName,
allophoneSet = MaryRuntimeUtils.needAllophoneSet(allophonesProperty);
// userdict is optional
String userdictFilename = MaryProperties.getFilename(userdictProperty); // may be null
if (userdictFilename != null)
userdict = readLexicon(userdictFilename);
if (userdictFilename != null) {
if (new File(userdictFilename).exists()) {
userdict = readLexicon(userdictFilename);
} else {
logger.info("User dictionary '" userdictFilename "' for locale '" getLocale() "' does not exist. Ignoring.");
}
}
InputStream lexiconStream = MaryProperties.needStream(lexiconProperty);
lexicon = new FSTLookup(lexiconStream, lexiconProperty);
InputStream ltsStream = MaryProperties.needStream(ltsProperty);
Expand Down
34 changes: 22 additions & 12 deletions marytts-runtime/src/main/java/marytts/server/Mary.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,22 235,32 @@ public static void startup(boolean addJarsToClasspath) throws Exception
System.getProperty("os.arch") ", " System.getProperty("os.version")
")");
logger.debug("MARY_BASE: " MaryProperties.maryBase());
StringBuilder installedMsg = new StringBuilder();
for (String filename : new File(MaryProperties.maryBase() "/installed").list()) {
if (installedMsg.length() > 0) {
installedMsg.append(", ");
String[] installedFilenames = new File(MaryProperties.maryBase() "/installed").list();
if (installedFilenames == null) {
logger.debug("The installed/ folder does not exist.");
} else {
StringBuilder installedMsg = new StringBuilder();
for (String filename : installedFilenames) {
if (installedMsg.length() > 0) {
installedMsg.append(", ");
}
installedMsg.append(filename);
}
installedMsg.append(filename);
logger.debug("Content of installed/ folder: " installedMsg);
}
logger.debug("Content of installed/ folder: " installedMsg);
StringBuilder confMsg = new StringBuilder();
for (String filename : new File(MaryProperties.maryBase() "/conf").list()) {
if (confMsg.length() > 0) {
confMsg.append(", ");
String[] confFilenames = new File(MaryProperties.maryBase() "/conf").list();
if (confFilenames == null) {
logger.debug("The conf/ folder does not exist.");
} else {
StringBuilder confMsg = new StringBuilder();
for (String filename : confFilenames) {
if (confMsg.length() > 0) {
confMsg.append(", ");
}
confMsg.append(filename);
}
confMsg.append(filename);
logger.debug("Content of conf/ folder: " confMsg);
}
logger.debug("Content of conf/ folder: " confMsg);
logger.debug("Full dump of system properties:");
for (Object key : new TreeSet<Object>(System.getProperties().keySet())) {
logger.debug(key " = " System.getProperties().get(key));
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 26,7 @@
<module>marytts-lang-tr</module>
<module>marytts-lang-ru</module>
<module>voice-cmu-slt-hsmm</module>
<module>marytts-assembly</module>
</modules>

<!--
Expand Down

0 comments on commit a44b33e

Please sign in to comment.