Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezhov-da/fce720b75c75fd649c93b07fb780f1fd to your computer and use it in GitHub Desktop.
Save ezhov-da/fce720b75c75fd649c93b07fb780f1fd to your computer and use it in GitHub Desktop.
java ant сборка проекта в netbeans для сервиса приложений
#===================================================================================
#собственные настроки для сборки проекта
#===================================================================================
app.version=0.1
config.file=config.properties
app.const=app.version
application.title=assistant_officer
name.zip=${application.title}_${app.version}.zip
<target name="-post-jar">
<!--
===================================
здесь происходят все действия по созданию версии
===================================
-->
<!--<echo> ${basedir}</echo> -->
<!--1. Создаем файл с версией-->
<echo file="${dist.dir}/${config.file}" append="true">${app.const}=${app.version}</echo>
<!---1. копируем пвпку с dll в dist-->
<copy todir="${basedir}/dist/dll">
<fileset dir="${basedir}/dll"/>
</copy>
<copy file="${dist.dir}/${config.file}" tofile="${basedir}/dist/${config.file}"/>
<!--3. удаляем файл архива и папку для архива-->
<delete>
<fileset dir="${folder.project.build}" includes="*.zip"/>
</delete>
<delete dir="${name.folder.for.zip}"/>
<!--4. копируем проектные файлы в папку для архива-->
<copy todir="${name.folder.for.zip}">
<fileset dir="${folder.project.build.dist}"/>
</copy>
<!--5. копируем другие исходники для архива-->
<copy todir="${name.folder.for.zip}">
<fileset dir="${name.folder.dist.file}/"/>
</copy>
<!--6. cоздаем архив-->
<zip destfile="${name.zip}" basedir="${name.folder.for.zip}"/>
<!--7. удялем папку для архива-->
<delete dir="${name.folder.for.zip}"/>
</target>[/code]
<target name="-post-jar">
<!--
===================================
здесь происходят все действия по созданию версии
===================================
-->
<!--<echo> ${basedir}</echo> -->
<!--создаем файл с версией-->
<echo file="${dist.dir}/${config.file}" append="true">${app.const}=${app.version}</echo>
<!--копируем пвпку с dll в dist-->
<copy todir="${basedir}/dist/dll">
<fileset dir="${basedir}/dll"/>
</copy>
<!--копируем файл версий-->
<copy file="${dist.dir}/${config.file}" tofile="${basedir}/dist/${config.file}"/>
<!--копируем файл запросов-->
<copy file="${basedir}/app_config.xml" tofile="${basedir}/dist/app_config.xml"/>
<!--копируем иконку-->
<copy file="${basedir}/phone.png" tofile="${basedir}/dist/phone.png"/>
<!--6. cоздаем архив-->
<zip destfile="${basedir}/dist/${name.zip}" basedir="${basedir}/dist"/>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment