12-23-2019, 11:49 PM
Ребят сори за офтоп. Хотел спросить, у меня есть сборка L2Universe исходники. Она билдается с помощью Ant xml скрипта.
Так вот вопрос, есть ли способ перевести скрипт для мейвена и билдать уже мейвеном? Может идея сама умеет такое делать?) Я знаю что есть Maven-Ant plugin. Но так виходит что у меня есть разние модули и в каждом из них по таком вот Build.xml файлу. Я не знаю как красиво сделать. Создать помку, добавить дочерние помки, и юзать скрипт во всех дочерних?
<?xml version="1.0" encoding="UTF-8"?>
<project name="DataPack" default="dist" basedir=".">
<description>
This script will build the L2jInfinity DataPack.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
http://www.gnu.org/copyleft/gpl.html
</description>
<property name="build" location="../builds/datapack" />
<property name="build.dist" location="${build}/dist" />
<property name="build.dist.game" location="${build.dist}/gameserver" />
<property name="build.dist.lang" location="${build.dist}/languages" />
<property name="build.dist.login" location="${build.dist}/login" />
<property name="build.dist.cb" location="${build.dist}/community" />
<property name="build.dist.sql" location="${build.dist}/sql" />
<property name="build.dist.cb_sql" location="${build.dist}/cb_sql" />
<property name="build.dist.tools" location="${build.dist}/tools" />
<property name="build.dist.doc" location="${build.dist}/doc" />
<property name="properties-file" location="${build.dist.game}/config/l2universedp-version.properties" />
<target name="init" description="Create the output directories. Do nothing if dirs were already created">
<mkdir dir="${build}" />
<mkdir dir="${build.dist}" />
<mkdir dir="${build.dist.cb}" />
<mkdir dir="${build.dist.cb_sql}" />
<mkdir dir="${build.dist.game}" />
<mkdir dir="${build.dist.doc}" />
<mkdir dir="${build.dist.lang}" />
<mkdir dir="${build.dist.login}" />
<mkdir dir="${build.dist.sql}" />
<mkdir dir="${build.dist.tools}" />
</target>
<target name="export" description="Syncronizes build space contents with project.">
<sync todir="${build.dist.doc}">
<fileset dir="${basedir}">
<include name="gpl.txt" />
<include name="readme-dp.txt" />
</fileset>
</sync>
<sync todir="${build.dist.game}/data" includeemptydirs="true">
<fileset dir="${basedir}/data">
<exclude name=".project" />
<exclude name="log/**" />
<exclude name="cachedir/**" />
<exclude name="clans/**" />
<exclude name="crests/**" />
<exclude name="**.svn**" />
<exclude name="**/*.class" />
<exclude name="**/*.jar" />
<exclude name="geodata/**" />
<exclude name="pathnode/**" />
</fileset>
</sync>
<sync todir="${build.dist.cb}/data">
<fileset dir="${basedir}/cb_data" />
</sync>
<sync todir="${build.dist.cb_sql}">
<fileset dir="${basedir}/cb_sql" />
</sync>
<sync todir="${build.dist.sql}">
<fileset dir="${basedir}/sql" />
</sync>
<sync todir="${build.dist.tools}">
<fileset dir="${basedir}/tools">
<exclude name="database_installer.rc" />
<exclude name="*.txt" />
<exclude name="*.log" />
<exclude name="*backup.sql" />
</fileset>
</sync>
<sync todir="${build.dist.lang}">
<fileset dir="${basedir}/data/lang" />
</sync>
<sync todir="${build.dist.login}">
<fileset dir="${build.dist.game}/data">
<include name="servername.xml" />
</fileset>
</sync>
</target>
<target name="dist" depends="distclean" description="Creates a ZIP file. Suitable for distribution but building takes longer. See dist-deflate for faster builds.">
<zip destfile="${build}/DataPack.zip" basedir="${build.dist}" update="true" />
</target>
<target name="dist-deflate" depends="distclean" description="Creates a datapack ZIP file with NO compression (bigger ZIP file but faster than regular dist target)">
<zip destfile="${build}/DataPack-nocompress.zip" basedir="${build.dist}" update="true" compress="false" />
</target>
<target name="clean" description="Deletes the whole build space and existing packages.">
<delete dir="${build}" />
</target>
<target name="distclean" depends="export" description="Deletes the datapack distribution ZIP file only, preserving synchronized build files.">
<delete file="${build}/DataPack.zip" />
<delete file="${build}/DataPack-nocompress.zip" />
</target>
</project>
Так вот вопрос, есть ли способ перевести скрипт для мейвена и билдать уже мейвеном? Может идея сама умеет такое делать?) Я знаю что есть Maven-Ant plugin. Но так виходит что у меня есть разние модули и в каждом из них по таком вот Build.xml файлу. Я не знаю как красиво сделать. Создать помку, добавить дочерние помки, и юзать скрипт во всех дочерних?