Skip to content

Commit

Permalink
#0000
Browse files Browse the repository at this point in the history
  • Loading branch information
seanox committed Jan 27, 2018
1 parent 428fcc0 commit c025853
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build/
2 changes: 2 additions & 0 deletions .settings/org.eclipse.php.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
include_path=0;/roundup
7 changes: 7 additions & 0 deletions .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="php.core.component"/>
<fixed facet="php.component"/>
<installed facet="php.core.component" version="1"/>
<installed facet="php.component" version="7"/>
</faceted-project>
112 changes: 111 additions & 1 deletion development/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,116 @@
<echo> archives for distribution and </echo>
<echo> development </echo>
</target>

<property name="workspace" value="${basedir}"/>
<property name="workspace.sources" value="${workspace}/sources"/>
<property name="workspace.development" value="${workspace}/development"/>
<property name="workspace.releases" value="${workspace}/releases"/>

<property name="build" value="${workspace}/build"/>
<property name="build.project" value="${build}/${ant.project.name}"/>
<property name="build.sources" value="${build.project}/sources"/>
<property name="build.development" value="${build.project}/development"/>

<macrodef name="release-locate">
<sequential>
<copy file="${workspace.development}/release.txt" tofile="${workspace.development}/release.tmp" overwrite="true"/>
<replaceregexp file="${workspace.development}/release.tmp"
match="(?s)^\s*([\d\.x]+) (\d{4})([\dx]+).*$" flags="g" byline="false"
replace="release.version=\1&#x000D;release.year=\2&#x000D;release.date=\2\3&#x000D;"/>
<replaceregexp file="${workspace.development}/release.tmp" match="x+" replace="0000" flags="g" byline="false"/>
<loadproperties>
<file file="${workspace.development}/release.tmp"/>
</loadproperties>
<delete file="${workspace.development}/release.tmp"/>
</sequential>
</macrodef>

<target name="changes">
<copy file="${workspace.development}/release.txt" tofile="${workspace}/CHANGES" overwrite="true"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00E4;" replace="ae" flags="g"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00C4;" replace="Ae" flags="g"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00F6;" replace="oe" flags="g"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00D6;" replace="Oe" flags="g"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00FC;" replace="ue" flags="g"/>
<replaceregexp file="${workspace}/CHANGES" match="&#x00DC;" replace="Ue" flags="g"/>

<copy file="${workspace.development}/release.txt" tofile="${workspace.development}/release.tmp" overwrite="true"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^\s+" replace="" byline="false"/>
<replaceregexp file="${workspace.development}/release.tmp" match="(?s)^(.*?)[\r\n]+\d[\d\. x]+.*$" replace="\1" byline="false"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^(.*?)\s*$" replace="\1 " flags="g" byline="true"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^(\d[\.\d x]+)[^\r\n]*" replace="## \1" byline="false"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^ +([A-Z]+:.*)\s*$" replace="\1" byline="true"/>
<replaceregexp file="${workspace.development}/release.tmp" match="(?s)[\r\n]+ [^\r\n]+" replace="" flags="g" byline="false"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^(## \d[\.\d]+ \d+)( )" replace="\1 (summary of the current version)\2" flags="g" byline="true"/>
<replaceregexp file="${workspace.development}/release.tmp" match="^(## \d[\.\d]+ [\dx]+)( )" replace="\1 (summary of the next version)\2" flags="g" byline="true"/>
<loadresource property="changes">
<file file="${workspace.development}/release.tmp"/>
</loadresource>
<delete file="${workspace.development}/release.tmp"/>
<replaceregexp file="${workspace}/README.md"
match="(?si)(# Changes \(Change Log\)\s+).*?(\[Read more\])" flags="g" byline="false"
replace="\1${changes}${line.separator}${line.separator}\2"/>
</target>

<target name="archive">
<release-locate/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
<mkdir dir="${build.project}"/>
<copy todir="${build.project}">
<fileset dir="${workspace.sources}">
<include name="${ant.project.name}.filter"/>
<include name="${ant.project.name}.php"/>
<include name="${ant.project.name}.ini"/>
</fileset>
</copy>
<copy file="${workspace}/.license" tofile="${build.project}/license.txt"/>
<copy file="${workspace.development}/release.txt" tofile="${build.project}/release.txt"/>
<copy file="${workspace.development}/readme.txt" tofile="${build.project}/readme.txt"/>
<touch datetime="${release.date}" pattern="yyyyMMdd">
<fileset dir="${build}"/>
</touch>
<delete file="${workspace.releases}/seanox-${ant.project.name}-${release.version}.zip"/>
<zip destfile="${workspace.releases}/seanox-${ant.project.name}-${release.version}.zip"
basedir="${build}" compress="true" filesonly="false" defaultexcludes="false"/>
<touch datetime="${release.date}" pattern="yyyyMMdd"
file="${workspace.releases}/seanox-${ant.project.name}-${release.version}.zip"/>

<delete dir="${build}"/>
<mkdir dir="${build}"/>
<mkdir dir="${build.project}"/>
<copy todir="${build.sources}">
<fileset dir="${workspace.sources}">
<include name="${ant.project.name}.filter"/>
<include name="${ant.project.name}.php"/>
<include name="${ant.project.name}.ini"/>
</fileset>
</copy>
<copy todir="${build.project}">
<fileset dir="${workspace}">
<include name=".license"/>
<include name=".project"/>
</fileset>
</copy>
<copy todir="${build.development}">
<fileset dir="${workspace.development}">
<include name="build.xml"/>
<include name="release.txt"/>
<include name="readme.txt"/>
</fileset>
</copy>
<touch datetime="${release.date}" pattern="yyyyMMdd">
<fileset dir="${build}"/>
</touch>
<delete file="${workspace.releases}/seanox-${ant.project.name}-${release.version}-src.zip"/>
<zip destfile="${workspace.releases}/seanox-${ant.project.name}-${release.version}-src.zip"
basedir="${build}" compress="true" filesonly="false" defaultexcludes="false"/>
<touch datetime="${release.date}" pattern="yyyyMMdd"
file="${workspace.releases}/seanox-${ant.project.name}-${release.version}-src.zip"/>
<delete dir="${build}"/>
</target>



<!-- TODO -->
</project>
42 changes: 42 additions & 0 deletions development/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Description
----

Roundup (alluding to a broadband herbicides) is a background IMAP filter, washer
and reorganizer. This tool uses IMAP to move in a mailbox mails that correspond
to specific regular and logical expressions.
The script is intended for background activities, e.g. as a cron job.



System Requirement
----

- PHP 7.x or higher + imap extension



Installation
----
The script must be stored on a server and is called by a cron job.
e.g. /bin/php -f roundup.php



Configuration
----

The application consists of three files (roundup.php, roundup.ini,
roundup.filter). At runtime, the session file roundup.data is created later.
The files can be renamed. Basis is the file name of the application
(roundup.php). All other file names must be based on it.
The program fileroundup.php itself does not need to be configured.

roundup.ini

There are two sections: COMMON and ACCOUNT.
Please open roundup.ini and read the notices and see the examples.

roundup.filter

The filters are defined here.
Please open roundup.filter and read the instructions and see the examples.
2 changes: 1 addition & 1 deletion development/release.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1.0.0 20180127
NT: Roundup is available as a release
NT: Roundup is available as release
Binary file added releases/seanox-roundup-1.0.0-src.zip
Binary file not shown.
Binary file added releases/seanox-roundup-1.0.0.zip
Binary file not shown.

0 comments on commit c025853

Please sign in to comment.