Skip to content

Instantly share code, notes, and snippets.

@pcwhite
Last active September 8, 2017 17:43
Show Gist options
  • Save pcwhite/ef1db7f7f1377de59f7d5d2f5b6f8f53 to your computer and use it in GitHub Desktop.
Save pcwhite/ef1db7f7f1377de59f7d5d2f5b6f8f53 to your computer and use it in GitHub Desktop.
<?xml version="1.0"?>
<project name="app" basedir="." default="compile">
<import file="build.xml" />
<property name="app.server" value="tomcat" />
<property name="database.name" value="lportal_exercise4" />
<target name="compile" description="Compiles source into bundle and starts up portal and runs a test">
<ant antfile="build-dist.xml" target="unzip-tomcat" />
<antcall target="initDatabase" />
<antcall target="portal-ext" />
<antcall target="all" />
<antcall target="catalinaRun" />
<antcall target="testcase" />
</target>
<target name="initDatabase" description="Creates database, drops it if it already exists">
<exec executable="mysql">
<arg line="-e &quot;drop database if exists ${database.name}&quot;;" />
<arg line="-e &quot;create database ${database.name}&quot;;" />
</exec>
</target>
<target name="portal-ext" description="Creates/updates portal-ext.properties">
<property name="jdbc.default.driverClassName" value="com.mysql.jdbc.Driver" />
<property name="jdbc.default.url" value="jdbc\:mysql\://localhost/${database.name}?useUnicode\=true&amp;characterEncoding\=UTF-8&amp;useFastDateParsing\=false" />
<property name="browser.launcher.url" value="http://localhost:8080/" />
<property name="PATH_portal-ext.properties" value="portal-impl/src/portal-ext.properties" />
<propertyfile file="${PATH_portal-ext.properties}">
<entry key="plugins.notification.enabled" value="false" />
<entry key="jdbc.default.jndi.name" value="" />
<entry key="jdbc.default.driverClassName" value="${jdbc.default.driverClassName}" />
<entry key="jdbc.default.url" value="@DEFAULT_URL" />
<entry key="jdbc.default.username" value="" />
<entry key="jdbc.default.password" value="" />
<entry key="browser.launcher.url" value="@LAUNCHER_URL" />
<entry key="index.on.startup" value="true" />
<entry key="mail.session.jndi.name" value="" />
<entry key="axis.servlet.hosts.allowed" value="" />
<entry key="tunnel.servlet.hosts.allowed" value="" />
<entry key="setup.wizard.enabled" value="false" />
<entry key="terms.of.use.required" value="false" />
<entry key="users.reminder.queries.enabled" value="false" />
</propertyfile>
<replace file="${PATH_portal-ext.properties}" token="@DEFAULT_URL" value="${jdbc.default.url}" />
<replace file="${PATH_portal-ext.properties}" token="@LAUNCHER_URL" value="${browser.launcher.url}" />
</target>
<target name="catalinaRun" description="starts up portal with tomcat">
<property name="username" value="philipwhite" />
<property name="bundle" value="ee-7.0.x_exercise_branch" />
<property name="tomcat.home" value="/Users/${username}/Portals/liferay.com/${bundle}/tomcat-8.0.32" />
<java classname="org.apache.catalina.startup.Bootstrap" fork="true">
<classpath path="${tomcat.home}/bin/bootstrap.jar:${tomcat.home}/bin/tomcat-juli.jar" />
<jvmarg value="-Dcatalina.home=${tomcat.home}"/>
</java>
</target>
<target name="testcase" description="runs a predefinied test case to make sure the portal is working properly">
<property name="test.class" value="TestBlogs_exercise" />
<ant antfile="build-test.xml" target="run-selenium-test" />
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment